blob: 30d5e76831e8de13b1017a1bd9dec0fea94e8ba5 [file] [log] [blame]
<!DOCTYPE html>
<!--
| Generated by Apache Maven Doxia Site Renderer 1.8 from src/site/markdown/metron-stellar/stellar-zeppelin/index.md at 2019-05-14
| Rendered using Apache Maven Fluido Skin 1.7
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="Date-Revision-yyyymmdd" content="20190514" />
<meta http-equiv="Content-Language" content="en" />
<title>Metron &#x2013; Stellar Interpreter for Apache Zeppelin</title>
<link rel="stylesheet" href="../../css/apache-maven-fluido-1.7.min.css" />
<link rel="stylesheet" href="../../css/site.css" />
<link rel="stylesheet" href="../../css/print.css" media="print" />
<script type="text/javascript" src="../../js/apache-maven-fluido-1.7.min.js"></script>
<script type="text/javascript">
$( document ).ready( function() { $( '.carousel' ).carousel( { interval: 3500 } ) } );
</script>
</head>
<body class="topBarDisabled">
<div class="container-fluid">
<div id="banner">
<div class="pull-left"><a href="http://metron.apache.org/" id="bannerLeft"><img src="../../images/metron-logo.png" alt="Apache Metron" width="148px" height="48px"/></a></div>
<div class="pull-right"></div>
<div class="clear"><hr/></div>
</div>
<div id="breadcrumbs">
<ul class="breadcrumb">
<li class=""><a href="http://www.apache.org" class="externalLink" title="Apache">Apache</a><span class="divider">/</span></li>
<li class=""><a href="http://metron.apache.org/" class="externalLink" title="Metron">Metron</a><span class="divider">/</span></li>
<li class=""><a href="../../index.html" title="Documentation">Documentation</a><span class="divider">/</span></li>
<li class="active ">Stellar Interpreter for Apache Zeppelin</li>
<li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2019-05-14</li>
<li id="projectVersion" class="pull-right">Version: 0.7.1</li>
</ul>
</div>
<div class="row-fluid">
<div id="leftColumn" class="span2">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">User Documentation</li>
<li><a href="../../index.html" title="Metron"><span class="icon-chevron-down"></span>Metron</a>
<ul class="nav nav-list">
<li><a href="../../CONTRIBUTING.html" title="CONTRIBUTING"><span class="none"></span>CONTRIBUTING</a></li>
<li><a href="../../Upgrading.html" title="Upgrading"><span class="none"></span>Upgrading</a></li>
<li><a href="../../metron-analytics/index.html" title="Analytics"><span class="icon-chevron-right"></span>Analytics</a></li>
<li><a href="../../metron-contrib/metron-docker/index.html" title="Docker"><span class="none"></span>Docker</a></li>
<li><a href="../../metron-contrib/metron-performance/index.html" title="Performance"><span class="none"></span>Performance</a></li>
<li><a href="../../metron-deployment/index.html" title="Deployment"><span class="icon-chevron-right"></span>Deployment</a></li>
<li><a href="../../metron-interface/index.html" title="Interface"><span class="icon-chevron-right"></span>Interface</a></li>
<li><a href="../../metron-platform/index.html" title="Platform"><span class="icon-chevron-right"></span>Platform</a></li>
<li><a href="../../metron-sensors/index.html" title="Sensors"><span class="icon-chevron-right"></span>Sensors</a></li>
<li><a href="../../metron-stellar/stellar-3rd-party-example/index.html" title="Stellar-3rd-party-example"><span class="none"></span>Stellar-3rd-party-example</a></li>
<li><a href="../../metron-stellar/stellar-common/index.html" title="Stellar-common"><span class="icon-chevron-right"></span>Stellar-common</a></li>
<li class="active"><a href="#"><span class="none"></span>Stellar-zeppelin</a></li>
<li><a href="../../use-cases/index.html" title="Use-cases"><span class="icon-chevron-right"></span>Use-cases</a></li>
</ul>
</li>
</ul>
<hr />
<div id="poweredBy">
<div class="clear"></div>
<div class="clear"></div>
<div class="clear"></div>
<div class="clear"></div>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"><img class="builtBy" alt="Built by Maven" src="../../images/logos/maven-feather.png" /></a>
</div>
</div>
</div>
<div id="bodyColumn" class="span10" >
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<h1>Stellar Interpreter for Apache Zeppelin</h1>
<p><a class="externalLink" href="https://zeppelin.apache.org/">Apache Zeppelin</a> is a web-based notebook that enables data-driven, interactive data analytics and collaborative documents with SQL, Scala and more. This project provides a means to run the Stellar REPL directly within a Zeppelin Notebook.</p>
<ul>
<li><a href="#Prerequisites">Prerequisites</a></li>
<li><a href="#Installation">Installation</a></li>
<li><a href="#Usage">Usage</a></li>
</ul>
<div class="section">
<h2><a name="Prerequisites"></a>Prerequisites</h2>
<ul>
<li><a class="externalLink" href="https://zeppelin.apache.org/">Apache Zeppelin</a> 0.7.3
<p>This is tested with version 0.7.3. Other versions may work, but are not supported.</p></li>
</ul></div>
<div class="section">
<h2><a name="Installation"></a>Installation</h2>
<p>Currently, you need to manually install the Stellar Interpreter in Zeppelin. In the future this step could be automated by the Metron Mpack.</p>
<p>To install the Stellar Interpreter in your Apache Zeppelin installation, follow these instructions. This is paraphrased from the <a class="externalLink" href="https://zeppelin.apache.org/docs/latest/development/writingzeppelininterpreter.html#install-your-interpreter-binary">Zeppelin docs</a>.</p>
<ol style="list-style-type: decimal">
<li>
<p>Build and install Metron. Metron and its dependencies will be retrieved from your local Maven repository.</p>
<div>
<div>
<pre class="source">cd $METRON_HOME
mvn clean install -DskipTests
</pre></div></div>
</li>
<li>
<p>If you do not already have Zeppelin installed, <a class="externalLink" href="https://zeppelin.apache.org/download.html">download and unpack Apache Zeppelin</a>. Then change directories to the root of your Zeppelin download.</p>
<div>
<div>
<pre class="source">cd $ZEPPELIN_HOME
</pre></div></div>
</li>
<li>
<p>Use Zeppelin&#x2019;s installation utility to install the Stellar Interpreter.</p>
<p>If Zeppelin was already installed, make sure that it is stopped before running this command. Update the version, &#x2018;0.7.1&#x2019; in the example below, to whatever is appropriate for your environment.</p>
<div>
<div>
<pre class="source">bin/install-interpreter.sh --name stellar --artifact org.apache.metron:stellar-zeppelin:0.7.1
</pre></div></div>
<p><b>Note:</b> The above command will download maven artifact groupId1:artifact1:version1 (org.apache.metron:stellar-zeppelin:0.7.1) and all of its transitive dependencies into the $ZEPPELIN_HOME/interpreter/stellar directory. <tt>stellar-common</tt>, which contains many of the <a href="../stellar-common/index.html#Stellar_Core_Functions">Stellar Core Functions</a>, will be included transitively because <tt>stellar-zeppelin</tt> declares it as a direct dependency in its Maven pom.xml.</p>
<ul>
<li><a class="externalLink" href="https://zeppelin.apache.org/docs/0.7.3/manual/interpreterinstallation.html#3rd-party-interpreters">3rd Party Zeppelin Interpreter Installation Documentation</a></li>
</ul>
</li>
<li>
<p>Start Zeppelin.</p>
<div>
<div>
<pre class="source">bin/zeppelin-daemon.sh start
</pre></div></div>
</li>
<li>
<p>Navigate to Zeppelin running at <a class="externalLink" href="http://localhost:8080/">http://localhost:8080/</a>. The Stellar Interpreter should be ready for use with a basic set of functions.</p>
</li>
</ol></div>
<div class="section">
<h2><a name="Usage"></a>Usage</h2>
<ol style="list-style-type: decimal">
<li>
<p>Create a new notebook.</p>
<ol style="list-style-type: decimal">
<li>
<p>Click on &#x201c;Notebook&#x201d; &gt; &#x201c;Create new note&#x201d;.</p>
</li>
<li>
<p>Set the default Interpreter to <tt>stellar</tt>.</p>
<p>When creating the notebook, if you define <tt>stellar</tt> as the default interpreter, then there is no need to enter <tt>%stellar</tt> at the top of each code block.</p>
<p>If <tt>stellar</tt> is not the default interpreter, then you must enter <tt>%stellar</tt> at the top of a code block containing Stellar code.</p>
</li>
</ol>
</li>
<li>
<p>In the first block, add the following Stellar, then click Run.</p>
<div>
<div>
<pre class="source">2 in [2,3,4]
</pre></div></div>
</li>
<li>
<p>In the next block, check which functions are available to you.</p>
<p>When executing Stellar&#x2019;s magic functions, you must explicitly define which interpreter should be used in the code block. If you define &#x2018;stellar&#x2019; as the default interpreter when creating a notebook, then this is only required when using Stellar&#x2019;s magic functions.</p>
<div>
<div>
<pre class="source">%stellar
%functions
</pre></div></div>
<p>You will <b>only</b> &#x2018;see&#x2019; the functions defined within <tt>stellar-common</tt> since that is the only library that we added to the interpreter.</p>
</li>
<li>
<p>Add additional Stellar functions to your session.</p>
<ol style="list-style-type: decimal">
<li>
<p>Go back to the Stellar interpreter configuration and add another dependency as follows.</p>
<div>
<div>
<pre class="source">org.apache.metron:metron-statistics:0.7.1
</pre></div></div>
</li>
<li>
<p>Go back to your notebook and run <tt>%functions</tt> again. You will now see the additional functions defined within the <tt>metron-statistics</tt> project.</p>
</li>
</ol>
</li>
<li>
<p>Auto-completion is also available for Stellar expressions.</p>
<p>In another block, type &#x2018;TO_&#x2019; then press the <kbd>CTRL</kbd> + <kbd>PERIOD</kbd> keys. This will trigger the auto-complete mechanism in Stellar and display a list of matching functions or variables.</p>
</li>
</ol></div>
</div>
</div>
</div>
<hr/>
<footer>
<div class="container-fluid">
<div class="row-fluid">
© 2015-2016 The Apache Software Foundation. Apache Metron, Metron, Apache, the Apache feather logo,
and the Apache Metron project logo are trademarks of The Apache Software Foundation.
</div>
</div>
</footer>
</body>
</html>