<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: jrotenstein</title>
    <description>The latest articles on DEV Community by jrotenstein (@jrotenstein).</description>
    <link>https://dev.to/jrotenstein</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F550307%2Fac9db2c2-3572-4374-95cc-7e35f558f054.jpeg</url>
      <title>DEV Community: jrotenstein</title>
      <link>https://dev.to/jrotenstein</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jrotenstein"/>
    <language>en</language>
    <item>
      <title>Easy Zeppelin install on Mac, to use AWS Athena</title>
      <dc:creator>jrotenstein</dc:creator>
      <pubDate>Thu, 13 May 2021 02:33:43 +0000</pubDate>
      <link>https://dev.to/jrotenstein/easy-zeppelin-install-on-mac-to-use-aws-athena-1had</link>
      <guid>https://dev.to/jrotenstein/easy-zeppelin-install-on-mac-to-use-aws-athena-1had</guid>
      <description>&lt;p&gt;Installing Apache Zeppelin on my Mac was pretty easy! I then connected it to Amazon Athena.&lt;/p&gt;

&lt;p&gt;I mostly used information from:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://medium.com/@yutaimai/using-amazon-athena-with-apache-zeppelin-464a85678c46"&gt;Using Amazon Athena with Apache Zeppelin | by Yuta Imai | Medium&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://zeppelin.apache.org/docs/0.6.0/install/install.html"&gt;Getting Started&lt;/a&gt; (The URL says version 0.6.0, might be a newer version now!)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Download &amp;amp; Install
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;I downloaded the &lt;code&gt;zeppelin-0.9.0-bin-all.tgz&lt;/code&gt; binary (current version at the time) from &lt;a href="http://zeppelin.apache.org/download.html"&gt;Apache Zeppelin Download&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Unzipped the file by simply double-clicking on it&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Start / Stop
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bin/zeppelin-daemon.sh start
bin/zeppelin-daemon.sh stop
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Access Zeppelin
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;http://localhost:8080&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Add an Interpreter for Amazon Athena
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Download driver from &lt;a href="https://docs.aws.amazon.com/athena/latest/ug/connect-with-jdbc.html"&gt;Links for Downloading the Athena JDBC Driver&lt;/a&gt; official page&lt;/li&gt;
&lt;li&gt;I then found that &lt;a href="https://medium.com/@yutaimai/using-amazon-athena-with-apache-zeppelin-464a85678c46"&gt;Using Amazon Athena with Apache Zeppelin | by Yuta Imai | Medium&lt;/a&gt; was the best resource for configuring the Interpreter&lt;/li&gt;
&lt;li&gt;However, &lt;strong&gt;the driver name has changed&lt;/strong&gt; to &lt;code&gt;com.simba.athena.jdbc.Driver&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Some information from &lt;a href="https://rud.is/b/2018/08/11/connecting-apache-zeppelin-up-to-amazon-athena-with-an-iam-profile-name/"&gt;Connecting Apache Zeppelin Up to Amazon Athena with an IAM Profile Name | rud.is&lt;/a&gt; was thus useful.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The fields I configured were:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;default.url: &lt;code&gt;jdbc:awsathena://athena.ap-southeast-2.amazonaws.com:443&lt;/code&gt; (Your region might be different)&lt;/li&gt;
&lt;li&gt;default.user (IAM Access Key)&lt;/li&gt;
&lt;li&gt;default.password (IAM Secret Key -- not very secure, but I couldn't figure out how to get it to use the AWS credentials file)&lt;/li&gt;
&lt;li&gt;default.driver: &lt;code&gt;com.simba.athena.jdbc.Driver&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;default.s3_staging_dir (Added this property myself, and pointed it to an Amazon S3 location to store the Output of Athena queries)&lt;/li&gt;
&lt;li&gt;Artifact: Provided the full path to the downloaded Athena JDBC driver&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Hint:&lt;/strong&gt; I had a problem referencing the Driver when the path included a space, so be careful where you put the driver file!&lt;/p&gt;

&lt;p&gt;The credentials used to access Amazon Athena are also used to access the source data in Amazon S3.&lt;/p&gt;

&lt;h3&gt;
  
  
  Query the data
&lt;/h3&gt;

&lt;p&gt;Simply use the name of the Interpreter at the top of the section, eg:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;%athena
SELECT 42
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Selecting a Schema
&lt;/h2&gt;

&lt;p&gt;To change the default schema, append the information onto the JDBC URL: &lt;code&gt;jdbc:awsathena://athena.ap-southeast-2.amazonaws.com:443;schema=my-schema&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Similar options are available in the &lt;a href="https://simba.wpengine.com/products/Athena/doc/JDBC_InstallGuide/content/jdbc/ath/using/connectionurl.htm"&gt;driver documentation&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>data</category>
      <category>mac</category>
      <category>athena</category>
      <category>aws</category>
    </item>
  </channel>
</rss>
