<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Amit Kulkarni on Medium]]></title>
        <description><![CDATA[Stories by Amit Kulkarni on Medium]]></description>
        <link>https://medium.com/@arkulkarni?source=rss-403b9fc801bc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*cKuCOf1oLb10y1il.jpg</url>
            <title>Stories by Amit Kulkarni on Medium</title>
            <link>https://medium.com/@arkulkarni?source=rss-403b9fc801bc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 07:34:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@arkulkarni/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Azure Notebooks Library for Azure Data Lake]]></title>
            <link>https://medium.com/@arkulkarni/azure-notebooks-library-for-azure-data-lake-c6b815fc684f?source=rss-403b9fc801bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6b815fc684f</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-lake]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[jupyter]]></category>
            <dc:creator><![CDATA[Amit Kulkarni]]></dc:creator>
            <pubDate>Mon, 08 May 2017 23:52:10 GMT</pubDate>
            <atom:updated>2017-05-08T23:52:10.434Z</atom:updated>
            <content:encoded><![CDATA[<h4>A turnkey Jupyter notebook for connecting with Azure Data Lake Store</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xyP6DqdbAYOrAGxOT3vu7g.jpeg" /></figure><p>Last week, I wrote <a href="https://medium.com/azure-data-lake/using-jupyter-notebooks-and-pandas-with-azure-data-lake-store-48737fbad305">this blog post</a> that shows how you can connect to Azure Data Lake Store from Jupyter and Pandas. In my blog, I showed you how to do it from your local machine or from the data science VM on Azure.</p><p>Almost as soon as the post was published <a href="https://twitter.com/chriswilcox47">Chris Wilcox,</a> a co-worker at Microsoft, built this awesome Azure Notebooks library and put a ready made Jupyter notebook there that connects with Azure Data Lake Store.</p><blockquote>Azure Data Lake notebook library: <a href="https://notebooks.azure.com/Microsoft/libraries/AzureDataLake">https://notebooks.azure.com/Microsoft/libraries/AzureDataLake</a></blockquote><blockquote>The Jupyter notebook that connects to Azure Data Lake Store <a href="https://notebooks.azure.com/Microsoft/libraries/AzureDataLake/html/Using%20Azure%20Data%20Lake.ipynb">is located here</a>.</blockquote><p>For those of you that are unfamiliar with <a href="https://notebooks.azure.com/">Azure Notebooks</a>, it is a really handy service on Azure. Azure Notebooks is a turnkey solution for running Jupyter notebooks without the need to spin up any infrastructure whatsoever. You can see sample notebooks, create libraries and also easily share them with your coworkers, students or teachers. Pretty much you just to go to <a href="https://notebooks.azure.com/">https://notebooks.azure.com</a> and get started in minutes.</p><p>To get notebooks in the <a href="https://notebooks.azure.com/Microsoft/libraries/AzureDataLake">Azure Data Lake library</a>, you open the library in your browser and then click Clone. After that you will have a copy of the notebooks in there in your own account. You can modify the code and use the notebook as you wish.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4qjbfBEZc7h6EXVsjD_vIw.png" /></figure><p>If you have questions or comments, you can find me on Twitter <a href="https://twitter.com/kulkarni_amit">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6b815fc684f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Jupyter notebooks and Pandas with Azure Data Lake Store]]></title>
            <link>https://medium.com/azure-data-lake/using-jupyter-notebooks-and-pandas-with-azure-data-lake-store-48737fbad305?source=rss-403b9fc801bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/48737fbad305</guid>
            <category><![CDATA[data-lake]]></category>
            <category><![CDATA[pandas]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Amit Kulkarni]]></dc:creator>
            <pubDate>Fri, 05 May 2017 22:50:03 GMT</pubDate>
            <atom:updated>2017-05-05T23:23:14.738Z</atom:updated>
            <content:encoded><![CDATA[<h4>Data science and advanced analysis using Python on data in your data lake store account</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VoboMjV4ZoYX2fcECAzhkQ.jpeg" /></figure><p>Here’s a question I hear every few days. How do I access data in the data lake store from my Jupyter notebooks? People generally want to load data that is in Azure Data Lake Store into a data frame so that they can analyze it in all sorts of ways.</p><p>Before we dive into the details, it is important to note that there are two ways to approach this depending on your scale and topology.</p><h3>The easy way — using PySpark</h3><p>If you already have a Spark cluster running and configured to use your data lake store then the answer is rather easy. You can simply open your Jupyter notebook running on the cluster and use PySpark.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*1_ozLQ2edG7ns7ZzQBbCvg.png" /></figure><p>Here is the <a href="https://docs.microsoft.com/en-us/azure/hdinsight/hdinsight-apache-spark-jupyter-spark-sql">document</a> that shows how you can set up an HDInsight Spark cluster. My previous <a href="https://medium.com/azure-data-lake/connecting-your-own-hadoop-or-spark-to-azure-data-lake-store-93d426d6a5f4">blog post</a> also shows how you can set up a custom Spark cluster that can access Azure Data Lake Store. This method works great if you already plan to have a Spark cluster or the data sets you are analyzing are fairly large.</p><p>I will not go into the details of how to use Jupyter with PySpark to connect to Azure Data Lake store in this post. <a href="https://docs.microsoft.com/en-us/azure/hdinsight/hdinsight-apache-spark-use-with-data-lake-store">This article</a> in the documentation does an excellent job at it.</p><h3>Even easier — Using the Azure Data Lake Python SDK</h3><p>On the other hand, sometimes you just want to run Jupyter in standalone mode and analyze all your data on a single machine. You simply want to reach over and grab a few files from your data lake store account to analyze locally in your notebook.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*tjyUdXYIXzsGLQKBdkRnwA.png" /></figure><p>This is also fairly a easy task to accomplish using the Python SDK of Azure Data Lake Store. In this post I will show you all the steps required to do this.</p><h3>Prerequisites</h3><p>For the rest of this post, I assume that you have some basic familiarity with Python, Pandas and Jupyter.</p><p>On your machine, you will need all of the following installed:</p><ol><li>Python 2 or 3 with Pip</li><li>Pandas</li><li>Jupyter</li></ol><p>You can install all these locally on your machine. A great way to get all of this and many more data science tools in a convenient bundle is to use the <a href="https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-data-science-virtual-machine-overview">Data Science Virtual Machine</a> on Azure. I really like it because it’s a one stop shop for all the cool things needed to do advanced data analysis.</p><p>I also frequently get asked about how to connect to the data lake store from the data science VM. So this article will try to kill two birds with the same stone. I show you how to do this locally or from the data science VM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*sAg5_24ni0Yq38MZD0eXkA.png" /></figure><p>The <a href="https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-data-science-virtual-machine-overview">Data Science Virtual Machine</a> is available in many flavors. I am going to use the Ubuntu version as shown in this screenshot.</p><h3>Installing the Azure Data Lake Store Python SDK</h3><p>If you want to learn more about the Python SDK for Azure Data Lake store, the first place I will recommend you start <a href="https://docs.microsoft.com/en-us/azure/data-lake-store/data-lake-store-get-started-python">is here</a>. Installing the Python SDK is really simple by running these commands to download the packages.</p><h4>On the local machine</h4><p>This is very simple. I am assuming you have only one version of Python installed and pip is set up correctly. You simply need to run these commands and you are all set.</p><pre>pip install azure-mgmt-resource<br>pip install azure-mgmt-datalake-store<br>pip install azure-datalake-store</pre><h4>On the data science virtual machine</h4><p>Here it is slightly more involved but not too difficult. There are multiple versions of Python installed (2.7 and 3.5) on the VM. You need to install the Python SDK packages separately for each version. Additionally, you will need to run pip as root or super user.</p><p><strong>For Python 3.5</strong></p><p>First run bash retaining the path which defaults to Python 3.5. Then check that you are using the right version of Python and Pip.</p><pre>sudo env PATH=$PATH bash<br>python --version<br>pip --version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*lNNpFu1wzB0o3Ci-5hwpQg.png" /><figcaption>Here I can see that everything is on Python 3.5</figcaption></figure><p>Now install the three packages.</p><pre>pip install azure-mgmt-resource<br>pip install azure-mgmt-datalake-store<br>pip install azure-datalake-store</pre><p>You can validate that the packages are installed correctly by running the following command.</p><pre>pip list | grep &#39;azure-datalake-store\|azure-mgmt-datalake-store\|azure-mgmt-resource&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*hL-dPY4v_PboUQkuoyU8xw.png" /><figcaption>The packages are installed on my VM</figcaption></figure><p><strong>For Python 2.7</strong></p><p>Run bash <strong>NOT</strong> retaining the path which defaults to Python 2.7. Then check that you are using the right version of Python and Pip. To run pip you will need to load it from /anaconda/bin. This is the correct version for Python 2.7.</p><pre>sudo env PATH=$PATH bash<br>python --version<br>/anaconda/bin/pip --version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*umii7vJNG60Mu8BK1wDWDQ.png" /><figcaption>Here everything is using Python 2.7</figcaption></figure><p>Now install the three packages loading pip from /anaconda/bin.</p><pre>/anaconda/bin/pip install azure-mgmt-resource<br>/anaconda/bin/pip install azure-mgmt-datalake-store<br>/anaconda/bin/pip install azure-datalake-store</pre><p>Check that the packages are indeed installed correctly by running the following command.</p><pre>/anaconda/bin/pip list | grep &#39;azure-datalake-store\|azure-mgmt-datalake-store\|azure-mgmt-resource&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*jSDDcxN6-SPcwmy2Nrv3lg.png" /><figcaption>Everything seems to be installed correctly</figcaption></figure><h3>Start a Jupyter Notebook</h3><p>On the data science VM you can navigate to https://&lt;IP address&gt;:8000. If you are running on your local machine you need to run jupyter notebook.</p><p>Create a new Jupyter notebook with the Python 2 or Python 3 kernel. In this example, I am going to create a new Python 3.5 notebook. If you have installed the Python SDK for 2.7, it will work equally well in the Python 2 notebook.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n1rL-uUPYiDRTfv6kbVEUQ.png" /></figure><h4>Obtain an authentication token</h4><p>In order to read data from your Azure Data Lake Store account, you need to authenticate to it. There are multiple ways to authenticate. In this example below, let us first assume you are going to connect to your data lake account just as your own user account. The following method will work in most cases — even if your organization has enabled multi factor authentication and has Active Directory federation enabled.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6f80243b02346201bf6fcb6fd0ee076b/href">https://medium.com/media/6f80243b02346201bf6fcb6fd0ee076b/href</a></iframe><p>Running this in Jupyter will show you an instruction similar to the following. Click that URL and following the flow to authenticate with Azure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NvthG1gE4DHgwHvfLIIfGQ.png" /></figure><h4>Load an Azure Data Lake Store file into a Pandas data frame</h4><p>Once you go through the flow, you are authenticated and ready to access data from your data lake store account.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d6ffbccc9a006506910764a153129151/href">https://medium.com/media/d6ffbccc9a006506910764a153129151/href</a></iframe><p>If you run it in Jupyter, you can get the data frame from your file in the data lake store account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kTSQO2wi1Jk8P70NC1AycA.png" /></figure><p>Here onward, you can now <em>panda-away </em>on this data frame and do all your analysis.</p><h4>Using a Service Principal Identity</h4><p>There is another way one can authenticate with the Azure Data Lake Store. That way is to use a service principal identity. A step by step tutorial for setting up an Azure AD application, retrieving the client id and secret and configuring access using the SPI is <a href="https://docs.microsoft.com/en-us/azure/data-lake-store/data-lake-store-authenticate-using-active-directory#create-an-active-directory-application">available here</a>.</p><p>Once you get all the details, replace the authentication code above with these lines to get the token. After you have the token, everything there onward to load the file into the data frame is identical to the code above.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b2f9586e315b4767c0eeae3273d27e2e/href">https://medium.com/media/b2f9586e315b4767c0eeae3273d27e2e/href</a></iframe><h3>Summary</h3><p>To round it all up, basically you need to install the Azure Data Lake Store Python SDK and thereafter it is really easy to load files from the data lake store account into your Pandas data frame. It works with both interactive user identities as well as service principal identities.</p><p>Hopefully, this article helped you figure out how to get this working. If you have questions or comments, you can find me on Twitter <a href="https://twitter.com/kulkarni_amit">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48737fbad305" width="1" height="1" alt=""><hr><p><a href="https://medium.com/azure-data-lake/using-jupyter-notebooks-and-pandas-with-azure-data-lake-store-48737fbad305">Using Jupyter notebooks and Pandas with Azure Data Lake Store</a> was originally published in <a href="https://medium.com/azure-data-lake">Azure Data Lake</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Wiring your older Hadoop clusters to access Azure Data Lake Store]]></title>
            <link>https://medium.com/azure-data-lake/wiring-your-older-hadoop-clusters-to-access-azure-data-lake-store-9cb54847842e?source=rss-403b9fc801bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/9cb54847842e</guid>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[hadoop]]></category>
            <category><![CDATA[spark]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Amit Kulkarni]]></dc:creator>
            <pubDate>Mon, 27 Feb 2017 19:18:16 GMT</pubDate>
            <atom:updated>2017-02-27T19:18:16.576Z</atom:updated>
            <content:encoded><![CDATA[<h4>For Hadoop versions lower than 3.0, you need some additional setup in order to access the data lake store.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q8JUnmrElZv9ffOgbo3HyA.jpeg" /></figure><p>In a couple of recent articles, we discussed <a href="https://medium.com/azure-data-lake/connecting-your-own-hadoop-or-spark-to-azure-data-lake-store-93d426d6a5f4#.sqnjy4hv3">how to connect</a> any Hadoop or Spark cluster to Azure Data Lake Store and how to <a href="https://medium.com/azure-data-lake/connecting-your-own-hadoop-or-spark-to-azure-data-lake-store-93d426d6a5f4#.ddxbxwncj">make it the default file system</a>. These instructions work great if you are using the latest versions of Hadoop (3.0 and later). The binaries for the newer versions come bundled with all the components that are required to access Azure Data Lake Store. However, if you are using an older version of Hadoop you need to manually install the components to access ADLS. In this article, I will show you how to wire it all up.</p><blockquote>The key to getting your older versions to talk to Azure Data Lake Store is installing the required binaries.</blockquote><h3>How old is really old?</h3><p>The Azure Data Lake Store binaries have been broadly certified for Hadoop distributions after 3.0 and above. We are really in uncharted territory for lower versions. So the farther away you go from 3.0 the higher the likelihood of them not working. My personal recommendation is to go no lower than 2.6. After that your mileage may really vary.</p><h3>Getting Hadoop 2.6 installed</h3><p>Similar to my prior posts, I am going to describe the concepts by installing Hadoop locally on a single box. Let’s download the binaries directly from the <a href="http://hadoop.apache.org/releases.html">Hadoop Apache Releases page</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cVioxpXMpGRuYwr5YXBk3g.png" /></figure><p>Get the binaries for version 2.6.5 and unpack them. On my machine I extracted them to C:\hadoop-2.6.5</p><p>Now let us configure this setup to access Azure Data Lake Store</p><h3>Configure Hadoop to access Azure Data Lake Store</h3><p>At this point you pretty much want to follow <a href="https://medium.com/azure-data-lake/connecting-your-own-hadoop-or-spark-to-azure-data-lake-store-93d426d6a5f4#.vqtd1elae">this previous pos</a>t to configure your Hadoop setup. The steps you want to follow are:</p><ol><li>Download winutils.exe and hadoop.dll</li><li>Set JAVA_HOME</li><li>Add %HADOOP_HOME%\share\hadoop\tools\lib\* to HADOOP_CLASSPATH</li><li>Creating the identity and getting the credentials to access Azure Data Lake Store</li><li>Modify core-site.xml to set these properties up</li></ol><pre>dfs.adls.oauth2.access.token.provider.type<br>dfs.adls.oauth2.refresh.url<br>dfs.adls.oauth2.client.id<br>dfs.adls.oauth2.credential<br>fs.adl.impl<br>fs.AbstractFileSystem.adl.impl</pre><p>These steps are all explained in full details in the article. After you the steps above, you are not quite done yet. At this point if you try to access Azure Data Lake Store, you will see an error similar to the following.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bUxJKzMkGXDs6amjfOswVg.png" /></figure><p>The reason we see this is because the binaries that are required to access the Azure Data Lake Store, are not baked in the 2.6 builds. These are the two binaries that are needed:</p><ul><li>hadoop-azure-datalake-&lt;version&gt;.jar</li><li>azure-data-lake-store-sdk-&lt;version&gt;.jar</li></ul><p>In the remainder of the article, we will talk about how to get them.</p><h3>Getting the Data Lake Hadoop File System client</h3><p>The <em>proper</em> way to get hadoop-azure-datalake-&lt;version&gt;.jaris to back port <a href="https://issues.apache.org/jira/browse/HADOOP-13037">Hadoop-13037</a> for your Hadoop version and build it. That, however, is not for the faint of heart. Describing how to do it this way is outside the scope of this article.</p><p>Here, I am going to cheat a little bit and show a slightly easier way. Basically we are going to get the binaries from newer builds of Hadoop directly from Apache. So similar to how I described in the <a href="https://medium.com/azure-data-lake/connecting-your-own-hadoop-or-spark-to-azure-data-lake-store-93d426d6a5f4#.vqtd1elae">previous article</a>, let’s download and extract a newer version of Hadoop (3.0 alpha 2 or above).</p><p>Then locate the file in the downloaded build.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DILrH5COyTem1GljfAiQ6g.png" /></figure><p>I extracted my build to C:\hadoop-3.0.0-alpha2. The file will be under share\hadoop\tools\lib</p><p>Copy it to your older Hadoop version in the same sub-path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Vs9rbl-vcblv36hTqz3jA.png" /></figure><p>Next, let’s get the latest Azure Data Lake Store Java SDK</p><h3>Downloading the Azure Data Lake Store Java SDK from Maven</h3><p>The latest version of ADLS Java SDK can be found in the Maven repository. Go to <a href="https://search.maven.org/">https://search.maven.org/</a> and search for “data lake”. You want to locate the ArtifactId azure-data-lake-store-sdk.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OblnT8HaDHThwdvZSidZVg.png" /></figure><p>You want to download the latest version in to the same relative location in 2.6 folder. i.e C:\hadoop-2.6.5\share\hadoop\tools\lib</p><h3>Test that everything works</h3><p>Now that everything is set up properly, access to Azure Data Lake Store should work for you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9lQlpbQ-GFMtRmz0hx6Hpg.png" /></figure><p>There you go. Now you can enjoy connectivity to the the data lake store from your Hadoop setup.</p><h3>Summary</h3><p>In addition to all the other steps required, the main difference with older Hadoop versions are that they do not come bundled with the binaries needed to access Azure Data Lake Store. Once you have the binaries installed correctly, you can access Azure Data Lake Store.</p><p><em>For questions and comments reach out to me on Twitter </em><a href="https://twitter.com/kulkarni_amit"><em>here</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9cb54847842e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/azure-data-lake/wiring-your-older-hadoop-clusters-to-access-azure-data-lake-store-9cb54847842e">Wiring your older Hadoop clusters to access Azure Data Lake Store</a> was originally published in <a href="https://medium.com/azure-data-lake">Azure Data Lake</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Making Azure Data Lake Store the default file system for Hadoop]]></title>
            <link>https://medium.com/azure-data-lake/making-azure-data-lake-store-the-default-file-system-for-hadoop-2c920e55f7f9?source=rss-403b9fc801bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c920e55f7f9</guid>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[hadoop]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[azure-data-lake]]></category>
            <category><![CDATA[spark]]></category>
            <dc:creator><![CDATA[Amit Kulkarni]]></dc:creator>
            <pubDate>Tue, 21 Feb 2017 17:09:53 GMT</pubDate>
            <atom:updated>2017-02-21T17:10:02.462Z</atom:updated>
            <content:encoded><![CDATA[<h4>Configuring your Hadoop cluster to use Azure Data Lake Store as the default file system is really easy. You just need to set one property in your core-site.xml</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*prjnL1V1OgyVtYrhssOUSQ.jpeg" /></figure><p>In <a href="https://medium.com/azure-data-lake/connecting-your-own-hadoop-or-spark-to-azure-data-lake-store-93d426d6a5f4#.9ggc805v0">my previous post</a>, I showed you how you can connect your own Hadoop and Spark clusters to Azure Data Lake Store (<a href="https://azure.microsoft.com/en-us/services/data-lake-store/">ADLS</a>). If you follow the instructions, you will end up with a Hadoop installation that can successfully connect to ADLS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*_ZPaSU50Xy6W6mJZ0GVhHw.png" /><figcaption>Querying Azure Data Lake Store using hdfs dfs commands</figcaption></figure><p>In this post, we will take our installation one step further and make Azure Data Lake Store the default file system for our Hadoop.</p><h3>What is the default file system for Hadoop?</h3><p>Simply put, the default file system is what relative paths resolve against. What does this mean? Basically, there are two ways in which you can specify paths in Hadoop namely absolute paths and relative paths. Absolute paths are simple. They contain a path prefix which identifies the file system and then the whole path to locate a file or a folder. Here are some examples of an absolute paths.</p><pre>hdfs://123.23.12.4344:9000/user/filename.txt<br>adl://amitadls.azuredatalakestore.net/accounts.csv</pre><p>A relative path, on the other hand, simply provides a sub path without the prefix identifying the file system. For example a relative path may look like the following /user/filename.txt. At run time Hadoop looks up the default file system and then combines it with the relative path to come up with the absolute path.</p><blockquote>Relative paths are resolved against the default file system on Hadoop</blockquote><p>So to give a concrete example, if the default file system was hdfs://123.23.12.4344:9000 then the /user/filename.txt would resolve to hdfs://123.23.12.4344:9000/user/filename.txt.</p><p>Why does the default file system matter? The first answer to this is purely convenience. It is a heck lot easier to simply say /events/sensor1/ than adl://amitadls.azuredatalakestore.net/ in code and configurations. Secondly, many components in Hadoop use relative paths by default. For instance there are a fixed set of places, specified by relative paths, where various applications generate their log files. Finally, many ISV applications running on Hadoop specify important locations by relative paths.</p><h3>Setting the default file system</h3><p>OK let’s cut to the chase. The property in Hadoop that specifies the default file system is called fs.defaultFS. You set it up in core-site.xml. The core-site.xml is located in %HADOOP_HOME%\etc\hadoop. You can read more about this property<a href="https://hadoop.apache.org/docs/r2.4.1/hadoop-project-dist/hadoop-common/core-default.xml"> on this page</a> in the Hadoop docs. <em>Note: Do not set </em><em>fs.default.name as it is now deprecated</em>.</p><p>By default, this property points to local file system in a single machine install of Hadoop. For most Hadoop clusters, this property is configured to point to the Hadoop Distributed File System (HDFS). On my machine, if I run hdfs dfs -ls /temp it enumerates the local hard drive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*FNfqZxpFOTCclX0LKPxdkQ.png" /></figure><p>I am going to add the following lines to my core-site.xml. This will make ADLS the default file system</p><pre>&lt;property&gt;<br>&lt;name&gt;fs.defaultFS&lt;/name&gt;&lt;value&gt;adl://amitadls.azuredatalakestore.net/&lt;/value&gt;<br>&lt;/property&gt;</pre><p>Now, if I run hdfs dfs -ls / it enumerates my Azure Data Lake Store account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dyS3vNExTIpiJRTqY8glyg.png" /></figure><p>Here’s a screenshot from my Azure portal to show you that indeed it is enumerating the content of my data lake store account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e-SoWTTrnkAEh2L7JJVusg.png" /></figure><h3>Summary</h3><p>There. It’s that simple! You just need to set the fs.defaultFS property in core-site.xml to Azure Data Lake Store. Once you do that, all relative paths will thereafter resolve directly against your Azure Data Lake Store account.</p><p><em>You can find me on Twitter </em><a href="https://twitter.com/kulkarni_amit"><em>here</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c920e55f7f9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/azure-data-lake/making-azure-data-lake-store-the-default-file-system-for-hadoop-2c920e55f7f9">Making Azure Data Lake Store the default file system for Hadoop</a> was originally published in <a href="https://medium.com/azure-data-lake">Azure Data Lake</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connecting your own Hadoop or Spark to Azure Data Lake Store]]></title>
            <link>https://medium.com/azure-data-lake/connecting-your-own-hadoop-or-spark-to-azure-data-lake-store-93d426d6a5f4?source=rss-403b9fc801bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/93d426d6a5f4</guid>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[azure-data-lake]]></category>
            <category><![CDATA[spark]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[hadoop]]></category>
            <dc:creator><![CDATA[Amit Kulkarni]]></dc:creator>
            <pubDate>Fri, 17 Feb 2017 06:20:14 GMT</pubDate>
            <atom:updated>2017-05-05T00:35:50.498Z</atom:updated>
            <content:encoded><![CDATA[<h4>Works with any cluster or even when running locally</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*iYJgfYgxDWBcfWjl1twsag.png" /></figure><p>Azure Data Lake Store (<a href="https://azure.microsoft.com/en-us/services/data-lake-store/">ADLS</a>)is completely integrated with <a href="https://azure.microsoft.com/en-us/services/hdinsight/">Azure HDInsight</a> out of the box. Using HDInsight you can enjoy an awesome experience of fully managed Hadoop and Spark clusters on Azure. If you’re starting anew, I would strongly recommend beginning with HDInsight and then considering other choices if needed.</p><p>That said, if you are running your own Hadoop/Spark clusters it is also really easy to access or store data in Azure Data Lake Store. This will work if your cluster is in Azure, on premises or you don’t even have a full blown cluster and are trying Hadoop/Spark locally. The instructions below are pretty much similar in all these cases.</p><blockquote>Configuring a Hadoop or Spark cluster to access Azure Data Lake Store is really easy.</blockquote><p>In this post, I am going to show you how to connect Spark running locally on my machine to ADLS. Along the way you will learn how to do this for Hadoop as well.</p><h3>What you need</h3><p>Obviously, you need to first have an ADLS account set up in your Azure subscription. If you want to know more about setting up Azure Data Lake Store visit <a href="https://docs.microsoft.com/en-us/azure/data-lake-store/data-lake-store-get-started-portal">this documentation page</a>.</p><p>Here, I have my ADLS account called amitadls.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*xnkgOohbFuLbOMY5brFrjQ.png" /></figure><p>On your machine you also need to have Java installed. On mine, I have the latest Java SE Development Kit that I downloaded <a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html">from here</a>.</p><p>The setup below is on my Windows machine. However, it is not much different to get this going on other platforms like Linux or Mac. Simply skip the steps that I outlined which are Windows-specific.</p><p>With the pre-reqs taken care of, let’s get going with Spark and Hadoop.</p><h3>Download Spark</h3><p>Download the latest Spark distribution directly from <a href="http://spark.apache.org/downloads.html">the Apache page</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*6VZRNCj79FqmvOCcdlrGPA.png" /></figure><p>At time of print, the latest version is 2.1.0. Choose the package pre-built with user-provided Hadoop. You need to extract the binaries locally on your machine.</p><p><em>Useful Tip: </em>On Windows if you need to extract tar.gz or .tgz files, you can use <a href="http://www.7-zip.org/">7-Zip</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/1*P5hh6m_0EPKUxR3zx_7evw.png" /></figure><p>On my Windows machine, I extracted the binaries to a folder called C:\spark-2.1.0-bin-without-hadoop</p><h3>Download Hadoop</h3><p>Download the latest Hadoop binaries directly from Apache <a href="http://hadoop.apache.org/releases.html">at this location</a> .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*3r3JhRZd1JpSYhdVvVDIbg.png" /></figure><p>You need to get version 3.0.0-alpha2 or above. These versions are bundled with the client that can directly talk to Azure Data Lake Store. Note that you need to get the <strong>binaries </strong>tarball and <em>not </em>the sources. Extract the binaries on your local machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/1*99N7bQTumYAyjBxQaMbtwA.png" /></figure><p>On my machine, I extracted them to C:\hadoop-3.0.0-alpha2</p><h3>Download winutils.exe and hadoop.dll</h3><p>To run Hadoop on Windows, there are some special considerations. The Apache page that describes them is <a href="https://wiki.apache.org/hadoop/WindowsProblems">located here</a>. The bottom line of this is that you need two special binaries on Windows in order to get everything set up correctly. They are winutils.exe and hadoop.dll.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TuoVBsowWKfF7C9mzFP1Hw.png" /></figure><p>Typically, they are not packaged in the Hadoop build that you just downloaded from Apache. You need to get them from <a href="https://github.com/steveloughran/winutils">GitHub here</a>. There is no special version there for Hadoop 3.0. So what you want to do is to get the 2.7.1 version. It seems to works fine on our 3.0-alpha2 that we previously downloaded.</p><p>Put the two files in the bin directory of your Hadoop.</p><p><em>Disclaimer: These are binaries off GitHub. Use them at your own risk. There is perhaps a way to build these from sources of prior Hadoop versions. However, how to do that is out of scope for this article.</em></p><h3>Configure your Hadoop installation</h3><p>Now that you’ve got all the binaries needed, you need to do some basic configuration. You are going to set a couple of parameters in the %HADOOP_HOME%\etc\hadoop\hadoop-env.cmd.</p><ol><li>You need to set the JAVA_HOME property for Hadoop. Hadoop is kinda finicky about the way you specify this. Typically on Windows Java gets installed in C:\Program Files\Java. Hadoop does not like spaces in JAVA_HOME. So it needs to be set to the DOS-path which is something like C:\PROGRA~1\Java\jdk1.8.0_121. Set it correctly based on the Java version that you have installed.</li><li>The HADOOP_CLASSPATH needs to have %HADOOP_HOME%\share\hadoop\tools\lib\* . You need this because the directory that contains the two JAR files that are needed to access ADLS. These are the two JAR files of relevance here</li></ol><ul><li>hadoop-azure-datalake-3.0.0-alpha2.jar</li><li>azure-data-lake-store-sdk-2.0.11.jar</li></ul><p>Your hadoop-env.cmd needs to look like this after this step</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*uKY4bkRRiO1MMU-VlJoy8A.png" /></figure><h3>Test your Hadoop</h3><p>By now, your Hadoop installation is pretty much all configured for local use. We have not yet completed everything that is needed to access ADLS. However, before going there it is prudent to ensure that the Hadoop-specific and Windows-specific parts are set correctly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*-JpVQphxWFw7cZe8QENkBQ.png" /></figure><p>First run bin\hadoop classpath. It should work correctly with the whole class path showing.</p><p>Next we will try to see whether Hadoop can enumerate local files. This requires that the winutils.exe and hadoop.dll be installed correctly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*FNfqZxpFOTCclX0LKPxdkQ.png" /></figure><p>Run bin\hdfs dfs -ls /temp. This should correctly show the listing of the local directory.</p><p>If these two steps work, everything is configured correctly locally. Now we are going to wire up our Hadoop setup to access Azure Data Lake Store</p><h3>Create the identity to access Azure Data Lake Store</h3><p>Azure Data Lake Store uses Azure Active Directory (AAD) to manage identities that can access it. There are multiple types of identities that AAD supports such as users and service principal identities (SPI). For long running processes such as a Hadoop/Spark cluster, service principal identities are an elegant choice.</p><p>The general steps to set up identities and providing access to the right data in ADLS are as follows:</p><ol><li>Create an Azure AD web application</li><li>Retrieve the client ID, client secret, and token endpoint for the Azure AD web application.</li><li>Configure access for the Azure AD web application on the Data Lake Store folders/files that you want to access from the cluster.</li></ol><p>A step by step tutorial for how to perform the steps above is provided <a href="https://docs.microsoft.com/en-us/azure/data-lake-store/data-lake-store-authenticate-using-active-directory#create-an-active-directory-application">at this location</a>.</p><p>After completing the steps above you should have obtained the following pieces of data to continue configuring your cluster.</p><ul><li>Client ID</li><li>Client Secret</li><li>Token Endpoint</li></ul><h3>Modify the core-site.xml in your Hadoop cluster</h3><p>The main step in configuring Hadoop to access ADLS is to setup the Azure Data Lake File System. This is achieved by editing your core-site.xml, which contains cluster-wide configuration. The core-site.xml is located in %HADOOP_HOME%\etc\hadoop</p><p>Below are the settings in core-site.xml that you need to set. Be sure to substituteYOUR TOKEN ENDPOINT, YOUR CLIENT ID and YOUR CLIENT SECRET with the values that you obtained in the previous step.</p><pre>&lt;configuration&gt;</pre><pre>  &lt;property&gt;<br>        &lt;name&gt;dfs.adls.oauth2.access.token.provider.type&lt;/name&gt;<br>        &lt;value&gt;ClientCredential&lt;/value&gt;<br>  &lt;/property&gt;<br>  <br>  &lt;property&gt;<br>      &lt;name&gt;dfs.adls.oauth2.refresh.url&lt;/name&gt;<br>      &lt;value&gt;YOUR TOKEN ENDPOINT&lt;/value&gt;<br>  &lt;/property&gt;</pre><pre>  &lt;property&gt;<br>      &lt;name&gt;dfs.adls.oauth2.client.id&lt;/name&gt;<br>      &lt;value&gt;YOUR CLIENT ID&lt;/value&gt;<br>  &lt;/property&gt;</pre><pre>  &lt;property&gt;<br>      &lt;name&gt;dfs.adls.oauth2.credential&lt;/name&gt;<br>      &lt;value&gt;YOUR CLIENT SECRET&lt;/value&gt;<br>  &lt;/property&gt;</pre><pre>  &lt;property&gt;<br>      &lt;name&gt;fs.adl.impl&lt;/name&gt;<br>      &lt;value&gt;org.apache.hadoop.fs.adl.AdlFileSystem&lt;/value&gt;<br>  &lt;/property&gt;</pre><pre>  &lt;property&gt;<br>      &lt;name&gt;fs.AbstractFileSystem.adl.impl&lt;/name&gt;<br>      &lt;value&gt;org.apache.hadoop.fs.adl.Adl&lt;/value&gt;<br>  &lt;/property&gt;  </pre><pre>&lt;/configuration&gt;</pre><p>What this does is that it configures Hadoop to use the Azure Data Lake Store file system client. This is the component that interacts with Azure Data Lake Store. To read more about the Azure Data Lake Store client in Hadoop, you can <a href="http://hadoop.apache.org/docs/r3.0.0-alpha2/hadoop-azure-datalake/index.html">visit this page</a>.</p><p>Now you have configured Hadoop and are ready to test your connection to Azure Data Lake Store.</p><h3>Test connectivity to Azure Data Lake Store from Hadoop</h3><p>Once everything above is set up, verifying that everything works and you are able to connect to ADLS through Hadoop is really easy. You simply run hdfs dfs shell commands that are built in with Hadoop to check connectivity. Here are some examples.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_ZPaSU50Xy6W6mJZ0GVhHw.png" /></figure><p>Pretty cool, huh? Basically most of this article was all about getting Hadoop set up correctly. The Azure Data Lake specific portions were simply setting up the credentials and including the client in the Hadoop class path.</p><blockquote>Once you set up the right credentials in core-site.xml, connecting to ADLS is straightforward.</blockquote><p>Now that Hadoop is set up correctly, we can move onward to Spark</p><h3>Configuring Spark to connect to ADLS</h3><p>Spark primarily relies on the Hadoop setup on the box to connect to data sources including Azure Data Lake Store. So the Spark configuration is primarily telling Spark where Hadoop is on the box. This is done by setting environment variables. Here are the variables to set</p><ul><li>HADOOP_HOME = Point to the Hadoop installation on the box. In my case it is C:\hadoop-3.0.0-alpha2</li><li>SPARK_HOME = Point to the directory that contains the Spark binaries. For my machine it is C:\spark-2.1.0-bin-without-hadoop</li><li>SPARK_DIST_CLASSPATH = You need to run “hadoop classpath”. Then copy the output of that and set this.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*XJfmV_a_emkkgu7iWxQDsw.png" /></figure><p>Here is me setting the environment variables in my console</p><p>Now you are all set to use Spark.</p><h3>Using Azure Data Lake Store through Spark</h3><p>You can try this step either through the Scala or PySpark shells. Being a Python fan, I personally prefer PySpark. This will also work equally well through Scala, Spark SQL and pretty much everything that runs on Spark. To launch PySpark simply run bin\pyspark from %SPARK_HOME%.</p><p>Once PySpark is launched, you can run some basic code to check that you can indeed connect to your ADLS account and use data in it. Here is probably the most trivial piece of code that will test it</p><pre>rdd = sc.textFile(&quot;adl://amitadls.azuredatalakestore.net/accounts.csv&quot;)</pre><pre>rdd.count()</pre><p>What this does is that it creates a simple RDD from a CSV file that is stored in ADLS. When the path starts with adl:// Spark calls into Hadoop to load the right file system client. Since we have properly configured Hadoop already, it knows where to load the client from and what credentials to use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*K8yKYYGf-21NuDQH-ewk5g.png" /><figcaption>Here is me connecting to my Azure Data Lake Store account and reading a CSV file</figcaption></figure><p>You’re now in business and can use Azure Data Lake Store as a file system from Spark.</p><h3>Conclusion</h3><p>In this post, we looked at how to connect both Hadoop and Spark to Azure Data Lake Store. The bulk of this article simply contains the gory details of getting Hadoop and Spark themselves set up on a Windows box. The ADLS-specific parts are pretty much setting up the credentials and including the client jars in the class path.</p><p>These core concepts will work equally well if you are trying on an actual Hadoop or Spark cluster instead of this single-box setup. Also you can connect to ADLS from anywhere that you can reach the public HTTPS endpoint of ADLS. So it will work on Azure VMs, on premises or other cloud providers.</p><p>Hopefully, this was easy to follow and you are able to get this working on your end. If you have any questions please feel free to reach out me. Enjoy!</p><p>You can find me on Twitter <a href="https://twitter.com/kulkarni_amit">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93d426d6a5f4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/azure-data-lake/connecting-your-own-hadoop-or-spark-to-azure-data-lake-store-93d426d6a5f4">Connecting your own Hadoop or Spark to Azure Data Lake Store</a> was originally published in <a href="https://medium.com/azure-data-lake">Azure Data Lake</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Announcing — Android app for Opineon]]></title>
            <link>https://medium.com/opineon-blog/announcing-android-app-for-opineon-dbb86af699e?source=rss-403b9fc801bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/dbb86af699e</guid>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Amit Kulkarni]]></dc:creator>
            <pubDate>Tue, 10 May 2016 23:53:03 GMT</pubDate>
            <atom:updated>2016-05-11T00:21:41.640Z</atom:updated>
            <content:encoded><![CDATA[<p>After several months of interest, today we are happy to announce that the wait is over! The Opineon app for Android devices is now available. It is a free app and can be downloaded from the<a href="https://play.google.com/store/apps/details?id=com.opineonapp"> Google Play Store</a>.</p><figure><a href="https://play.google.com/store/apps/details?id=com.opineonapp"><img alt="" src="https://cdn-images-1.medium.com/max/500/1*tGdh5Da8H0kWKLlLXT9ZHQ.png" /></a></figure><p>To learn more about Opineon visit our website at <a href="http://opineonapp.com/">http://opineonapp.com</a></p><p><a href="https://play.google.com/store/apps/details?id=com.opineonapp">Download the app</a> today and let us know your feedback. You can reach us on Twitter <a href="https://twitter.com/opineonapp">@opineonapp</a> or by email <a href="/service/mailto:support@opineonapp.com">support@opineonapp.com</a></p><p>— The Opineon Team</p><p><em>Development of iOS app is in progress. Sign up to be notified of its availability by </em><a href="https://docs.google.com/forms/d/1VyQZ9mlDSqkfjg_seBu-yAFTSHmyCLuzMtAB4ztl3oY/viewform"><em>clicking here</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dbb86af699e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/opineon-blog/announcing-android-app-for-opineon-dbb86af699e">Announcing — Android app for Opineon</a> was originally published in <a href="https://medium.com/opineon-blog">Opineon Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>