You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by mo...@apache.org on 2015/11/19 07:38:19 UTC
svn commit: r1715104 [16/28] - in /incubator/zeppelin/site: ./
assets/themes/twitter/ assets/themes/zeppelin/css/
assets/themes/zeppelin/img/docs-img/ docs/ docs/0.5.0-incubating/
docs/0.5.0-incubating/assets/ docs/0.5.0-incubating/assets/themes/ docs/...
Added: incubator/zeppelin/site/docs/0.5.5-incubating/interpreter/cassandra.html
URL: http://svn.apache.org/viewvc/incubator/zeppelin/site/docs/0.5.5-incubating/interpreter/cassandra.html?rev=1715104&view=auto
==============================================================================
--- incubator/zeppelin/site/docs/0.5.5-incubating/interpreter/cassandra.html (added)
+++ incubator/zeppelin/site/docs/0.5.5-incubating/interpreter/cassandra.html Thu Nov 19 06:38:15 2015
@@ -0,0 +1,1136 @@
+
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Cassandra Interpreter</title>
+ <meta name="description" content="Cassandra Interpreter">
+ <meta name="author" content="The Apache Software Foundation">
+
+ <!-- Enable responsive viewport -->
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+ <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
+ <!--[if lt IE 9]>
+ <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+
+ <!-- Le styles -->
+ <link href="/assets/themes/zeppelin/bootstrap/css/bootstrap.css" rel="stylesheet">
+ <link href="/assets/themes/zeppelin/css/style.css?body=1" rel="stylesheet" type="text/css">
+ <link href="/assets/themes/zeppelin/css/syntax.css" rel="stylesheet" type="text/css" media="screen" />
+ <!-- Le fav and touch icons -->
+ <!-- Update these with your own images
+ <link rel="shortcut icon" href="images/favicon.ico">
+ <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
+ <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
+ <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
+ -->
+
+ <!-- Js -->
+ <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
+ <script src="/assets/themes/zeppelin/bootstrap/js/bootstrap.min.js"></script>
+
+ <!-- atom & rss feed -->
+ <link href="/atom.xml" type="application/atom+xml" rel="alternate" title="Sitewide ATOM Feed">
+ <link href="/rss.xml" type="application/rss+xml" rel="alternate" title="Sitewide RSS Feed">
+ </head>
+
+ <body>
+
+ <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
+ <div class="container">
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
+ <span class="sr-only">Toggle navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="navbar-brand" href="/">
+ <img src="/assets/themes/zeppelin/img/zeppelin_logo.png" width="50" alt="I'm zeppelin">
+ Zeppelin <small>(0.5.5-incubating)</small>
+ </a>
+ </div>
+ <nav class="navbar-collapse collapse" role="navigation">
+ <ul class="nav navbar-nav">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ </ul>
+ <ul class="nav navbar-nav navbar-right">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li><a href="/docs.html">Docs</a></li>
+
+
+
+
+
+
+
+ <li><a href="/index.html">Overview</a></li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ </ul>
+ </nav><!--/.navbar-collapse -->
+ </div>
+ </div>
+
+
+ <div class="container">
+
+<!--<div class="hero-unit Cassandra Interpreter">
+ <h1></h1>
+</div>
+-->
+
+<div class="row">
+ <div class="col-md-12">
+ <hr/>
+
+<h2>1. Cassandra CQL Interpreter for Apache Zeppelin</h2>
+
+<p><br/>
+<table class="table-configuration">
+ <tr>
+ <th>Name</th>
+ <th>Class</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>%cassandra</td>
+ <td>CassandraInterpreter</td>
+ <td>Provides interpreter for Apache Cassandra CQL query language</td>
+ </tr>
+</table></p>
+
+<hr/>
+
+<h2>2. Enabling Cassandra Interpreter</h2>
+
+<p>In a notebook, to enable the <strong>Cassandra</strong> interpreter, click on the <strong>Gear</strong> icon and select <strong>Cassandra</strong></p>
+
+<p><center>
+ <img src="/assets/themes/zeppelin/img/docs-img/cassandra-InterpreterBinding.png" alt="Interpreter Binding"></p>
+
+<p><img src="/assets/themes/zeppelin/img/docs-img/cassandra-InterpreterSelection.png" alt="Interpreter Selection">
+ </center></p>
+
+<hr/>
+
+<h2>3. Using the Cassandra Interpreter</h2>
+
+<p>In a paragraph, use <strong><em>%cassandra</em></strong> to select the <strong>Cassandra</strong> interpreter and then input all commands.</p>
+
+<p>To access the interactive help, type <strong>HELP;</strong></p>
+
+<p><center>
+ <img src="/assets/themes/zeppelin/img/docs-img/cassandra-InteractiveHelp.png" alt="Interactive Help">
+ </center></p>
+
+<hr/>
+
+<h2>4. Interpreter Commands</h2>
+
+<p>The <strong>Cassandra</strong> interpreter accepts the following commands</p>
+
+<p><center>
+ <table class="table-configuration">
+ <tr>
+ <th>Command Type</th>
+ <th>Command Name</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td nowrap>Help command</td>
+ <td>HELP</td>
+ <td>Display the interactive help menu</td>
+ </tr>
+ <tr>
+ <td nowrap>Schema commands</td>
+ <td>DESCRIBE KEYSPACE, DESCRIBE CLUSTER, DESCRIBE TABLES ...</td>
+ <td>Custom commands to describe the Cassandra schema</td>
+ </tr>
+ <tr>
+ <td nowrap>Option commands</td>
+ <td>@consistency, @retryPolicy, @fetchSize ...</td>
+ <td>Inject runtime options to all statements in the paragraph</td>
+ </tr>
+ <tr>
+ <td nowrap>Prepared statement commands</td>
+ <td>@prepare, @bind, @remove_prepared</td>
+ <td>Let you register a prepared command and re-use it later by injecting bound values</td>
+ </tr>
+ <tr>
+ <td nowrap>Native CQL statements</td>
+ <td>All CQL-compatible statements (SELECT, INSERT, CREATE ...)</td>
+ <td>All CQL statements are executed directly against the Cassandra server</td>
+ </tr>
+ </table><br>
+</center></p>
+
+<hr/>
+
+<h2>5. CQL statements</h2>
+
+<p>This interpreter is compatible with any CQL statement supported by Cassandra. Ex: </p>
+<div class="highlight"><pre><code class="sql language-sql" data-lang="sql"> <span class="k">INSERT</span> <span class="k">INTO</span> <span class="n">users</span><span class="p">(</span><span class="n">login</span><span class="p">,</span><span class="n">name</span><span class="p">)</span> <span class="k">VALUES</span><span class="p">(</span><span class="s1">'jdoe'</span><span class="p">,</span><span class="s1">'John DOE'</span><span class="p">);</span>
+ <span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">users</span> <span class="k">WHERE</span> <span class="n">login</span><span class="o">=</span><span class="s1">'jdoe'</span><span class="p">;</span>
+</code></pre></div>
+<p>Each statement should be separated by a semi-colon ( <strong>;</strong> ) except the special commands below:</p>
+
+<ol>
+<li>@prepare</li>
+<li>@bind</li>
+<li>@remove_prepare</li>
+<li>@consistency</li>
+<li>@serialConsistency</li>
+<li>@timestamp</li>
+<li>@retryPolicy</li>
+<li>@fetchSize</li>
+</ol>
+
+<p>Multi-line statements as well as multiple statements on the same line are also supported as long as they are
+separated by a semi-colon. Ex: </p>
+<div class="highlight"><pre><code class="sql language-sql" data-lang="sql"> <span class="n">USE</span> <span class="n">spark_demo</span><span class="p">;</span>
+
+ <span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">albums_by_country</span> <span class="k">LIMIT</span> <span class="mi">1</span><span class="p">;</span> <span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">countries</span> <span class="k">LIMIT</span> <span class="mi">1</span><span class="p">;</span>
+
+ <span class="k">SELECT</span> <span class="o">*</span>
+ <span class="k">FROM</span> <span class="n">artists</span>
+ <span class="k">WHERE</span> <span class="n">login</span><span class="o">=</span><span class="s1">'jlennon'</span><span class="p">;</span>
+</code></pre></div>
+<p>Batch statements are supported and can span multiple lines, as well as DDL(CREATE/ALTER/DROP) statements: </p>
+<div class="highlight"><pre><code class="sql language-sql" data-lang="sql"> <span class="k">BEGIN</span> <span class="n">BATCH</span>
+ <span class="k">INSERT</span> <span class="k">INTO</span> <span class="n">users</span><span class="p">(</span><span class="n">login</span><span class="p">,</span><span class="n">name</span><span class="p">)</span> <span class="k">VALUES</span><span class="p">(</span><span class="s1">'jdoe'</span><span class="p">,</span><span class="s1">'John DOE'</span><span class="p">);</span>
+ <span class="k">INSERT</span> <span class="k">INTO</span> <span class="n">users_preferences</span><span class="p">(</span><span class="n">login</span><span class="p">,</span><span class="n">account_type</span><span class="p">)</span> <span class="k">VALUES</span><span class="p">(</span><span class="s1">'jdoe'</span><span class="p">,</span><span class="s1">'BASIC'</span><span class="p">);</span>
+ <span class="n">APPLY</span> <span class="n">BATCH</span><span class="p">;</span>
+
+ <span class="k">CREATE</span> <span class="k">TABLE</span> <span class="n">IF</span> <span class="k">NOT</span> <span class="k">EXISTS</span> <span class="n">test</span><span class="p">(</span>
+ <span class="k">key</span> <span class="nb">int</span> <span class="k">PRIMARY</span> <span class="k">KEY</span><span class="p">,</span>
+ <span class="n">value</span> <span class="nb">text</span>
+ <span class="p">);</span>
+</code></pre></div>
+<p>CQL statements are <strong>case-insensitive</strong> (except for column names and values).
+This means that the following statements are equivalent and valid: </p>
+<div class="highlight"><pre><code class="sql language-sql" data-lang="sql"> <span class="k">INSERT</span> <span class="k">INTO</span> <span class="n">users</span><span class="p">(</span><span class="n">login</span><span class="p">,</span><span class="n">name</span><span class="p">)</span> <span class="k">VALUES</span><span class="p">(</span><span class="s1">'jdoe'</span><span class="p">,</span><span class="s1">'John DOE'</span><span class="p">);</span>
+ <span class="k">Insert</span> <span class="k">into</span> <span class="n">users</span><span class="p">(</span><span class="n">login</span><span class="p">,</span><span class="n">name</span><span class="p">)</span> <span class="k">vAlues</span><span class="p">(</span><span class="s1">'hsue'</span><span class="p">,</span><span class="s1">'Helen SUE'</span><span class="p">);</span>
+</code></pre></div>
+<p>The complete list of all CQL statements and versions can be found below:
+<center><br>
+ <table class="table-configuration">
+ <tr>
+ <th>Cassandra Version</th>
+ <th>Documentation Link</th>
+ </tr>
+ <tr>
+ <td><strong>2.2</strong></td>
+ <td>
+ <a target="_blank"
+ href="http://docs.datastax.com/en/cql/3.3/cql/cqlIntro.html">
+ http://docs.datastax.com/en/cql/3.3/cql/cqlIntro.html
+ </a>
+ </td>
+ </tr><br>
+ <tr>
+ <td><strong>2.1 & 2.0</strong></td>
+ <td>
+ <a target="_blank"
+ href="http://docs.datastax.com/en/cql/3.1/cql/cql_intro_c.html">
+ http://docs.datastax.com/en/cql/3.1/cql/cql<em>intro</em>c.html
+ </a>
+ </td>
+ </tr><br>
+ <tr>
+ <td><strong>1.2</strong></td>
+ <td>
+ <a target="_blank"
+ href="http://docs.datastax.com/en/cql/3.0/cql/aboutCQL.html">
+ http://docs.datastax.com/en/cql/3.0/cql/aboutCQL.html
+ </a>
+ </td>
+ </tr><br>
+ </table>
+</center></p>
+
+<hr/>
+
+<h2>6. Comments in statements</h2>
+
+<p>It is possible to add comments between statements. Single line comments start with the hash sign (#). Multi-line comments are enclosed between /** and **/. Ex: </p>
+<div class="highlight"><pre><code class="sql language-sql" data-lang="sql"> <span class="o">#</span><span class="k">First</span> <span class="k">comment</span>
+ <span class="k">INSERT</span> <span class="k">INTO</span> <span class="n">users</span><span class="p">(</span><span class="n">login</span><span class="p">,</span><span class="n">name</span><span class="p">)</span> <span class="k">VALUES</span><span class="p">(</span><span class="s1">'jdoe'</span><span class="p">,</span><span class="s1">'John DOE'</span><span class="p">);</span>
+
+ <span class="cm">/**</span>
+<span class="cm"> Multi line</span>
+<span class="cm"> comments</span>
+<span class="cm"> **/</span>
+ <span class="k">Insert</span> <span class="k">into</span> <span class="n">users</span><span class="p">(</span><span class="n">login</span><span class="p">,</span><span class="n">name</span><span class="p">)</span> <span class="k">vAlues</span><span class="p">(</span><span class="s1">'hsue'</span><span class="p">,</span><span class="s1">'Helen SUE'</span><span class="p">);</span>
+</code></pre></div>
+<hr/>
+
+<h2>7. Syntax Validation</h2>
+
+<p>The interpreters is shipped with a built-in syntax validator. This validator only checks for basic syntax errors.
+All CQL-related syntax validation is delegated directly to <strong>Cassandra</strong> </p>
+
+<p>Most of the time, syntax errors are due to <strong>missing semi-colons</strong> between statements or <strong>typo errors</strong>.</p>
+
+<hr/>
+
+<h2>8. Schema commands</h2>
+
+<p>To make schema discovery easier and more interactive, the following commands are supported:
+<center><br>
+ <table class="table-configuration">
+ <tr>
+ <th>Command</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td><strong>DESCRIBE CLUSTER;</strong></td>
+ <td>Show the current cluster name and its partitioner</td>
+ </tr><br>
+ <tr>
+ <td><strong>DESCRIBE KEYSPACES;</strong></td>
+ <td>List all existing keyspaces in the cluster and their configuration (replication factor, durable write ...)</td>
+ </tr><br>
+ <tr>
+ <td><strong>DESCRIBE TABLES;</strong></td>
+ <td>List all existing keyspaces in the cluster and for each, all the tables name</td>
+ </tr><br>
+ <tr>
+ <td><strong>DESCRIBE TYPES;</strong></td>
+ <td>List all existing user defined types in the <strong>current (logged) keyspace</strong></td>
+ </tr><br>
+ <tr>
+ <td nowrap><strong>DESCRIBE FUNCTIONS <keyspace<em>name>;</strong></td>
+ <td>List all existing user defined functions in the given keyspace</td>
+ </tr><br>
+ <tr>
+ <td nowrap><strong>DESCRIBE AGGREGATES <keyspace</em>name>;</strong></td>
+ <td>List all existing user defined aggregates in the given keyspace</td>
+ </tr><br>
+ <tr>
+ <td nowrap><strong>DESCRIBE KEYSPACE <keyspace<em>name>;</strong></td>
+ <td>Describe the given keyspace configuration and all its table details (name, columns, ...)</td>
+ </tr><br>
+ <tr>
+ <td nowrap><strong>DESCRIBE TABLE (<keyspace</em>name>).<table<em>name>;</strong></td>
+ <td>
+ Describe the given table. If the keyspace is not provided, the current logged in keyspace is used.
+ If there is no logged in keyspace, the default system keyspace is used.
+ If no table is found, an error message is raised
+ </td>
+ </tr><br>
+ <tr>
+ <td nowrap><strong>DESCRIBE TYPE (<keyspace</em>name>).<type<em>name>;</strong></td>
+ <td>
+ Describe the given type(UDT). If the keyspace is not provided, the current logged in keyspace is used.
+ If there is no logged in keyspace, the default system keyspace is used.
+ If no type is found, an error message is raised
+ </td>
+ </tr><br>
+ <tr>
+ <td nowrap><strong>DESCRIBE FUNCTION (<keyspace</em>name>).<function<em>name>;</strong></td>
+ <td>Describe the given user defined function. The keyspace is optional</td>
+ </tr><br>
+ <tr>
+ <td nowrap><strong>DESCRIBE AGGREGATE (<keyspace</em>name>).<aggregate_name>;</strong></td>
+ <td>Describe the given user defined aggregate. The keyspace is optional</td>
+ </tr><br>
+ </table>
+</center> </p>
+
+<p>The schema objects (cluster, keyspace, table, type, function and aggregate) are displayed in a tabular format.
+There is a drop-down menu on the top left corner to expand objects details. On the top right menu is shown the Icon legend.</p>
+
+<p><br/>
+<center>
+ <img src="/assets/themes/zeppelin/img/docs-img/cassandra-DescribeSchema.png" alt="Describe Schema">
+</center></p>
+
+<hr/>
+
+<h2>9. Runtime Parameters</h2>
+
+<p>Sometimes you want to be able to pass runtime query parameters to your statements.
+Those parameters are not part of the CQL specs and are specific to the interpreter.
+Below is the list of all parameters: </p>
+
+<p><br/>
+<center><br>
+ <table class="table-configuration">
+ <tr>
+ <th>Parameter</th>
+ <th>Syntax</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td nowrap>Consistency Level</td>
+ <td><strong>@consistency=<em>value</em></strong></td>
+ <td>Apply the given consistency level to all queries in the paragraph</td>
+ </tr>
+ <tr>
+ <td nowrap>Serial Consistency Level</td>
+ <td><strong>@serialConsistency=<em>value</em></strong></td>
+ <td>Apply the given serial consistency level to all queries in the paragraph</td>
+ </tr>
+ <tr>
+ <td nowrap>Timestamp</td>
+ <td><strong>@timestamp=<em>long value</em></strong></td>
+ <td>
+ Apply the given timestamp to all queries in the paragraph.
+ Please note that timestamp value passed directly in CQL statement will override this value
+ </td>
+ </tr>
+ <tr>
+ <td nowrap>Retry Policy</td>
+ <td><strong>@retryPolicy=<em>value</em></strong></td>
+ <td>Apply the given retry policy to all queries in the paragraph</td>
+ </tr>
+ <tr>
+ <td nowrap>Fetch Size</td>
+ <td><strong>@fetchSize=<em>integer value</em></strong></td>
+ <td>Apply the given fetch size to all queries in the paragraph</td>
+ </tr>
+ </table>
+</center></p>
+
+<p>Some parameters only accept restricted values: </p>
+
+<p><br/>
+<center><br>
+ <table class="table-configuration">
+ <tr>
+ <th>Parameter</th>
+ <th>Possible Values</th>
+ </tr>
+ <tr>
+ <td nowrap>Consistency Level</td>
+ <td><strong>ALL, ANY, ONE, TWO, THREE, QUORUM, LOCAL<em>ONE, LOCAL</em>QUORUM, EACH<em>QUORUM</strong></td>
+ </tr>
+ <tr>
+ <td nowrap>Serial Consistency Level</td>
+ <td><strong>SERIAL, LOCAL</em>SERIAL</strong></td>
+ </tr>
+ <tr>
+ <td nowrap>Timestamp</td>
+ <td>Any long value</td>
+ </tr>
+ <tr>
+ <td nowrap>Retry Policy</td>
+ <td><strong>DEFAULT, DOWNGRADING<em>CONSISTENCY, FALLTHROUGH, LOGGING</em>DEFAULT, LOGGING<em>DOWNGRADING, LOGGING</em>FALLTHROUGH</strong></td>
+ </tr>
+ <tr>
+ <td nowrap>Fetch Size</td>
+ <td>Any integer value</td>
+ </tr>
+ </table>
+</center> </p>
+
+<blockquote>
+<p>Please note that you should <strong>not</strong> add semi-colon ( <strong>;</strong> ) at the end of each parameter statement</p>
+</blockquote>
+
+<p>Some examples: </p>
+<div class="highlight"><pre><code class="sql language-sql" data-lang="sql"> <span class="k">CREATE</span> <span class="k">TABLE</span> <span class="n">IF</span> <span class="k">NOT</span> <span class="k">EXISTS</span> <span class="n">spark_demo</span><span class="p">.</span><span class="n">ts</span><span class="p">(</span>
+ <span class="k">key</span> <span class="nb">int</span> <span class="k">PRIMARY</span> <span class="k">KEY</span><span class="p">,</span>
+ <span class="n">value</span> <span class="nb">text</span>
+ <span class="p">);</span>
+ <span class="k">TRUNCATE</span> <span class="n">spark_demo</span><span class="p">.</span><span class="n">ts</span><span class="p">;</span>
+
+ <span class="o">#</span> <span class="k">Timestamp</span> <span class="k">in</span> <span class="n">the</span> <span class="n">past</span>
+ <span class="o">@</span><span class="k">timestamp</span><span class="o">=</span><span class="mi">10</span>
+
+ <span class="o">#</span> <span class="k">Force</span> <span class="k">timestamp</span> <span class="n">directly</span> <span class="k">in</span> <span class="n">the</span> <span class="k">first</span> <span class="k">insert</span>
+ <span class="k">INSERT</span> <span class="k">INTO</span> <span class="n">spark_demo</span><span class="p">.</span><span class="n">ts</span><span class="p">(</span><span class="k">key</span><span class="p">,</span><span class="n">value</span><span class="p">)</span> <span class="k">VALUES</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="s1">'first insert'</span><span class="p">)</span> <span class="k">USING</span> <span class="k">TIMESTAMP</span> <span class="mi">100</span><span class="p">;</span>
+
+ <span class="o">#</span> <span class="k">Select</span> <span class="k">some</span> <span class="k">data</span> <span class="k">to</span> <span class="n">make</span> <span class="n">the</span> <span class="n">clock</span> <span class="n">turn</span>
+ <span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="n">spark_demo</span><span class="p">.</span><span class="n">albums</span> <span class="k">LIMIT</span> <span class="mi">100</span><span class="p">;</span>
+
+ <span class="o">#</span> <span class="n">Now</span> <span class="k">insert</span> <span class="k">using</span> <span class="n">the</span> <span class="k">timestamp</span> <span class="k">parameter</span> <span class="k">set</span> <span class="k">at</span> <span class="n">the</span> <span class="n">beginning</span><span class="p">(</span><span class="mi">10</span><span class="p">)</span>
+ <span class="k">INSERT</span> <span class="k">INTO</span> <span class="n">spark_demo</span><span class="p">.</span><span class="n">ts</span><span class="p">(</span><span class="k">key</span><span class="p">,</span><span class="n">value</span><span class="p">)</span> <span class="k">VALUES</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="s1">'second insert'</span><span class="p">);</span>
+
+ <span class="o">#</span> <span class="k">Check</span> <span class="k">for</span> <span class="n">the</span> <span class="k">result</span><span class="p">.</span> <span class="n">You</span> <span class="n">should</span> <span class="n">see</span> <span class="s1">'first insert'</span>
+ <span class="k">SELECT</span> <span class="n">value</span> <span class="k">FROM</span> <span class="n">spark_demo</span><span class="p">.</span><span class="n">ts</span> <span class="k">WHERE</span> <span class="k">key</span><span class="o">=</span><span class="mi">1</span><span class="p">;</span>
+</code></pre></div>
+<p>Some remarks about query parameters:</p>
+
+<blockquote>
+<ol>
+<li><strong>many</strong> query parameters can be set in the same paragraph</li>
+<li>if the <strong>same</strong> query parameter is set many time with different values, the interpreter only take into account the first value</li>
+<li>each query parameter applies to <strong>all CQL statements</strong> in the same paragraph, unless you override the option using plain CQL text (like forcing timestamp with the USING clause)</li>
+<li>the order of each query parameter with regard to CQL statement does not matter</li>
+</ol>
+</blockquote>
+
+<hr/>
+
+<h2>10. Support for Prepared Statements</h2>
+
+<p>For performance reason, it is better to prepare statements before-hand and reuse them later by providing bound values.
+This interpreter provides 3 commands to handle prepared and bound statements: </p>
+
+<ol>
+<li><strong>@prepare</strong></li>
+<li><strong>@bind</strong></li>
+<li><strong>@remove_prepared</strong></li>
+</ol>
+
+<p>Example: </p>
+<div class="highlight"><pre><code class="text language-text" data-lang="text"> @prepare[statement_name]=...
+
+ @bind[statement_name]=âtextâ, 1223, â2015-07-30 12:00:01â, null, true, [âlist_item1â, âlist_item2â]
+
+ @bind[statement_name_with_no_bound_value]
+
+ @remove_prepare[statement_name]
+</code></pre></div>
+<p><br/></p>
+
+<h4>a. @prepare</h4>
+
+<p><br/>
+You can use the syntax <em>"@prepare[statement</em>name]=SELECT ..."_ to create a prepared statement.
+The <em>statement</em>name_ is <strong>mandatory</strong> because the interpreter prepares the given statement with the Java driver and
+saves the generated prepared statement in an <strong>internal hash map</strong>, using the provided <em>statement</em>name_ as search key.</p>
+
+<blockquote>
+<p>Please note that this internal prepared statement map is shared with <strong>all notebooks</strong> and <strong>all paragraphs</strong> because
+there is only one instance of the interpreter for Cassandra</p>
+
+<p>If the interpreter encounters <strong>many</strong> @prepare for the <strong>same <em>statement</em>name_ (key)</strong>, only the <strong>first</strong> statement will be taken into account.</p>
+</blockquote>
+
+<p>Example: </p>
+<div class="highlight"><pre><code class="text language-text" data-lang="text"> @prepare[select]=SELECT * FROM spark_demo.albums LIMIT ?
+
+ @prepare[select]=SELECT * FROM spark_demo.artists LIMIT ?
+</code></pre></div>
+<p>For the above example, the prepared statement is <em>SELECT * FROM spark</em>demo.albums LIMIT ?<em>.
+_SELECT * FROM spark</em>demo.artists LIMIT ?_ is ignored because an entry already exists in the prepared statements map with the key select. </p>
+
+<p>In the context of <strong>Zeppelin</strong>, a notebook can be scheduled to be executed at regular interval,
+thus it is necessary to <strong>avoid re-preparing many time the same statement (considered an anti-pattern)</strong>.
+<br/>
+<br/></p>
+
+<h4>b. @bind</h4>
+
+<p><br/>
+Once the statement is prepared (possibly in a separated notebook/paragraph). You can bind values to it: </p>
+<div class="highlight"><pre><code class="text language-text" data-lang="text"> @bind[select_first]=10
+</code></pre></div>
+<p>Bound values are not mandatory for the <strong>@bind</strong> statement. However if you provide bound values, they need to comply to some syntax:</p>
+
+<ul>
+<li>String values should be enclosed between simple quotes ( â )</li>
+<li>Date values should be enclosed between simple quotes ( â ) and respect the formats:
+
+<ol>
+<li>yyyy-MM-dd HH:MM:ss</li>
+<li>yyyy-MM-dd HH:MM:ss.SSS</li>
+</ol></li>
+<li><strong>null</strong> is parsed as-is</li>
+<li><strong>boolean</strong> (true|false) are parsed as-is</li>
+<li>collection values must follow the <strong><a href="http://docs.datastax.com/en/cql/3.1/cql/cql_using/use_collections_c.html">standard CQL syntax</a></strong>:
+
+<ul>
+<li>list: [âlist<em>item1â, âlist</em>item2â, ...]</li>
+<li>set: {âset<em>item1â, âset</em>item2â, â¦}</li>
+<li>map: {âkey1â: âval1â, âkey2â: âval2â, â¦}</li>
+</ul></li>
+<li><strong>tuple</strong> values should be enclosed between parenthesis (see <strong><a href="http://docs.datastax.com/en/cql/3.1/cql/cql_reference/tupleType.html">Tuple CQL syntax</a></strong>): (âtextâ, 123, true)</li>
+<li><strong>udt</strong> values should be enclosed between brackets (see <strong><a href="http://docs.datastax.com/en/cql/3.1/cql/cql_using/cqlUseUDT.html">UDT CQL syntax</a></strong>): {stree<em>name: âBeverly Hillsâ, number: 104, zip</em>code: 90020, state: âCaliforniaâ, â¦}</li>
+</ul>
+
+<blockquote>
+<p>It is possible to use the @bind statement inside a batch:</p>
+<div class="highlight"><pre><code class="sql language-sql" data-lang="sql"> <span class="k">BEGIN</span> <span class="n">BATCH</span>
+ <span class="o">@</span><span class="n">bind</span><span class="p">[</span><span class="n">insert_user</span><span class="p">]</span><span class="o">=</span><span class="s1">'jdoe'</span><span class="p">,</span><span class="s1">'John DOE'</span>
+ <span class="k">UPDATE</span> <span class="n">users</span> <span class="k">SET</span> <span class="n">age</span> <span class="o">=</span> <span class="mi">27</span> <span class="k">WHERE</span> <span class="n">login</span><span class="o">=</span><span class="s1">'hsue'</span><span class="p">;</span>
+ <span class="n">APPLY</span> <span class="n">BATCH</span><span class="p">;</span>
+</code></pre></div></blockquote>
+
+<p><br/></p>
+
+<h4>c. @remove_prepare</h4>
+
+<p><br/>
+To avoid for a prepared statement to stay forever in the prepared statement map, you can use the
+<strong>@remove<em>prepare[statement</em>name]</strong> syntax to remove it.
+Removing a non-existing prepared statement yields no error.</p>
+
+<hr/>
+
+<h2>11. Using Dynamic Forms</h2>
+
+<p>Instead of hard-coding your CQL queries, it is possible to use the mustache syntax ( <strong>{{ }}</strong> ) to inject simple value or multiple choices forms. </p>
+
+<p>The syntax for simple parameter is: <strong>{{input_Label=default value}}</strong>. The default value is mandatory because the first time the paragraph is executed,
+we launch the CQL query before rendering the form so at least one value should be provided. </p>
+
+<p>The syntax for multiple choices parameter is: <strong>{{input_Label=value1 | value2 | ⦠| valueN }}</strong>. By default the first choice is used for CQL query
+the first time the paragraph is executed. </p>
+
+<p>Example: </p>
+<div class="highlight"><pre><code class="text language-text" data-lang="text">#Secondary index on performer style
+SELECT name, country, performer
+FROM spark_demo.performers
+WHERE name='{{performer=Sheryl Crow|Doof|Fanfarlo|Los Paranoia}}'
+AND styles CONTAINS '{{style=Rock}}';
+</code></pre></div>
+<p>In the above example, the first CQL query will be executed for <em>performer='Sheryl Crow' AND style='Rock'</em>.
+For subsequent queries, you can change the value directly using the form. </p>
+
+<blockquote>
+<p>Please note that we enclosed the <strong>{{ }}</strong> block between simple quotes ( <strong>'</strong> ) because Cassandra expects a String here.
+We could have also use the <strong>{{style='Rock'}}</strong> syntax but this time, the value displayed on the form is <strong><em>'Rock'</em></strong> and not <strong><em>Rock</em></strong>. </p>
+</blockquote>
+
+<p>It is also possible to use dynamic forms for <strong>prepared statements</strong>: </p>
+<div class="highlight"><pre><code class="text language-text" data-lang="text">@bind[select]=='{{performer=Sheryl Crow|Doof|Fanfarlo|Los Paranoia}}', '{{style=Rock}}'
+</code></pre></div>
+<hr/>
+
+<h2>12. Execution parallelism and shared states</h2>
+
+<p>It is possible to execute many paragraphs in parallel. However, at the back-end side, weâre still using synchronous queries.
+<em>Asynchronous execution</em> is only possible when it is possible to return a <code>Future</code> value in the <code>InterpreterResult</code>.
+It may be an interesting proposal for the <strong>Zeppelin</strong> project.</p>
+
+<p>Another caveat is that the same <code>com.datastax.driver.core.Session</code> object is used for <strong>all</strong> notebooks and paragraphs.
+Consequently, if you use the <strong>USE <em>keyspace name</em>;</strong> statement to log into a keyspace, it will change the keyspace for
+<strong>all current users</strong> of the <strong>Cassandra</strong> interpreter because we only create 1 <code>com.datastax.driver.core.Session</code> object
+per instance of <strong>Cassandra</strong> interpreter.</p>
+
+<p>The same remark does apply to the <strong>prepared statement hash map</strong>, it is shared by <strong>all users</strong> using the same instance of <strong>Cassandra</strong> interpreter.</p>
+
+<p>Until <strong>Zeppelin</strong> offers a real multi-users separation, there is a work-around to segregate user environment and states:
+<em>create different <strong>Cassandra</strong> interpreter instances</em></p>
+
+<p>For this, first go to the <strong>Interpreter</strong> menu and click on the <strong>Create</strong> button
+<br/>
+<br/>
+<center>
+ <img src="/assets/themes/zeppelin/img/docs-img/cassandra-NewInterpreterInstance.png" alt="Create Interpreter">
+</center></p>
+
+<p>In the interpreter creation form, put <strong>cass-instance2</strong> as <strong>Name</strong> and select the <strong>cassandra</strong>
+in the interpreter drop-down list<br>
+<br/>
+<br/>
+<center>
+ <img src="/assets/themes/zeppelin/img/docs-img/cassandra-InterpreterName.png" alt="Interpreter Name">
+</center> </p>
+
+<p>Click on <strong>Save</strong> to create the new interpreter instance. Now you should be able to see it in the interpreter list.</p>
+
+<p><br/>
+<br/>
+<center>
+ <img src="/assets/themes/zeppelin/img/docs-img/cassandra-NewInterpreterInList.png" alt="Interpreter In List">
+</center> </p>
+
+<p>Go back to your notebook and click on the <strong>Gear</strong> icon to configure interpreter bindings.
+You should be able to see and select the <strong>cass-instance2</strong> interpreter instance in the available
+interpreter list instead of the standard <strong>cassandra</strong> instance.</p>
+
+<p><br/>
+<br/>
+<center>
+ <img src="/assets/themes/zeppelin/img/docs-img/cassandra-InterpreterInstanceSelection.png" alt="Interpreter Instance Selection">
+</center> </p>
+
+<hr/>
+
+<h2>13. Interpreter Configuration</h2>
+
+<p>To configure the <strong>Cassandra</strong> interpreter, go to the <strong>Interpreter</strong> menu and scroll down to change the parameters.
+The <strong>Cassandra</strong> interpreter is using the official <strong><a href="https://github.com/datastax/java-driver">Cassandra Java Driver</a></strong> and most of the parameters are used
+to configure the Java driver</p>
+
+<p>Below are the configuration parameters and their default value.</p>
+
+<p><table class="table-configuration">
+ <tr>
+ <th>Property Name</th>
+ <th>Description</th>
+ <th>Default Value</th>
+ </tr>
+ <tr>
+ <td>cassandra.cluster</td>
+ <td>Name of the Cassandra cluster to connect to</td>
+ <td>Test Cluster</td>
+ </tr>
+ <tr>
+ <td>cassandra.compression.protocol</td>
+ <td>On wire compression. Possible values are: NONE, SNAPPY, LZ4</td>
+ <td>NONE</td>
+ </tr>
+ <tr>
+ <td>cassandra.credentials.username</td>
+ <td>If security is enable, provide the login</td>
+ <td>none</td>
+ </tr>
+ <tr>
+ <td>cassandra.credentials.password</td>
+ <td>If security is enable, provide the password</td>
+ <td>none</td>
+ </tr>
+ <tr>
+ <td>cassandra.hosts</td>
+ <td>
+ Comma separated Cassandra hosts (DNS name or IP address).
+ <br/>
+ Ex: '192.168.0.12,node2,node3'
+ </td>
+ <td>localhost</td>
+ </tr>
+ <tr>
+ <td>cassandra.interpreter.parallelism</td>
+ <td>Number of concurrent paragraphs(queries block) that can be executed</td>
+ <td>10</td>
+ </tr>
+ <tr>
+ <td>cassandra.keyspace</td>
+ <td>
+ Default keyspace to connect to.
+ <strong>
+ It is strongly recommended to let the default value
+ and prefix the table name with the actual keyspace
+ in all of your queries
+ </strong>
+ </td>
+ <td>system</td>
+ </tr>
+ <tr>
+ <td>cassandra.load.balancing.policy</td>
+ <td>
+ Load balancing policy. Default = <em>new TokenAwarePolicy(new DCAwareRoundRobinPolicy())</em>
+ To Specify your own policy, provide the <strong>fully qualify class name (FQCN)</strong> of your policy.
+ At runtime the interpreter will instantiate the policy using
+ <strong>Class.forName(FQCN)</strong>
+ </td>
+ <td>DEFAULT</td>
+ </tr>
+ <tr>
+ <td>cassandra.max.schema.agreement.wait.second</td>
+ <td>Cassandra max schema agreement wait in second</td>
+ <td>10</td>
+ </tr>
+ <tr>
+ <td>cassandra.pooling.core.connection.per.host.local</td>
+ <td>Protocol V2 and below default = 2. Protocol V3 and above default = 1</td>
+ <td>2</td>
+ </tr>
+ <tr>
+ <td>cassandra.pooling.core.connection.per.host.remote</td>
+ <td>Protocol V2 and below default = 1. Protocol V3 and above default = 1</td>
+ <td>1</td>
+ </tr>
+ <tr>
+ <td>cassandra.pooling.heartbeat.interval.seconds</td>
+ <td>Cassandra pool heartbeat interval in secs</td>
+ <td>30</td>
+ </tr>
+ <tr>
+ <td>cassandra.pooling.idle.timeout.seconds</td>
+ <td>Cassandra idle time out in seconds</td>
+ <td>120</td>
+ </tr>
+ <tr>
+ <td>cassandra.pooling.max.connection.per.host.local</td>
+ <td>Protocol V2 and below default = 8. Protocol V3 and above default = 1</td>
+ <td>8</td>
+ </tr>
+ <tr>
+ <td>cassandra.pooling.max.connection.per.host.remote</td>
+ <td>Protocol V2 and below default = 2. Protocol V3 and above default = 1</td>
+ <td>2</td>
+ </tr>
+ <tr>
+ <td>cassandra.pooling.max.request.per.connection.local</td>
+ <td>Protocol V2 and below default = 128. Protocol V3 and above default = 1024</td>
+ <td>128</td>
+ </tr>
+ <tr>
+ <td>cassandra.pooling.max.request.per.connection.remote</td>
+ <td>Protocol V2 and below default = 128. Protocol V3 and above default = 256</td>
+ <td>128</td>
+ </tr>
+ <tr>
+ <td>cassandra.pooling.new.connection.threshold.local</td>
+ <td>Protocol V2 and below default = 100. Protocol V3 and above default = 800</td>
+ <td>100</td>
+ </tr>
+ <tr>
+ <td>cassandra.pooling.new.connection.threshold.remote</td>
+ <td>Protocol V2 and below default = 100. Protocol V3 and above default = 200</td>
+ <td>100</td>
+ </tr>
+ <tr>
+ <td>cassandra.pooling.pool.timeout.millisecs</td>
+ <td>Cassandra pool time out in millisecs</td>
+ <td>5000</td>
+ </tr>
+ <tr>
+ <td>cassandra.protocol.version</td>
+ <td>Cassandra binary protocol version</td>
+ <td>3</td>
+ </tr>
+ <tr>
+ <td>cassandra.query.default.consistency</td>
+ <td>
+ Cassandra query default consistency level
+ <br/>
+ Available values: ONE, TWO, THREE, QUORUM, LOCAL<em>ONE, LOCAL</em>QUORUM, EACH<em>QUORUM, ALL
+ </td>
+ <td>ONE</td>
+ </tr>
+ <tr>
+ <td>cassandra.query.default.fetchSize</td>
+ <td>Cassandra query default fetch size</td>
+ <td>5000</td>
+ </tr>
+ <tr>
+ <td>cassandra.query.default.serial.consistency</td>
+ <td>
+ Cassandra query default serial consistency level
+ <br/>
+ Available values: SERIAL, LOCAL</em>SERIAL
+ </td>
+ <td>SERIAL</td>
+ </tr>
+ <tr>
+ <td>cassandra.reconnection.policy</td>
+ <td>
+ Cassandra Reconnection Policy.
+ Default = new ExponentialReconnectionPolicy(1000, 10 * 60 * 1000)
+ To Specify your own policy, provide the <strong>fully qualify class name (FQCN)</strong> of your policy.
+ At runtime the interpreter will instantiate the policy using
+ <strong>Class.forName(FQCN)</strong>
+ </td>
+ <td>DEFAULT</td>
+ </tr>
+ <tr>
+ <td>cassandra.retry.policy</td>
+ <td>
+ Cassandra Retry Policy.
+ Default = DefaultRetryPolicy.INSTANCE
+ To Specify your own policy, provide the <strong>fully qualify class name (FQCN)</strong> of your policy.
+ At runtime the interpreter will instantiate the policy using
+ <strong>Class.forName(FQCN)</strong>
+ </td>
+ <td>DEFAULT</td>
+ </tr>
+ <tr>
+ <td>cassandra.socket.connection.timeout.millisecs</td>
+ <td>Cassandra socket default connection timeout in millisecs</td>
+ <td>500</td>
+ </tr>
+ <tr>
+ <td>cassandra.socket.read.timeout.millisecs</td>
+ <td>Cassandra socket read timeout in millisecs</td>
+ <td>12000</td>
+ </tr>
+ <tr>
+ <td>cassandra.socket.tcp.no_delay</td>
+ <td>Cassandra socket TCP no delay</td>
+ <td>true</td>
+ </tr>
+ <tr>
+ <td>cassandra.speculative.execution.policy</td>
+ <td>
+ Cassandra Speculative Execution Policy.
+ Default = NoSpeculativeExecutionPolicy.INSTANCE
+ To Specify your own policy, provide the <strong>fully qualify class name (FQCN)</strong> of your policy.
+ At runtime the interpreter will instantiate the policy using
+ <strong>Class.forName(FQCN)</strong>
+ </td>
+ <td>DEFAULT</td>
+ </tr>
+ </table></p>
+
+<hr/>
+
+<h2>14. Bugs & Contacts</h2>
+
+<p>If you encounter a bug for this interpreter, please create a <strong><a href="https://issues.apache.org/jira/browse/ZEPPELIN-382?jql=project%20%3D%20ZEPPELIN">JIRA</a></strong> ticket and ping me on Twitter
+ at <strong><a href="https://twitter.com/doanduyhai">@doanduyhai</a></strong></p>
+
+ </div>
+</div>
+
+
+ <hr>
+ <footer>
+ <!-- <p>© 2015 The Apache Software Foundation</p>-->
+ </footer>
+ </div>
+
+
+
+
+ <script type="text/javascript">
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+ ga('create', 'UA-45176241-5', 'zeppelin.incubator.apache.org');
+ ga('require', 'linkid', 'linkid.js');
+ ga('send', 'pageview');
+
+</script>
+
+
+
+ </body>
+</html>
+
Added: incubator/zeppelin/site/docs/0.5.5-incubating/interpreter/flink.html
URL: http://svn.apache.org/viewvc/incubator/zeppelin/site/docs/0.5.5-incubating/interpreter/flink.html?rev=1715104&view=auto
==============================================================================
--- incubator/zeppelin/site/docs/0.5.5-incubating/interpreter/flink.html (added)
+++ incubator/zeppelin/site/docs/0.5.5-incubating/interpreter/flink.html Thu Nov 19 06:38:15 2015
@@ -0,0 +1,417 @@
+
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Flink Interpreter</title>
+ <meta name="description" content="">
+ <meta name="author" content="The Apache Software Foundation">
+
+ <!-- Enable responsive viewport -->
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+ <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
+ <!--[if lt IE 9]>
+ <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+
+ <!-- Le styles -->
+ <link href="/assets/themes/zeppelin/bootstrap/css/bootstrap.css" rel="stylesheet">
+ <link href="/assets/themes/zeppelin/css/style.css?body=1" rel="stylesheet" type="text/css">
+ <link href="/assets/themes/zeppelin/css/syntax.css" rel="stylesheet" type="text/css" media="screen" />
+ <!-- Le fav and touch icons -->
+ <!-- Update these with your own images
+ <link rel="shortcut icon" href="images/favicon.ico">
+ <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
+ <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
+ <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
+ -->
+
+ <!-- Js -->
+ <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
+ <script src="/assets/themes/zeppelin/bootstrap/js/bootstrap.min.js"></script>
+
+ <!-- atom & rss feed -->
+ <link href="/atom.xml" type="application/atom+xml" rel="alternate" title="Sitewide ATOM Feed">
+ <link href="/rss.xml" type="application/rss+xml" rel="alternate" title="Sitewide RSS Feed">
+ </head>
+
+ <body>
+
+ <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
+ <div class="container">
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
+ <span class="sr-only">Toggle navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="navbar-brand" href="/">
+ <img src="/assets/themes/zeppelin/img/zeppelin_logo.png" width="50" alt="I'm zeppelin">
+ Zeppelin <small>(0.5.5-incubating)</small>
+ </a>
+ </div>
+ <nav class="navbar-collapse collapse" role="navigation">
+ <ul class="nav navbar-nav">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ </ul>
+ <ul class="nav navbar-nav navbar-right">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li><a href="/docs.html">Docs</a></li>
+
+
+
+
+
+
+
+ <li><a href="/index.html">Overview</a></li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ </ul>
+ </nav><!--/.navbar-collapse -->
+ </div>
+ </div>
+
+
+ <div class="container">
+
+<!--<div class="hero-unit Flink Interpreter">
+ <h1></h1>
+</div>
+-->
+
+<div class="row">
+ <div class="col-md-12">
+ <h2>Flink interpreter for Apache Zeppelin</h2>
+
+<p><a href="https://flink.apache.org">Apache Flink</a> is an open source platform for distributed stream and batch data processing.</p>
+
+<h3>How to start local Flink cluster, to test the interpreter</h3>
+
+<p>Zeppelin comes with pre-configured flink-local interpreter, which starts Flink in a local mode on your machine, so you do not need to install anything.</p>
+
+<h3>How to configure interpreter to point to Flink cluster</h3>
+
+<p>At the "Interpreters" menu, you have to create a new Flink interpreter and provide next properties:</p>
+
+<table class="table-configuration">
+ <tr>
+ <th>property</th>
+ <th>value</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>host</td>
+ <td>local</td>
+ <td>host name of running JobManager. 'local' runs flink in local mode (default)</td>
+ </tr>
+ <tr>
+ <td>port</td>
+ <td>6123</td>
+ <td>port of running JobManager</td>
+ </tr>
+ <tr>
+ <td>xxx</td>
+ <td>yyy</td>
+ <td>anything else from [Flink Configuration](https://ci.apache.org/projects/flink/flink-docs-release-0.9/setup/config.html)</td>
+ </tr>
+</table>
+
+<p><br /></p>
+
+<h3>How to test it's working</h3>
+
+<p>In example, by using the <a href="https://www.zeppelinhub.com/viewer/notebooks/aHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL05GTGFicy96ZXBwZWxpbi1ub3RlYm9va3MvbWFzdGVyL25vdGVib29rcy8yQVFFREs1UEMvbm90ZS5qc29u">Zeppelin notebook</a> is from <a href="http://www.slideshare.net/tillrohrmann/data-analysis-49806564">Till Rohrmann's presentation</a> "Interactive data analysis with Apache Flink" for Apache Flink Meetup.</p>
+<div class="highlight"><pre><code class="text language-text" data-lang="text">%sh
+rm 10.txt.utf-8
+wget http://www.gutenberg.org/ebooks/10.txt.utf-8
+</code></pre></div><div class="highlight"><pre><code class="text language-text" data-lang="text">%flink
+case class WordCount(word: String, frequency: Int)
+val bible:DataSet[String] = env.readTextFile("10.txt.utf-8")
+val partialCounts: DataSet[WordCount] = bible.flatMap{
+ line =>
+ """\b\w+\b""".r.findAllIn(line).map(word => WordCount(word, 1))
+// line.split(" ").map(word => WordCount(word, 1))
+}
+val wordCounts = partialCounts.groupBy("word").reduce{
+ (left, right) => WordCount(left.word, left.frequency + right.frequency)
+}
+val result10 = wordCounts.first(10).collect()
+</code></pre></div>
+ </div>
+</div>
+
+
+ <hr>
+ <footer>
+ <!-- <p>© 2015 The Apache Software Foundation</p>-->
+ </footer>
+ </div>
+
+
+
+
+ <script type="text/javascript">
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+ ga('create', 'UA-45176241-5', 'zeppelin.incubator.apache.org');
+ ga('require', 'linkid', 'linkid.js');
+ ga('send', 'pageview');
+
+</script>
+
+
+
+ </body>
+</html>
+
Added: incubator/zeppelin/site/docs/0.5.5-incubating/interpreter/geode.html
URL: http://svn.apache.org/viewvc/incubator/zeppelin/site/docs/0.5.5-incubating/interpreter/geode.html?rev=1715104&view=auto
==============================================================================
--- incubator/zeppelin/site/docs/0.5.5-incubating/interpreter/geode.html (added)
+++ incubator/zeppelin/site/docs/0.5.5-incubating/interpreter/geode.html Thu Nov 19 06:38:15 2015
@@ -0,0 +1,532 @@
+
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Geode OQL Interpreter</title>
+ <meta name="description" content="">
+ <meta name="author" content="The Apache Software Foundation">
+
+ <!-- Enable responsive viewport -->
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+ <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
+ <!--[if lt IE 9]>
+ <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+
+ <!-- Le styles -->
+ <link href="/assets/themes/zeppelin/bootstrap/css/bootstrap.css" rel="stylesheet">
+ <link href="/assets/themes/zeppelin/css/style.css?body=1" rel="stylesheet" type="text/css">
+ <link href="/assets/themes/zeppelin/css/syntax.css" rel="stylesheet" type="text/css" media="screen" />
+ <!-- Le fav and touch icons -->
+ <!-- Update these with your own images
+ <link rel="shortcut icon" href="images/favicon.ico">
+ <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
+ <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
+ <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
+ -->
+
+ <!-- Js -->
+ <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
+ <script src="/assets/themes/zeppelin/bootstrap/js/bootstrap.min.js"></script>
+
+ <!-- atom & rss feed -->
+ <link href="/atom.xml" type="application/atom+xml" rel="alternate" title="Sitewide ATOM Feed">
+ <link href="/rss.xml" type="application/rss+xml" rel="alternate" title="Sitewide RSS Feed">
+ </head>
+
+ <body>
+
+ <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
+ <div class="container">
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
+ <span class="sr-only">Toggle navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="navbar-brand" href="/">
+ <img src="/assets/themes/zeppelin/img/zeppelin_logo.png" width="50" alt="I'm zeppelin">
+ Zeppelin <small>(0.5.5-incubating)</small>
+ </a>
+ </div>
+ <nav class="navbar-collapse collapse" role="navigation">
+ <ul class="nav navbar-nav">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ </ul>
+ <ul class="nav navbar-nav navbar-right">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li><a href="/docs.html">Docs</a></li>
+
+
+
+
+
+
+
+ <li><a href="/index.html">Overview</a></li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ </ul>
+ </nav><!--/.navbar-collapse -->
+ </div>
+ </div>
+
+
+ <div class="container">
+
+<!--<div class="hero-unit Geode OQL Interpreter">
+ <h1></h1>
+</div>
+-->
+
+<div class="row">
+ <div class="col-md-12">
+ <h2>Geode/Gemfire OQL Interpreter for Apache Zeppelin</h2>
+
+<p><br/>
+<table class="table-configuration">
+ <tr>
+ <th>Name</th>
+ <th>Class</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>%geode.oql</td>
+ <td>GeodeOqlInterpreter</td>
+ <td>Provides OQL environment for Apache Geode</td>
+ </tr>
+</table></p>
+
+<p><br/>
+This interpreter supports the <a href="http://geode.incubator.apache.org/">Geode</a> <a href="http://geode-docs.cfapps.io/docs/developing/querying_basics/oql_compared_to_sql.html">Object Query Language (OQL)</a>. With the OQL-based querying language:</p>
+
+<p><a href="https://www.youtube.com/watch?v=zvzzA9GXu3Q"><img align="right" src="http://img.youtube.com/vi/zvzzA9GXu3Q/3.jpg" alt="zeppelin-view" hspace="10" width="200"></img></a></p>
+
+<ul>
+<li>You can query on any arbitrary object</li>
+<li>You can navigate object collections</li>
+<li>You can invoke methods and access the behavior of objects</li>
+<li>Data mapping is supported</li>
+<li>You are not required to declare types. Since you do not need type definitions, you can work across multiple languages</li>
+<li>You are not constrained by a schema</li>
+</ul>
+
+<p>This <a href="https://www.youtube.com/watch?v=zvzzA9GXu3Q">Video Tutorial</a> illustrates some of the features provided by the <code>Geode Interpreter</code>.</p>
+
+<h3>Create Interpreter</h3>
+
+<p>By default Zeppelin creates one <code>Geode/OQL</code> instance. You can remove it or create more instances. </p>
+
+<p>Multiple Geode instances can be created, each configured to the same or different backend Geode cluster. But over time a <code>Notebook</code> can have only one Geode interpreter instance <code>bound</code>. That means you <em>can not</em> connect to different Geode clusters in the same <code>Notebook</code>. This is a known Zeppelin limitation. </p>
+
+<p>To create new Geode instance open the <code>Interprter</code> section and click the <code>+Create</code> button. Pick a <code>Name</code> of your choice and from the <code>Interpreter</code> drop-down select <code>geode</code>. Then follow the configuration instructions and <code>Save</code> the new instance. </p>
+
+<blockquote>
+<p>Note: The <code>Name</code> of the instance is used only to distinct the instances while binding them to the <code>Notebook</code>. The <code>Name</code> is irrelevant inside the <code>Notebook</code>. In the <code>Notebook</code> you must use <code>%geode.oql</code> tag. </p>
+</blockquote>
+
+<h3>Bind to Notebook</h3>
+
+<p>In the <code>Notebook</code> click on the <code>settings</code> icon in the top right corner. The select/deselect the interpreters to be bound with the <code>Notebook</code>.</p>
+
+<h3>Configuration</h3>
+
+<p>You can modify the configuration of the Geode from the <code>Interpreter</code> section. The Geode interpreter express the following properties:</p>
+
+<p><table class="table-configuration">
+ <tr>
+ <th>Property Name</th>
+ <th>Description</th>
+ <th>Default Value</th>
+ </tr>
+ <tr>
+ <td>geode.locator.host</td>
+ <td>The Geode Locator Host</td>
+ <td>localhost</td>
+ </tr>
+ <tr>
+ <td>geode.locator.port</td>
+ <td>The Geode Locator Port</td>
+ <td>10334</td>
+ </tr>
+ <tr>
+ <td>geode.max.result</td>
+ <td>Max number of OQL result to display to prevent the browser overload</td>
+ <td>1000</td>
+ </tr>
+ </table></p>
+
+<h3>How to use</h3>
+
+<blockquote>
+<p><em>Tip 1: Use (CTRL + .) for OQL auto-completion.</em></p>
+
+<p><em>Tip 2: Alawys start the paragraphs with the full <code>%geode.oql</code> prefix tag! The short notation: <code>%geode</code> would still be able run the OQL queries but the syntax highlighting and the auto-completions will be disabled.</em></p>
+</blockquote>
+
+<h4>Create / Destroy Regions</h4>
+
+<p>The OQL sepecification does not support <a href="https://cwiki.apache.org/confluence/display/GEODE/Index#Index-MainConceptsandComponents">Geode Regions</a> mutation operations. To <code>creaate</code>/<code>destroy</code> regions one should use the <a href="http://geode-docs.cfapps.io/docs/tools_modules/gfsh/chapter_overview.html">GFSH</a> shell tool instead. To wokr this it assumes that the GFSH is colocated with Zeppelin server.</p>
+<div class="highlight"><pre><code class="bash language-bash" data-lang="bash">%sh
+<span class="nb">source</span> /etc/geode/conf/geode-env.sh
+gfsh <span class="s"><< EOF</span>
+
+<span class="s"> connect --locator=ambari.localdomain[10334]</span>
+
+<span class="s"> destroy region --name=/regionEmployee</span>
+<span class="s"> destroy region --name=/regionCompany</span>
+<span class="s"> create region --name=regionEmployee --type=REPLICATE</span>
+<span class="s"> create region --name=regionCompany --type=REPLICATE</span>
+
+<span class="s"> exit;</span>
+<span class="s">EOF</span>
+</code></pre></div>
+<p>Above snippet re-creates two regions: <code>regionEmployee</code> and <code>regionCompany</code>. Note that you have to explicetely specify the locator host and port. The values should match those you have used in the Geode Interpreter configuration. Comprehensive list of <a href="http://geode-docs.cfapps.io/docs/tools_modules/gfsh/gfsh_quick_reference.html">GFSH Commands by Functional Area</a>.</p>
+
+<h4>Basic OQL</h4>
+<div class="highlight"><pre><code class="sql language-sql" data-lang="sql"><span class="o">%</span><span class="n">geode</span><span class="p">.</span><span class="n">oql</span>
+<span class="k">SELECT</span> <span class="k">count</span><span class="p">(</span><span class="o">*</span><span class="p">)</span> <span class="k">FROM</span> <span class="o">/</span><span class="n">regionEmploee</span>
+</code></pre></div>
+<p>OQL <code>IN</code> and <code>SET</code> filters:</p>
+<div class="highlight"><pre><code class="sql language-sql" data-lang="sql"><span class="o">%</span><span class="n">geode</span><span class="p">.</span><span class="n">oql</span>
+<span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="o">/</span><span class="n">regionEmployee</span>
+<span class="k">WHERE</span> <span class="n">companyId</span> <span class="k">IN</span> <span class="k">SET</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> <span class="k">OR</span> <span class="n">lastName</span> <span class="k">IN</span> <span class="k">SET</span><span class="p">(</span><span class="s1">'Tzolov13'</span><span class="p">,</span> <span class="s1">'Tzolov73'</span><span class="p">)</span>
+</code></pre></div>
+<p>OQL <code>JOIN</code> operations</p>
+<div class="highlight"><pre><code class="sql language-sql" data-lang="sql"><span class="o">%</span><span class="n">geode</span><span class="p">.</span><span class="n">oql</span>
+<span class="k">SELECT</span> <span class="n">e</span><span class="p">.</span><span class="n">employeeId</span><span class="p">,</span> <span class="n">e</span><span class="p">.</span><span class="n">firstName</span><span class="p">,</span> <span class="n">e</span><span class="p">.</span><span class="n">lastName</span><span class="p">,</span> <span class="k">c</span><span class="p">.</span><span class="n">id</span> <span class="k">as</span> <span class="n">companyId</span><span class="p">,</span> <span class="k">c</span><span class="p">.</span><span class="n">companyName</span><span class="p">,</span> <span class="k">c</span><span class="p">.</span><span class="n">address</span>
+<span class="k">FROM</span> <span class="o">/</span><span class="n">regionEmployee</span> <span class="n">e</span><span class="p">,</span> <span class="o">/</span><span class="n">regionCompany</span> <span class="k">c</span>
+<span class="k">WHERE</span> <span class="n">e</span><span class="p">.</span><span class="n">companyId</span> <span class="o">=</span> <span class="k">c</span><span class="p">.</span><span class="n">id</span>
+</code></pre></div>
+<p>By default the QOL responses contain only the region entry values. To access the keys, query the <code>EntrySet</code> instead:</p>
+<div class="highlight"><pre><code class="sql language-sql" data-lang="sql"><span class="o">%</span><span class="n">geode</span><span class="p">.</span><span class="n">oql</span>
+<span class="k">SELECT</span> <span class="n">e</span><span class="p">.</span><span class="k">key</span><span class="p">,</span> <span class="n">e</span><span class="p">.</span><span class="n">value</span><span class="p">.</span><span class="n">companyId</span><span class="p">,</span> <span class="n">e</span><span class="p">.</span><span class="n">value</span><span class="p">.</span><span class="n">email</span>
+<span class="k">FROM</span> <span class="o">/</span><span class="n">regionEmployee</span><span class="p">.</span><span class="n">entrySet</span> <span class="n">e</span>
+</code></pre></div>
+<p>Following query will return the EntrySet value as a Blob:</p>
+<div class="highlight"><pre><code class="sql language-sql" data-lang="sql"><span class="o">%</span><span class="n">geode</span><span class="p">.</span><span class="n">oql</span>
+<span class="k">SELECT</span> <span class="n">e</span><span class="p">.</span><span class="k">key</span><span class="p">,</span> <span class="n">e</span><span class="p">.</span><span class="n">value</span> <span class="k">FROM</span> <span class="o">/</span><span class="n">regionEmployee</span><span class="p">.</span><span class="n">entrySet</span> <span class="n">e</span>
+</code></pre></div>
+<blockquote>
+<p>Note: You can have multiple queries in the same paragraph but only the result from the first is displayed. [<a href="https://issues.apache.org/jira/browse/ZEPPELIN-178">1</a>], [<a href="https://issues.apache.org/jira/browse/ZEPPELIN-212">2</a>].</p>
+</blockquote>
+
+<h4>GFSH Commands From The Shell</h4>
+
+<p>Use the Shell Interpreter (<code>%sh</code>) to run OQL commands form the command line:</p>
+<div class="highlight"><pre><code class="bash language-bash" data-lang="bash">%sh
+<span class="nb">source</span> /etc/geode/conf/geode-env.sh
+gfsh -e <span class="s2">"connect"</span> -e <span class="s2">"list members"</span>
+</code></pre></div>
+<h4>Apply Zeppelin Dynamic Forms</h4>
+
+<p>You can leverage <a href="https://zeppelin.incubator.apache.org/docs/manual/dynamicform.html">Zepplein Dynamic Form</a> inside your OQL queries. You can use both the <code>text input</code> and <code>select form</code> parametrization features</p>
+<div class="highlight"><pre><code class="sql language-sql" data-lang="sql"><span class="o">%</span><span class="n">geode</span><span class="p">.</span><span class="n">oql</span>
+<span class="k">SELECT</span> <span class="o">*</span> <span class="k">FROM</span> <span class="o">/</span><span class="n">regionEmployee</span> <span class="n">e</span> <span class="k">WHERE</span> <span class="n">e</span><span class="p">.</span><span class="n">employeeId</span> <span class="o">></span> <span class="err">${</span><span class="n">Id</span><span class="err">}</span>
+</code></pre></div>
+<h4>Geode REST API</h4>
+
+<p>To list the defined regions you can use the <a href="http://geode-docs.cfapps.io/docs/geode_rest/chapter_overview.html">Geode REST API</a>:</p>
+<div class="highlight"><pre><code class="text language-text" data-lang="text">http://<geode server hostname>phd1.localdomain:8484/gemfire-api/v1/
+</code></pre></div><div class="highlight"><pre><code class="json language-json" data-lang="json"><span class="p">{</span>
+ <span class="nt">"regions"</span> <span class="p">:</span> <span class="p">[{</span>
+ <span class="nt">"name"</span> <span class="p">:</span> <span class="s2">"regionEmployee"</span><span class="p">,</span>
+ <span class="nt">"type"</span> <span class="p">:</span> <span class="s2">"REPLICATE"</span><span class="p">,</span>
+ <span class="nt">"key-constraint"</span> <span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
+ <span class="nt">"value-constraint"</span> <span class="p">:</span> <span class="kc">null</span>
+ <span class="p">},</span> <span class="p">{</span>
+ <span class="nt">"name"</span> <span class="p">:</span> <span class="s2">"regionCompany"</span><span class="p">,</span>
+ <span class="nt">"type"</span> <span class="p">:</span> <span class="s2">"REPLICATE"</span><span class="p">,</span>
+ <span class="nt">"key-constraint"</span> <span class="p">:</span> <span class="kc">null</span><span class="p">,</span>
+ <span class="nt">"value-constraint"</span> <span class="p">:</span> <span class="kc">null</span>
+ <span class="p">}]</span>
+<span class="p">}</span>
+</code></pre></div>
+<blockquote>
+<p>To enable Geode REST API with JSON support add the following properties to geode.server.properties.file and restart:</p>
+</blockquote>
+<div class="highlight"><pre><code class="text language-text" data-lang="text">http-service-port=8484
+start-dev-rest-api=true
+</code></pre></div>
+<h3>Auto-completion</h3>
+
+<p>The Geode Interpreter provides a basic auto-completion functionality. On <code>(Ctrl+.)</code> it list the most relevant suggesntions in a pop-up window. </p>
+
+ </div>
+</div>
+
+
+ <hr>
+ <footer>
+ <!-- <p>© 2015 The Apache Software Foundation</p>-->
+ </footer>
+ </div>
+
+
+
+
+ <script type="text/javascript">
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+ ga('create', 'UA-45176241-5', 'zeppelin.incubator.apache.org');
+ ga('require', 'linkid', 'linkid.js');
+ ga('send', 'pageview');
+
+</script>
+
+
+
+ </body>
+</html>
+
Added: incubator/zeppelin/site/docs/0.5.5-incubating/interpreter/ignite.html
URL: http://svn.apache.org/viewvc/incubator/zeppelin/site/docs/0.5.5-incubating/interpreter/ignite.html?rev=1715104&view=auto
==============================================================================
--- incubator/zeppelin/site/docs/0.5.5-incubating/interpreter/ignite.html (added)
+++ incubator/zeppelin/site/docs/0.5.5-incubating/interpreter/ignite.html Thu Nov 19 06:38:15 2015
@@ -0,0 +1,470 @@
+
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Ignite Interpreter</title>
+ <meta name="description" content="Ignite user guide">
+ <meta name="author" content="The Apache Software Foundation">
+
+ <!-- Enable responsive viewport -->
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+ <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
+ <!--[if lt IE 9]>
+ <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+
+ <!-- Le styles -->
+ <link href="/assets/themes/zeppelin/bootstrap/css/bootstrap.css" rel="stylesheet">
+ <link href="/assets/themes/zeppelin/css/style.css?body=1" rel="stylesheet" type="text/css">
+ <link href="/assets/themes/zeppelin/css/syntax.css" rel="stylesheet" type="text/css" media="screen" />
+ <!-- Le fav and touch icons -->
+ <!-- Update these with your own images
+ <link rel="shortcut icon" href="images/favicon.ico">
+ <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
+ <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
+ <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
+ -->
+
+ <!-- Js -->
+ <script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
+ <script src="/assets/themes/zeppelin/bootstrap/js/bootstrap.min.js"></script>
+
+ <!-- atom & rss feed -->
+ <link href="/atom.xml" type="application/atom+xml" rel="alternate" title="Sitewide ATOM Feed">
+ <link href="/rss.xml" type="application/rss+xml" rel="alternate" title="Sitewide RSS Feed">
+ </head>
+
+ <body>
+
+ <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
+ <div class="container">
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
+ <span class="sr-only">Toggle navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="navbar-brand" href="/">
+ <img src="/assets/themes/zeppelin/img/zeppelin_logo.png" width="50" alt="I'm zeppelin">
+ Zeppelin <small>(0.5.5-incubating)</small>
+ </a>
+ </div>
+ <nav class="navbar-collapse collapse" role="navigation">
+ <ul class="nav navbar-nav">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ </ul>
+ <ul class="nav navbar-nav navbar-right">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li><a href="/docs.html">Docs</a></li>
+
+
+
+
+
+
+
+ <li><a href="/index.html">Overview</a></li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ </ul>
+ </nav><!--/.navbar-collapse -->
+ </div>
+ </div>
+
+
+ <div class="container">
+
+<!--<div class="hero-unit Ignite Interpreter">
+ <h1></h1>
+</div>
+-->
+
+<div class="row">
+ <div class="col-md-12">
+ <h2>Ignite Interpreter for Apache Zeppelin</h2>
+
+<h3>Overview</h3>
+
+<p><a href="https://ignite.apache.org/">Apache Ignite</a> In-Memory Data Fabric is a high-performance, integrated and distributed in-memory platform for computing and transacting on large-scale data sets in real-time, orders of magnitude faster than possible with traditional disk-based or flash technologies.</p>
+
+<p><img src="/assets/themes/zeppelin/img/docs-img/ignite-logo.png" alt="Apache Ignite"></p>
+
+<p>You can use Zeppelin to retrieve distributed data from cache using Ignite SQL interpreter. Moreover, Ignite interpreter allows you to execute any Scala code in cases when SQL doesn't fit to your requirements. For example, you can populate data into your caches or execute distributed computations.</p>
+
+<h3>Installing and Running Ignite example</h3>
+
+<p>In order to use Ignite interpreters, you may install Apache Ignite in some simple steps:</p>
+
+<ol>
+<li><p>Download Ignite <a href="https://ignite.apache.org/download.html#sources">source release</a> or <a href="https://ignite.apache.org/download.html#binaries">binary release</a> whatever you want. But you must download Ignite as the same version of Zeppelin's. If it is not, you can't use scala code on Zeppelin. You can find ignite version in Zepplin at the pom.xml which is placed under <code>path/to/your-Zeppelin/ignite/pom.xml</code> ( Of course, in Zeppelin source release ). Please check <code>ignite.version</code> .<br>Currently, Zeppelin provides ignite only in Zeppelin source release. So, if you download Zeppelin binary release( <code>zeppelin-0.5.0-incubating-bin-spark-xxx-hadoop-xx</code> ), you can not use ignite interpreter on Zeppelin. We are planning to include ignite in a future binary release.</p></li>
+<li><p>Examples are shipped as a separate Maven project, so to start running you simply need to import provided <dest_dir>/apache-ignite-fabric-1.2.0-incubating-bin/pom.xml file into your favourite IDE, such as Eclipse. </p></li>
+</ol>
+
+<ul>
+<li>In case of Eclipse, Eclipse -> File -> Import -> Existing Maven Projects</li>
+<li>Set examples directory path to Eclipse and select the pom.xml.</li>
+<li><p>Then start <code>org.apache.ignite.examples.ExampleNodeStartup</code> (or whatever you want) to run at least one or more ignite node. When you run example code, you may notice that the number of node is increase one by one. </p>
+
+<blockquote>
+<p><strong>Tip. If you want to run Ignite examples on the cli not IDE, you can export executable Jar file from IDE. Then run it by using below command.</strong></p>
+</blockquote>
+<div class="highlight"><pre><code class="text language-text" data-lang="text">$ nohup java -jar </path/to/your Jar file name>
+</code></pre></div></li>
+</ul>
+
+<h3>Configuring Ignite Interpreter</h3>
+
+<p>At the "Interpreters" menu, you may edit Ignite interpreter or create new one. Zeppelin provides these properties for Ignite.</p>
+
+<p><table class="table-configuration">
+ <tr>
+ <th>Property Name</th>
+ <th>value</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>ignite.addresses</td>
+ <td>127.0.0.1:47500..47509</td>
+ <td>Coma separated list of Ignite cluster hosts. See <a href="https://apacheignite.readme.io/v1.2/docs/cluster-config">Ignite Cluster Configuration</a> section for more details.</td>
+ </tr>
+ <tr>
+ <td>ignite.clientMode</td>
+ <td>true</td>
+ <td>You can connect to the Ignite cluster as client or server node. See <a href="https://apacheignite.readme.io/v1.2/docs/clients-vs-servers">Ignite Clients vs. Servers</a> section for details. Use true or false values in order to connect in client or server mode respectively.</td>
+ </tr>
+ <tr>
+ <td>ignite.config.url</td>
+ <td></td>
+ <td>Configuration URL. Overrides all other settings.</td>
+ </tr
+ <tr>
+ <td>ignite.jdbc.url</td>
+ <td>jdbc:ignite:cfg://default-ignite-jdbc.xml</td>
+ <td>Ignite JDBC connection URL.</td>
+ </tr>
+ <tr>
+ <td>ignite.peerClassLoadingEnabled</td>
+ <td>true</td>
+ <td>Enables peer-class-loading. See <a href="https://apacheignite.readme.io/v1.2/docs/zero-deployment">Zero Deployment</a> section for details. Use true or false values in order to enable or disable P2P class loading respectively.</td>
+ </tr>
+ </table></p>
+
+<p><img src="/assets/themes/zeppelin/img/docs-img/ignite-interpreter-setting.png" alt="Configuration of Ignite Interpreter"></p>
+
+<h3>Interpreter Binding for Zeppelin Notebook</h3>
+
+<p>After configuring Ignite interpreter, create your own notebook. Then you can bind interpreters like below image.</p>
+
+<p><img src="/assets/themes/zeppelin/img/docs-img/ignite-interpreter-binding.png" alt="Binding Interpreters"></p>
+
+<p>For more interpreter binding information see <a href="http://zeppelin.incubator.apache.org/docs/manual/interpreters.html">here</a>.</p>
+
+<h3>How to use Ignite SQL interpreter</h3>
+
+<p>In order to execute SQL query, use <code>%ignite.ignitesql</code> prefix. <br>
+Supposing you are running <code>org.apache.ignite.examples.streaming.wordcount.StreamWords</code>, then you can use "words" cache( Of course you have to specify this cache name to the Ignite interpreter setting section <code>ignite.jdbc.url</code> of Zeppelin ).
+For example, you can select top 10 words in the words cache using the following query</p>
+<div class="highlight"><pre><code class="text language-text" data-lang="text"> %ignite.ignitesql
+ select _val, count(_val) as cnt from String group by _val order by cnt desc limit 10
+</code></pre></div>
+<p><img src="/assets/themes/zeppelin/img/docs-img/ignite-sql-example.png" alt="IgniteSql on Zeppelin"></p>
+
+<p>As long as your Ignite version and Zeppelin Ignite version is same, you can also use scala code. Please check the Zeppelin Ignite version before you download your own Ignite. </p>
+<div class="highlight"><pre><code class="text language-text" data-lang="text"> %ignite
+ import org.apache.ignite._
+ import org.apache.ignite.cache.affinity._
+ import org.apache.ignite.cache.query._
+ import org.apache.ignite.configuration._
+
+ import scala.collection.JavaConversions._
+
+ val cache: IgniteCache[AffinityUuid, String] = ignite.cache("words")
+
+ val qry = new SqlFieldsQuery("select avg(cnt), min(cnt), max(cnt) from (select count(_val) as cnt from String group by _val)", true)
+
+ val res = cache.query(qry).getAll()
+
+ collectionAsScalaIterable(res).foreach(println _)
+</code></pre></div>
+<p><img src="/assets/themes/zeppelin/img/docs-img/ignite-scala-example.png" alt="Using Scala Code"></p>
+
+<p>Apache Ignite also provides a guide docs for Zeppelin <a href="https://apacheignite.readme.io/docs/data-analysis-with-apache-zeppelin">"Ignite with Apache Zeppelin"</a></p>
+
+ </div>
+</div>
+
+
+ <hr>
+ <footer>
+ <!-- <p>© 2015 The Apache Software Foundation</p>-->
+ </footer>
+ </div>
+
+
+
+
+ <script type="text/javascript">
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+ ga('create', 'UA-45176241-5', 'zeppelin.incubator.apache.org');
+ ga('require', 'linkid', 'linkid.js');
+ ga('send', 'pageview');
+
+</script>
+
+
+
+ </body>
+</html>
+