You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by fe...@apache.org on 2016/01/24 19:04:56 UTC

[2/6] incubator-zeppelin git commit: [ZEPPELIN-559] Cassandra interpreter v2

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/11a45e2e/cassandra/src/test/resources/scalate/Help.html
----------------------------------------------------------------------
diff --git a/cassandra/src/test/resources/scalate/Help.html b/cassandra/src/test/resources/scalate/Help.html
index de71d64..1c82c66 100644
--- a/cassandra/src/test/resources/scalate/Help.html
+++ b/cassandra/src/test/resources/scalate/Help.html
@@ -1,870 +1 @@
-<br/>
-<br/>
-<nav class="navbar navbar-default">
-    <ul class="nav navbar-nav">
-        <li role="presentation" class="dropdown">
-            <a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
-                <span class="text-info"><i class="glyphicon glyphicon-book"/>&nbsp;<strong>Please select ...</strong></span>
-                <span class="text-info caret"></span>
-                <ul class="dropdown-menu">
-                    <li class="dropdown-header"><span class="text-info">Topics</span></li>
-                    <li>
-                        <a role="button" data-toggle="collapse" data-target="#d977b63a-9900-4ecd-a438-70eb490d6a48">
-                            <span class="text-info"><i class="glyphicon glyphicon-bookmark"/>&nbsp;&nbsp;Basic Commands</span>
-                        </a>
-                    </li>
-                    <li>
-                        <a role="button" data-toggle="collapse" data-target="#eb22d00b-9be8-478a-b4bf-740f98e1e6ec">
-                            <span class="text-info"><i class="glyphicon glyphicon-bookmark"/>&nbsp;&nbsp;Schema Discovery</span>
-                        </a>
-                    </li>
-                    <li>
-                        <a role="button" data-toggle="collapse" data-target="#881a5e0b-5e52-4474-ba80-787dfe0a770d">
-                            <span class="text-info"><i class="glyphicon glyphicon-bookmark"/>&nbsp;&nbsp;Query Parameters</span>
-                        </a>
-                    </li>
-                    <li>
-                        <a role="button" data-toggle="collapse" data-target="#2af5a125-8754-40fb-a044-bda10395504f">
-                            <span class="text-info"><i class="glyphicon glyphicon-bookmark"/>&nbsp;&nbsp;Prepared Statements</span>
-                        </a>
-                    </li>
-                    <li>
-                        <a role="button" data-toggle="collapse" data-target="#4dfe08e1-7ee0-4222-8be0-3d9d43aab38e">
-                            <span class="text-info"><i class="glyphicon glyphicon-bookmark"/>&nbsp;&nbsp;Dynamic Forms</span>
-                        </a>
-                    </li>
-                    <li>
-                        <a role="button" data-toggle="collapse" data-target="#6485679a-ab5b-406b-8281-37f586459754">
-                            <span class="text-info"><i class="glyphicon glyphicon-bookmark"/>&nbsp;&nbsp;Interpreter Configuration</span>
-                        </a>
-                    </li>
-                    <li>
-                        <a role="button" data-toggle="collapse" data-target="#2d060cba-7f9a-40de-8cc3-d82586d4321e">
-                            <span class="text-info"><i class="glyphicon glyphicon-bookmark"/>&nbsp;&nbsp;Misc</span>
-                        </a>
-                    </li>
-                </ul>
-            </a>
-        </li>
-
-        <li>
-            <a><span class="text-info"><strong>CASSANDRA INTERPRETER DOCUMENTATION</strong></span></a>
-        </li>
-    </ul>
-    <ul class="nav navbar-nav navbar-right">
-        <li class="dropdown">
-            <a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
-                <span class="text-info"><strong>About ...</strong></span>
-                <span class="caret"></span>
-            </a>
-            <ul class="dropdown-menu">
-                <li>
-                    <a role="button">
-                        <span class="text-info">Version <strong>1.0</strong></span>
-                    </a>
-                </li>
-                <li>
-                    <a role="button">
-                        <span class="text-info">Java Driver Version <strong>2.1.7.1</strong></span>
-                    </a>
-                </li>
-                <li>
-                    <a role="button">
-                        <span class="text-info">Author <strong>@doanduyhai</strong></span>
-                    </a>
-                </li>
-            </ul>
-        </li>
-        <li>
-            <a href="#"></a>
-        </li>
-</nav>
-<br/><br/>
-<div class="container">
-    <div class="panel panel-default">
-        <div class="panel-heading" role="tab">
-            <h4 class="panel-title">
-                <a role="button" data-toggle="collapse" data-target="#d977b63a-9900-4ecd-a438-70eb490d6a48" aria-expanded="false">
-                    <span class="text-info"><strong>Basic Commands</strong></span>
-                </a>
-            </h4>
-        </div>
-        <div id="d977b63a-9900-4ecd-a438-70eb490d6a48" class="panel-collapse collapse in" role="tabpanel">
-            <div class="panel-body">
-
-                <div class="panel panel-default">
-                    <div class="panel-body">
-                        <h3>I CQL Statements</h3>
-                        <p>This interpreter is compatible with any CQL statement supported by Cassandra. Ex:
-                            <br/><br/>
-                        <div class="row">
-                            <div class="col-md-6 col-md-offset-3">
-                                <pre>
-
-    INSERT INTO users(login,name) VALUES('jdoe','John DOE');
-    SELECT * FROM users WHERE login='jdoe';
-                                </pre>
-                            </div>
-                        </div>
-                        <br/>
-                        Each statement should be separated by a <strong>semi-colon</strong> (;).
-                        <br/>
-                        <strong>Multi-line</strong> statements as well as multiple statements on the <strong>same line</strong>
-                        are also supported as long as they are separated by a semi-colon. Ex:
-                        <br/>
-                        <br/>
-                        <div class="row">
-                            <div class="col-md-8 col-md-offset-2">
-                                <pre>
-
-    USE spark_demo;
-
-    SELECT * FROM albums_by_country LIMIT 1; SELECT * FROM countries LIMIT 1;
-
-    SELECT *
-    FROM artists
-    WHERE login='jlennon';
-                                </pre>
-                            </div>
-                        </div>
-                        <br/>
-                        <strong>Batch</strong> statements are supported and can span multiple lines, as well as
-                        <strong>DDL</strong>(CREATE/ALTER/DROP) statements:
-                        <br/>
-                        <br/>
-                        <div class="row">
-                            <div class="col-md-8 col-md-offset-2">
-                                <pre>
-
-    BEGIN BATCH
-        INSERT INTO users(login,name) VALUES('jdoe','John DOE');
-        INSERT INTO users_preferences(login,account_type) VALUES('jdoe','BASIC');
-    APPLY BATCH;
-
-    CREATE TABLE IF NOT EXISTS test(
-        key int PRIMARY KEY,
-        value text
-    );
-                                </pre>
-                            </div>
-                        </div>
-                        <br/>
-                        CQL statements are <strong>case-insensitive</strong> (except for column names and values).
-                        This means that the following statements are equivalent and valid:
-                        <br/>
-                        <br/>
-                        <div class="row">
-                            <div class="col-md-8 col-md-offset-2">
-                                <pre>
-
-    INSERT INTO users(login,name) VALUES('jdoe','John DOE');
-    Insert into users(login,name) vAlues('hsue','Helen SUE');
-                                </pre>
-                            </div>
-                        </div>
-                        <br/>
-                        The complete list of all CQL statements and versions can be found below:
-                        <br/><br/>
-                        <div class="row">
-                            <div class="col-md-6 col-md-offset-3">
-                                <table class="table table-bordered">
-                                    <thead>
-                                    <tr><th>Cassandra version</th><th>Documentation</th></tr>
-                                    </thead>
-                                    <tbody>
-                                    <tr>
-                                        <td><strong>2.2</strong></td>
-                                        <td>
-                                            <a href="http://docs.datastax.com/en/cql/3.3/cql/cqlIntro.html" target="_blank">
-                                                http://docs.datastax.com/en/cql/3.3/cql/cqlIntro.html
-                                            </a>
-                                        </td>
-                                    </tr>
-                                    <tr>
-                                        <td><strong>2.1 & 2.0</strong></td>
-                                        <td>
-                                            <a href="http://docs.datastax.com/en/cql/3.1/cql/cql_intro_c.html" target="_blank">
-                                                http://docs.datastax.com/en/cql/3.1/cql/cql_intro_c.html
-                                            </a>
-                                        </td>
-                                    </tr>
-                                    <tr>
-                                        <td><strong>1.2</strong></td>
-                                        <td>
-                                            <a href="http://docs.datastax.com/en/cql/3.0/cql/aboutCQL.html" target="_blank">
-                                                http://docs.datastax.com/en/cql/3.0/cql/aboutCQL.html
-                                            </a>
-                                        </td>
-                                    </tr>
-                                    </tbody>
-                                </table>
-                            </div>
-                        </div>
-
-
-                        </p>
-                        <h3>II Comments</h3>
-                        <p>
-                            It is possible to add comments between statements. Single line comments start with the
-                            <strong>hash</strong> sign (#). Multi-line comments are enclosed between
-                            <strong>&sol;&ast;&ast;</strong> and <strong>&ast;&ast;&sol;</strong>. Ex:
-
-                            <br/>
-                            <br/>
-                        <div class="row">
-                            <div class="col-md-8 col-md-offset-2">
-                                <pre>
-
-    #First comment
-    INSERT INTO users(login,name) VALUES('jdoe','John DOE');
-
-    /**
-     Multi line
-     comments
-     **/
-    Insert into users(login,name) vAlues('hsue','Helen SUE');
-                                </pre>
-                            </div>
-                        </div>
-                        <br/>
-
-                        </p>
-                        <h3>III Syntax Validation</h3>
-                        <p>
-                            The interpreters is shipped with a <em>built-in syntax validator</em>. This validator only
-                            checks for <strong>basic syntax errors</strong>. All CQL-related syntax validation is delegated
-                            directly to <strong>Cassandra</strong>
-                            <br/><br/>
-                            Most of the time, syntax errors are due to missing semi-colons between statements or typo errors.
-
-                        </p>
-
-                    </div>
-                </div>
-
-
-
-            </div>
-        </div>
-    </div>
-    <div class="panel panel-default">
-        <div class="panel-heading" role="tab">
-            <h4 class="panel-title">
-                <a role="button" data-toggle="collapse" data-target="#eb22d00b-9be8-478a-b4bf-740f98e1e6ec" aria-expanded="false">
-                    <span class="text-info"><strong>Schema Discovery</strong></span>
-                </a>
-            </h4>
-        </div>
-        <div id="eb22d00b-9be8-478a-b4bf-740f98e1e6ec" class="panel-collapse collapse" role="tabpanel">
-            <div class="panel-body">
-
-                <div class="panel panel-default">
-                    <div class="panel-body">
-                        <h3>I Commands For Discovery</h3>
-                        <p>
-                            To make schema discovery easier and more interactive, the following commands are supported:
-                            <br/><br/>
-                        <table class="table table-bordered">
-                            <thead>
-                            <tr><th>Command</th><th>Description</th></tr>
-                            </thead>
-                            <tbody>
-                            <tr>
-                                <td><strong>DESCRIBE CLUSTER;</strong></td>
-                                <td>Show the current cluster name and its partitioner</td>
-                            </tr>
-                            <tr>
-                                <td><strong>DESCRIBE KEYSPACES;</strong></td>
-                                <td>List all existing keyspaces in the cluster and their configuration
-                                    (replication factor, durable write ...)</td>
-                            </tr>
-                            <tr>
-                                <td><strong>DESCRIBE TABLES;</strong></td>
-                                <td>List all existing keyspaces in the cluster and for each, all the tables name</td>
-                            </tr>
-                            <tr>
-                                <td><strong>DESCRIBE KEYSPACE &lt;keyspace name&gt;;</strong></td>
-                                <td>Describe the given keyspace configuration and all its table details (name, columns, ...)</td>
-                            </tr>
-                            <tr>
-                                <td><strong>DESCRIBE TABLE <em>(&lt;keyspace name&gt;).</em>&lt;table name&gt;;</strong></td>
-                                <td>
-                                    Describe the given table. If the keyspace is not provided, the current
-                                    <strong>logged in</strong> keyspace is used. If there is no logged in keyspace,
-                                    the default <em>system</em> keyspace is used. If no table is found, an error message is raised
-                                </td>
-                            </tr>
-                            <tr>
-                                <td><strong>DESCRIBE TYPE <em>(&lt;keyspace name&gt;).</em>&lt;type name&gt;;</strong></td>
-                                <td>
-                                    Describe the given type(UDT). If the keyspace is not provided, the current
-                                    <strong>logged in</strong> keyspace is used. If there is no logged in keyspace,
-                                    the default <em>system</em> keyspace is used. If no type is found, an error message is raised
-                                </td>
-                            </tr>
-                            </tbody>
-                        </table>
-                        <br/>
-                        <div class="alert alert-danger" role="alert">
-                            Please note that each <strong>DESCRIBE</strong> command should be ended by <strong>a semi-colon</strong>.
-                        </div>
-                        </p>
-                        <h3>II Schema Display</h3>
-                        <p>
-                            The schema objects (cluster, keyspace, table &amp; type) are displayed in a tabular format.
-                            There is a <strong>drop-down</strong> menu on the top left corner to expand objects details.
-                            On the top right menu is shown the Icon legend.
-
-                        </p>
-                    </div>
-                </div>
-
-            </div>
-        </div>
-    </div>
-    <div class="panel panel-default">
-        <div class="panel-heading" role="tab">
-            <h4 class="panel-title">
-                <a role="button" data-toggle="collapse" data-target="#881a5e0b-5e52-4474-ba80-787dfe0a770d" aria-expanded="false">
-                    <span class="text-info"><strong>Query Parameters</strong></span>
-                </a>
-            </h4>
-        </div>
-        <div id="881a5e0b-5e52-4474-ba80-787dfe0a770d" class="panel-collapse collapse" role="tabpanel">
-            <div class="panel-body">
-
-                <div class="panel panel-default">
-                    <div class="panel-body">
-                        <p>
-                            Sometimes you want to be able to pass runtime query parameters to your statements.
-                            Those parameters are <strong>not</strong> part of the CQL specs and are specific to the interpreter.
-                            Below is the list of all parameters:
-
-                            <br/><br/>
-                        <table class="table table-bordered">
-                            <caption>
-                                <h4>Query Parameters</h4>
-                            </caption>
-                            <thead>
-                            <tr>
-                                <th>Parameter</th>
-                                <th>Syntax</th>
-                                <th>Description</th>
-                            </tr>
-                            </thead>
-                            <tbody>
-                            <tr>
-                                <td>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>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>Timestamp</td>
-                                <td><strong>@timestamp=<em>long value</em></strong></td>
-                                <td>Apply the given timestamp to all queries in the paragraph.<br/>
-                                    Please note that timestamp value passed directly in CQL statement will override this value
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>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>Fetch Size</td>
-                                <td><strong>@fetchSize=<em>int value</em></strong></td>
-                                <td>Apply the given fetch size to all queries in the paragraph</td>
-                            </tr>
-                            </tbody>
-                        </table>
-                        <br/>
-                        Some parameters only accept restricted values:
-
-                        <br/><br/>
-                        <table class="table table-bordered">
-                            <caption>
-                                <h4>Allowed Values</h4>
-                            </caption>
-                            <thead>
-                            <tr>
-                                <th>Parameter</th>
-                                <th>Possible Values</th>
-                            </tr>
-                            </thead>
-                            <tbody>
-                            <tr>
-                                <td>Consistency Level</td>
-                                <td><strong>ALL, ANY, ONE, TWO, THREE, QUORUM, LOCAL_ONE, LOCAL_QUORUM, EACH_QUORUM</strong></td>
-                            </tr>
-                            <tr>
-                                <td>Serial Consistency Level</td>
-                                <td><strong>SERIAL, LOCAL_SERIAL</strong></td>
-                            </tr>
-                            <tr>
-                                <td>Timestamp</td>
-                                <td>Any long value</td>
-                            </tr>
-                            <tr>
-                                <td>Retry Policy</td>
-                                <td>
-                                    <strong>
-                                        DEFAULT, DOWNGRADING_CONSISTENCY, FALLTHROUGH, LOGGING_DEFAULT,
-                                        LOGGING_DOWNGRADING, LOGGING_FALLTHROUGH
-                                    </strong>
-                                </td>
-                            </tr>
-                            <tr>
-                                <td>Fetch Size</td>
-                                <td>Any integer value</td>
-                            </tr>
-                            </tbody>
-                        </table>
-                        <br/>
-
-                        <div class="alert alert-danger" role="alert">
-                            Please note that you <strong>should not add semi-colon (;)</strong> at the end of each parameter statement
-                        </div>
-
-                        Some example:
-                        <br/><br/>
-                        <div class="row">
-                            <div class="col-md-8 col-md-offset-2">
-                                <pre>
-
-    CREATE TABLE IF NOT EXISTS spark_demo.ts(
-        key int PRIMARY KEY,
-        value text
-    );
-    TRUNCATE spark_demo.ts;
-
-    # Timestamp in the past
-    @timestamp=10
-
-    # Force timestamp directly in the first insert
-    INSERT INTO spark_demo.ts(key,value) VALUES(1,'first insert') USING TIMESTAMP 100;
-
-    # Select some data to make the clock turn
-    SELECT * FROM spark_demo.albums LIMIT 100;
-
-    # Now insert using the timestamp parameter set at the beginning(10)
-    INSERT INTO spark_demo.ts(key,value) VALUES(1,'second insert');
-
-    # Check for the result. You should see 'first insert'
-    SELECT value FROM spark_demo.ts WHERE key=1;
-                                </pre>
-                            </div>
-                        </div>
-                        <br/>
-
-                        Some remarks about query parameters:
-                        <br/><br/>
-                        <div class="alert alert-info" role="alert">
-                            <ul>
-                                <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</strong> CQL statement 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>
-                            </ul>
-                        </div>
-                        </p>
-                    </div>
-                </div>
-
-
-            </div>
-        </div>
-    </div>
-
-    <div class="panel panel-default">
-        <div class="panel-heading" role="tab">
-            <h4 class="panel-title">
-                <a role="button" data-toggle="collapse" data-target="#2af5a125-8754-40fb-a044-bda10395504f" aria-expanded="false">
-                    <span class="text-info"><strong>Prepared Statements</strong></span>
-                </a>
-            </h4>
-        </div>
-        <div id="2af5a125-8754-40fb-a044-bda10395504f" class="panel-collapse collapse" role="tabpanel">
-            <div class="panel-body">
-                <div class="panel panel-default">
-                    <div class="panel-body">
-                        <h3>I Syntax</h3>
-                        <br/>
-                        <p>
-                            For performance reason, it is better to <strong>prepare statements</strong> before-hand and reuse
-                            them later by providing bound values. This interpreter provides 3 commands to handle prepared and
-                            bound statements:
-                            <br/><br/>
-                        <ol>
-                            <li><strong>@prepare</strong></li>
-                            <li><strong>@bind</strong></li>
-                            <li><strong>@remove_prepared</strong></li>
-                        </ol>
-                        <br/>
-                        Example:
-                        <br/>
-                        <div class="row">
-                            <div class="col-md-10 col-md-offset-1">
-                                <pre>
-
-    @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]
-
-                                </pre>
-                            </div>
-                        </div>
-                        <br/>
-
-                        <h3>II @prepare</h3>
-                        <br/>
-                        <p>
-                            You can use the syntax "<strong>@prepare[statement_name]=SELECT ...</strong>" to create a prepared statement.
-                            The <em>statement_name</em> is mandatory because the interpreter prepares the given statement with the
-                            Java driver and saves the generated prepared statement in an internal map, using the provided
-                            <em>statement_name</em> as search key.
-                            <br/><br/>
-                        <div class="alert alert-info">
-                            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
-                        </div>
-                        <br/>
-                        <div class="alert alert-warning">
-                            If the interpreter encounters many @prepare for the <strong>same statement_name</strong> (key),
-                            only the <strong>first</strong> statement will be taken into account.
-                        </div>
-                        <br/>
-                        Example:
-                        <br/>
-                        <div class="row">
-                            <div class="col-md-10 col-md-offset-1">
-                                <pre>
-
-    @prepare[select]=SELECT * FROM spark_demo.albums LIMIT ?
-
-    @prepare[select]=SELECT * FROM spark_demo.artists LIMIT ?
-                                </pre>
-                            </div>
-                        </div>
-                        <br/>
-
-                        For the above example, the prepared statement is <strong>"SELECT * FROM spark_demo.albums LIMIT ?"</strong>.
-                        <em>"SELECT * FROM spark_demo.artists LIMIT ?"</em> is ignored because an entry already exists in the
-                        prepared statements map with the key <strong>select</strong>.
-                        <br/><br/>
-                        In the context of Zeppelin, a notebook can be scheduled to be executed at regular interval,
-                        thus it is necessary to avoid re-preparing many time the same statement (considered an anti-pattern).
-                        </p>
-                        <h3>III @bind</h3>
-                        <br/>
-                        <p>
-                            Once the statement is prepared (possibly in a separated notebook/paragraph). You can bind values to it:
-                            <br/><br/>
-                        <div class="row">
-                            <div class="col-md-10 col-md-offset-1">
-                                <pre>
-
-    @bind[select_first]=10
-                                </pre>
-                            </div>
-                        </div>
-                        <br/>
-                        Bound values are not mandatory for the <strong>@bind</strong> statement.
-                        However if you provide bound values, they need to comply to some syntax:
-
-                        <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
-                                <a href="http://docs.datastax.com/en/cql/3.1/cql/cql_using/use_collections_c.html" target="_blank">standard CQL syntax</a>:
-                                <ul>
-                                    <li>list:  [‘list_item1’, ’list_item2’, ...]</li>
-                                    <li>set: {‘set_item1’, ‘set_item2’, …}</li>
-                                    <li>map: {‘key1’: ‘val1’, ‘key2’: ‘val2’, …}</li>
-                                </ul>
-                            </li>
-                            <li>
-                                tuple values should be enclosed between parenthesis
-                                (see <a href="http://docs.datastax.com/en/cql/3.1/cql/cql_reference/tupleType.html" target="_blank">tuple CQL syntax</a>):
-                                (‘text’, 123, true)
-                            </li>
-                            <li>
-                                udt values should be enclosed between brackets
-                                (see <a href="http://docs.datastax.com/en/cql/3.1/cql/cql_using/cqlUseUDT.html" target="_blank">udt CQL syntax</a>):
-                                {stree_name: ‘Beverly Hills’,  number: 104, zip_code: 90020, state: ‘California’, …}
-                            </li>
-                        </ul>
-                        <br/>
-                        <div class="alert alert-info">
-                            It is possible to use the <strong>@bind</strong> statement inside a batch: <br/>
-                            <pre>
-    BEGIN BATCH
-        @bind[insert_user]='jdoe','John DOE'
-        UPDATE users SET age = 27 WHERE login='hsue';
-    APPLY BATCH;
-                            </pre>
-                        </div>
-                        <br/>
-                        </p>
-                        <h3>IV @remove_prepare</h3>
-                        <br/>
-                        <p>
-                            To avoid for a prepared statement to stay forever in the prepared statement map, you can use the <strong>@remove_prepare[statement_name]</strong> syntax
-                            to remove it. Removing a non-existing prepared statement yields no error.
-                        </p>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
-
-    <div class="panel panel-default">
-        <div class="panel-heading" role="tab">
-            <h4 class="panel-title">
-                <a role="button" data-toggle="collapse" data-target="#4dfe08e1-7ee0-4222-8be0-3d9d43aab38e" aria-expanded="false">
-                    <span class="text-info"><strong>Dynamic Forms</strong></span>
-                </a>
-            </h4>
-        </div>
-        <div id="4dfe08e1-7ee0-4222-8be0-3d9d43aab38e" class="panel-collapse collapse" role="tabpanel">
-            <div class="panel-body">
-
-                <div class="panel panel-default">
-                    <div class="panel-body">
-                        <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.
-                            <br/><br/>
-
-                            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.
-                            <br/><br/>
-                            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.
-                            <br/><br/>
-                            Example:
-                            <br/>
-                        <div class="row">
-                            <div class="col-md-10 col-md-offset-1">
-                                <pre>
-
-    #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}}';
-
-                                </pre>
-                            </div>
-                        </div>
-                        <br/>
-
-                        In the above example, the first CQL query will be executed for <em>performer='Sheryl Crow'</em>
-                        AND <em>style='Rock'</em>. For subsequent queries, you can change the value directly using the form.
-                        Please note that we enclosed the {{ }} block between simple quotes (') 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 <em>'Rock'</em> and not <em>Rock</em>.
-
-                        <br/><br/>
-                        <div class="alert alert-info">
-                            It is also possible to use dynamic forms for <strong>prepared statements</strong>: <br/>
-                            <strong>@bind[select]=='{{performer=Sheryl Crow|Doof|Fanfarlo|Los Paranoia}}', '{{style=Rock}}'</strong>
-                        </div>
-                        </pre>
-                        </p>
-                    </div>
-                </div>
-
-            </div>
-        </div>
-    </div>
-
-    <div class="panel panel-default">
-        <div class="panel-heading" role="tab">
-            <h4 class="panel-title">
-                <a role="button" data-toggle="collapse" data-target="#6485679a-ab5b-406b-8281-37f586459754" aria-expanded="false">
-                    <span class="text-info"><strong>Interpreter Configuration</strong></span>
-                </a>
-            </h4>
-        </div>
-        <div id="6485679a-ab5b-406b-8281-37f586459754" class="panel-collapse collapse" role="tabpanel">
-            <div class="panel-body">
-                The <strong>Cassandra</strong> interpreter comes with some some configuration values for the Java driver:
-
-                <table class="table table-bordered">
-                    <caption>
-                        <h4>Interpreter Configuration</h4>
-                    </caption>
-                    <thead>
-                    <tr>
-                        <th>Parameter</th>
-                        <th>Default Value</th>
-                    </tr>
-                    </thead>
-                    <tbody>
-                    <tr>
-                        <td>cassandra.cluster</td>
-                        <td><strong>Test Cluster</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.compression.protocol</td>
-                        <td><strong>NONE</strong>, possible values: LZ4, SNAPPY</td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.credentials.password</td>
-                        <td><strong>none</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.credentials.username</td>
-                        <td><strong>none</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.hosts</td>
-                        <td><strong>localhost</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.interpreter.parallelism</td>
-                        <td><strong>10</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.keyspace</td>
-                        <td><strong>system</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.load.balancing.policy</td>
-                        <td><strong>DEFAULT</strong>, or a FQCN of a custom class</td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.max.schema.agreement.wait.second</td>
-                        <td><strong>10</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.native.port</td>
-                        <td><strong>9042</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.pooling.core.connection.per.host.local</td>
-                        <td><strong>Protocol V2 and below: 2, V3 and above: 1</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.pooling.core.connection.per.host.remote</td>
-                        <td><strong>Protocol V2 and below: 1, V3 and above: 1</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.pooling.heartbeat.interval.seconds</td>
-                        <td><strong>30</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.pooling.idle.timeout.seconds</td>
-                        <td><strong>Test Cluster</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.pooling.max.connection.per.host.local</td>
-                        <td><strong>Protocol V2 and below: 8, V3 and above: 1</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.pooling.max.connection.per.host.remote</td>
-                        <td><strong>Protocol V2 and below: 2, V3 and above: 1</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.pooling.max.request.per.connection.local</td>
-                        <td><strong>Protocol V2 and below: 128, V3 and above: 1024</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.pooling.max.request.per.connection.remote</td>
-                        <td><strong>Protocol V2 and below: 128, V3 and above: 256</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.pooling.new.connection.threshold.local</td>
-                        <td><strong>Protocol V2 and below: 100, V3 and above: 800</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.pooling.new.connection.threshold.remote</td>
-                        <td><strong>Protocol V2 and below: 100, V3 and above: 200</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.pooling.pool.timeout.millisecs</td>
-                        <td><strong>5000</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.protocol.version</td>
-                        <td><strong>3</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.query.default.consistency</td>
-                        <td><strong>ONE</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.query.default.fetchSize</td>
-                        <td><strong>5000</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.query.default.serial.consistency</td>
-                        <td><strong>SERIAL</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.reconnection.policy</td>
-                        <td><strong>DEFAULT</strong>, or a FQCN of a custom class</td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.retry.policy</td>
-                        <td><strong>DEFAULT</strong>, or a FQCN of a custom class</td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.socket.connection.timeout.millisecs</td>
-                        <td><strong>500</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.socket.read.timeout.millisecs</td>
-                        <td><strong>12000</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.socket.tcp.no_delay</td>
-                        <td><strong>true</strong></td>
-                    </tr>
-                    <tr>
-                        <td>cassandra.speculative.execution.policy</td>
-                        <td><strong>DEFAULT</strong>, or a FQCN of a custom class</td>
-                    </tr>
-                    </tbody>
-                </table>
-            </div>
-        </div>
-    </div>
-
-    <div class="panel panel-default">
-        <div class="panel-heading" role="tab">
-            <h4 class="panel-title">
-                <a role="button" data-toggle="collapse" data-target="#2d060cba-7f9a-40de-8cc3-d82586d4321e" aria-expanded="false">
-                    <span class="text-info"><strong>Miscellaneous</strong></span>
-                </a>
-            </h4>
-        </div>
-        <div id="2d060cba-7f9a-40de-8cc3-d82586d4321e" class="panel-collapse collapse" role="tabpanel">
-            <div class="panel-body">
-                <h3>Execution parallelism</h3>
-                It is possible to execute many paragraphs in parallel. However, at the back-end side, we’re still using <strong>synchronous</strong> queries. Asynchronous execution is only possible when it is possible to return a Future value in the <strong>InterpreterResult</strong>. It may be an interesting proposal for the Zeppelin project.
-            </div>
-        </div>
-    </div>
-</div>
\ No newline at end of file
+<br/><br/><nav class="navbar navbar-default"><ul class="nav navbar-nav"><li role="presentation" class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="text-info"><i class="glyphicon glyphicon-book"/>&nbsp;<strong>Please select ...</strong></span><span class="text-info caret"></span><ul class="dropdown-menu"><li class="dropdown-header"><span class="text-info">Topics</span></li><li><a role="button" data-toggle="collapse" ><span class="text-info"><i class="glyphicon glyphicon-bookmark"/>&nbsp;&nbsp;Basic Commands</span></a></li><li><a role="button" data-toggle="collapse" ><span class="text-info"><i class="glyphicon glyphicon-bookmark"/>&nbsp;&nbsp;Schema Discovery</span></a></li><li><a role="button" data-toggle="collapse" ><span class="text-info"><i class="glyphicon glyphicon-bookmark"/>&nbsp;&nbsp;Query Parameters</span></a></li><li><a role="button" data-toggle="collapse" ><span class="text-info"><i clas
 s="glyphicon glyphicon-bookmark"/>&nbsp;&nbsp;Prepared Statements</span></a></li><li><a role="button" data-toggle="collapse" ><span class="text-info"><i class="glyphicon glyphicon-bookmark"/>&nbsp;&nbsp;Dynamic Forms</span></a></li><li><a role="button" data-toggle="collapse" ><span class="text-info"><i class="glyphicon glyphicon-bookmark"/>&nbsp;&nbsp;Interpreter Configuration</span></a></li><li><a role="button" data-toggle="collapse" ><span class="text-info"><i class="glyphicon glyphicon-bookmark"/>&nbsp;&nbsp;Shared States</span></a></li><li><a role="button" data-toggle="collapse" ><span class="text-info"><i class="glyphicon glyphicon-bookmark"/>&nbsp;&nbsp;Change Log</span></a></li><li><a role="button" data-toggle="collapse" ><span class="text-info"><i class="glyphicon glyphicon-bookmark"/>&nbsp;&nbsp;Contacts &amp; Bugs</span></a></li></ul></a></li><li><a><span class="text-info"><strong>CASSANDRA INTERPRETER DOCUMENTATION</strong></span></a></li></ul><ul class="nav navbar-nav na
 vbar-right"><li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="text-info"><strong>About ...</strong></span><span class="caret"></span></a><ul class="dropdown-menu"><li><a role="button"><span class="text-info">Version <strong>2.0</strong></span></a></li><li><a role="button"><span class="text-info">Java Driver Version <strong>3.0.0-rc1</strong></span></a></li><li><a role="button"><span class="text-info">Author <strong>@doanduyhai</strong></span></a></li></ul></li><li><a href="#"></a></li></nav><br/><br/><div class="container"><div class="panel panel-default"><div class="panel-heading" role="tab"><h4 class="panel-title"><a role="button" data-toggle="collapse"  aria-expanded="false"><span class="text-info"><strong>Basic Commands</strong></span></a></h4></div><div  class="panel-collapse collapse in" role="tabpanel"><div class="panel-body"><div class="panel panel-default"><div class="panel-body"><h3>
 I CQL Statements</h3><p>This interpreter is compatible with any CQL statement supported by Cassandra. Ex:<br/><br/><div class="row"><div class="col-md-6 col-md-offset-3"><pre>INSERT INTO users(login,name) VALUES('jdoe','John DOE');SELECT * FROM users WHERE login='jdoe';</pre></div></div><br/>Each statement should be separated by a <strong>semi-colon</strong> (;).<br/><strong>Multi-line</strong> statements as well as multiple statements on the <strong>same line</strong>are also supported as long as they are separated by a semi-colon. Ex:<br/><br/><div class="row"><div class="col-md-8 col-md-offset-2"><pre>USE spark_demo;SELECT * FROM albums_by_country LIMIT 1; SELECT * FROM countries LIMIT 1;SELECT *FROM artistsWHERE login='jlennon';</pre></div></div><br/><strong>Batch</strong> statements are supported and can span multiple lines, as well as<strong>DDL</strong>(CREATE/ALTER/DROP) statements:<br/><br/><div class="row"><div class="col-md-8 col-md-offset-2"><pre>BEGIN BATCHINSERT INTO u
 sers(login,name) VALUES('jdoe','John DOE');INSERT INTO users_preferences(login,account_type) VALUES('jdoe','BASIC');APPLY BATCH;CREATE TABLE IF NOT EXISTS test(key int PRIMARY KEY,value text);</pre></div></div><br/>CQL statements are <strong>case-insensitive</strong> (except for column names and values).This means that the following statements are equivalent and valid:<br/><br/><div class="row"><div class="col-md-8 col-md-offset-2"><pre>INSERT INTO users(login,name) VALUES('jdoe','John DOE');Insert into users(login,name) vAlues('hsue','Helen SUE');</pre></div></div><br/>The complete list of all CQL statements and versions can be found below:<br/><br/><div class="row"><div class="col-md-6 col-md-offset-3"><table class="table table-bordered"><thead><tr><th>Cassandra version</th><th>Documentation</th></tr></thead><tbody><tr><td><strong>2.2</strong></td><td><a href="http://docs.datastax.com/en/cql/3.3/cql/cqlIntro.html" target="_blank">http://docs.datastax.com/en/cql/3.3/cql/cqlIntro.ht
 ml</a></td></tr><tr><td><strong>2.1 & 2.0</strong></td><td><a href="http://docs.datastax.com/en/cql/3.1/cql/cql_intro_c.html" target="_blank">http://docs.datastax.com/en/cql/3.1/cql/cql_intro_c.html</a></td></tr><tr><td><strong>1.2</strong></td><td><a href="http://docs.datastax.com/en/cql/3.0/cql/aboutCQL.html" target="_blank">http://docs.datastax.com/en/cql/3.0/cql/aboutCQL.html</a></td></tr></tbody></table></div></div></p><h3>II Comments</h3><p>It is possible to add comments between statements. Single line comments start with the<strong>hash</strong> sign (#) or <strong>double slashes</strong> (//). Multi-line comments are enclosed between<strong>&sol;&ast;&ast;</strong> and <strong>&ast;&ast;&sol;</strong>. Ex:<br/><br/><div class="row"><div class="col-md-8 col-md-offset-2"><pre>#Single line comment style 1INSERT INTO users(login,name) VALUES('jdoe','John DOE');//Single line comment style 2/**Multi linecomments**/Insert into users(login,name) vAlues('hsue','Helen SUE');</pre></di
 v></div><br/></p><h3>III Syntax Validation</h3><p>The interpreters is shipped with a <em>built-in syntax validator</em>. This validator onlychecks for <strong>basic syntax errors</strong>. All CQL-related syntax validation is delegateddirectly to <strong>Cassandra</strong><br/><br/>Most of the time, syntax errors are due to missing semi-colons between statements or typo errors.</p></div></div></div></div></div><div class="panel panel-default"><div class="panel-heading" role="tab"><h4 class="panel-title"><a role="button" data-toggle="collapse"  aria-expanded="false"><span class="text-info"><strong>Schema Discovery</strong></span></a></h4></div><div  class="panel-collapse collapse" role="tabpanel"><div class="panel-body"><div class="panel panel-default"><div class="panel-body"><h3>I Commands For Discovery</h3><p>To make schema discovery easier and more interactive, the following commands are supported:<br/><br/><table class="table table-bordered"><thead><tr><th>Command</th><th>Descrip
 tion</th></tr></thead><tbody><tr><td><strong>DESCRIBE CLUSTER;</strong></td><td>Show the current cluster name and its partitioner</td></tr><tr><td><strong>DESCRIBE KEYSPACES;</strong></td><td>List all existing keyspaces in the cluster and their configuration(replication factor, durable write ...)</td></tr><tr><td><strong>DESCRIBE TABLES;</strong></td><td>List all existing keyspaces in the cluster and for each, all the tables name</td></tr><tr><td><strong>DESCRIBE TYPES;</strong></td><td>List all existing keyspaces in the cluster and for each, all the types name</td></tr><tr><td><strong>DESCRIBE FUNCTIONS;</strong></td><td>List all existing keyspaces in the cluster and for each, all the functions name and arguments</td></tr><tr><td><strong>DESCRIBE AGGREGATES;</strong></td><td>List all existing keyspaces in the cluster and for each, all the aggregates name and arguments</td></tr><tr><td><strong>DESCRIBE MATERIALIZED VIEWS;</strong></td><td>List all existing keyspaces in the cluster a
 nd for each, all the materialized view name</td></tr><tr><td><strong>DESCRIBE KEYSPACE &lt;keyspace name&gt;;</strong></td><td>Describe the given keyspace configuration and all its table details (name, columns, ...)</td></tr><tr><td><strong>DESCRIBE TABLE <em>(&lt;keyspace name&gt;).</em>&lt;table name&gt;;</strong></td><td>Describe the given table. If the keyspace is not provided, the current<strong>logged in</strong> keyspace is used. If there is no logged in keyspace,the default <em>system</em> keyspace is used. If no table is found, an error message is raised</td></tr><tr><td><strong>DESCRIBE TYPE <em>(&lt;keyspace name&gt;).</em>&lt;type name&gt;;</strong></td><td>Describe the given type(UDT). If the keyspace is not provided, the current<strong>logged in</strong> keyspace is used. If there is no logged in keyspace,the default <em>system</em> keyspace is used. If no type is found, an error message is raised</td></tr><tr><td><strong>DESCRIBE FUNCTION <em>(&lt;keyspace name&gt;).<
 /em>&lt;function name&gt;;</strong></td><td>Describe the given function. If the keyspace is not provided, the current<strong>logged in</strong> keyspace is used. If there is no logged in keyspace,the default <em>system</em> keyspace is used. If no function is found, an error message is raised</td></tr><tr><td><strong>DESCRIBE AGGREGATE <em>(&lt;keyspace name&gt;).</em>&lt;aggregate name&gt;;</strong></td><td>Describe the given aggregate. If the keyspace is not provided, the current<strong>logged in</strong> keyspace is used. If there is no logged in keyspace,the default <em>system</em> keyspace is used. If no aggregate is found, an error message is raised</td></tr><tr><td><strong>DESCRIBE MATERIALIZED VIEW <em>(&lt;keyspace name&gt;).</em>&lt;view name&gt;;</strong></td><td>Describe the given materialized view. If the keyspace is not provided, the current<strong>logged in</strong> keyspace is used. If there is no logged in keyspace,the default <em>system</em> keyspace is used. If no
  materialized view is found, an error message is raised</td></tr></tbody></table><br/><div class="alert alert-danger" role="alert">Please note that each <strong>DESCRIBE</strong> command should be ended by <strong>a semi-colon</strong>.</div></p><h3>II Schema Display</h3><p>The schema objects (cluster, keyspace, table, type, view, function &amp; aggregate) are displayed in a tabular format. There is a <strong>drop-down</strong> menu on the top left corner to expand objects details. On the top right menu is shown the Icon legend.</p></div></div></div></div></div><div class="panel panel-default"><div class="panel-heading" role="tab"><h4 class="panel-title"><a role="button" data-toggle="collapse"  aria-expanded="false"><span class="text-info"><strong>Query Parameters</strong></span></a></h4></div><div  class="panel-collapse collapse" role="tabpanel"><div class="panel-body"><div class="panel panel-default"><div class="panel-body"><p>Sometimes you want to be able to pass runtime query pa
 rameters to your statements.Those parameters are <strong>not</strong> part of the CQL specs and are specific to the interpreter.Below is the list of all parameters:<br/><br/><table class="table table-bordered"><caption><h4>Query Parameters</h4></caption><thead><tr><th>Parameter</th><th>Syntax</th><th>Description</th></tr></thead><tbody><tr><td>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>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>Timestamp</td><td><strong>@timestamp=<em>long value</em></strong></td><td>Apply the given timestamp to all queries in the paragraph.<br/>Please note that timestamp value passed directly in CQL statement will override this value</td></tr><tr><td>Retry Policy</td><td><strong>@retryPolicy=<em>value</em></stro
 ng></td><td>Apply the given retry policy to all queries in the paragraph</td></tr><tr><td>Fetch Size</td><td><strong>@fetchSize=<em>int value</em></strong></td><td>Apply the given fetch size to all queries in the paragraph</td></tr></tbody></table><br/>Some parameters only accept restricted values:<br/><br/><table class="table table-bordered"><caption><h4>Allowed Values</h4></caption><thead><tr><th>Parameter</th><th>Possible Values</th></tr></thead><tbody><tr><td>Consistency Level</td><td><strong>ALL, ANY, ONE, TWO, THREE, QUORUM, LOCAL_ONE, LOCAL_QUORUM, EACH_QUORUM</strong></td></tr><tr><td>Serial Consistency Level</td><td><strong>SERIAL, LOCAL_SERIAL</strong></td></tr><tr><td>Timestamp</td><td>Any long value</td></tr><tr><td>Retry Policy</td><td><strong>DEFAULT, DOWNGRADING_CONSISTENCY, FALLTHROUGH, LOGGING_DEFAULT,LOGGING_DOWNGRADING, LOGGING_FALLTHROUGH</strong></td></tr><tr><td>Fetch Size</td><td>Any integer value</td></tr></tbody></table><br/><div class="alert alert-danger" r
 ole="alert">Please note that you <strong>should not add semi-colon (;)</strong> at the end of each parameter statement</div>Some example:<br/><br/><div class="row"><div class="col-md-8 col-md-offset-2"><pre>CREATE TABLE IF NOT EXISTS spark_demo.ts(key int PRIMARY KEY,value text);TRUNCATE spark_demo.ts;# Timestamp in the past@timestamp=10# Force timestamp directly in the first insertINSERT INTO spark_demo.ts(key,value) VALUES(1,'first insert') USING TIMESTAMP 100;# Select some data to make the clock turnSELECT * FROM spark_demo.albums LIMIT 100;# Now insert using the timestamp parameter set at the beginning(10)INSERT INTO spark_demo.ts(key,value) VALUES(1,'second insert');# Check for the result. You should see 'first insert'SELECT value FROM spark_demo.ts WHERE key=1;</pre></div></div><br/>Some remarks about query parameters:<br/><br/><div class="alert alert-info" role="alert"><ul><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</strong> CQL statement 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></ul></div></p></div></div></div></div></div><div class="panel panel-default"><div class="panel-heading" role="tab"><h4 class="panel-title"><a role="button" data-toggle="collapse"  aria-expanded="false"><span class="text-info"><strong>Prepared Statements</strong></span></a></h4></div><div  class="panel-collapse collapse" role="tabpanel"><div class="panel-body"><div class="panel panel-default"><div class="panel-body"><h3>I Syntax</h3><br/><p>For performance reason, it is better to <strong>prepare statements</strong> before-hand and reusethem later by providing bound values. This interp
 reter provides 3 commands to handle prepared andbound statements:<br/><br/><ol><li><strong>@prepare</strong></li><li><strong>@bind</strong></li><li><strong>@remove_prepared</strong></li></ol><br/>Example:<br/><div class="row"><div class="col-md-10 col-md-offset-1"><pre>@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]</pre></div></div><br/><h3>II @prepare</h3><br/><p>You can use the syntax "<strong>@prepare[statement_name]=SELECT ...</strong>" to create a prepared statement.The <em>statement_name</em> is mandatory because the interpreter prepares the given statement with theJava driver and saves the generated prepared statement in an internal map, using the provided<em>statement_name</em> as search key.<br/><br/><div class="alert alert-info">Please note that this internal prepared statement map is shared with <strong>al
 l notebooks</strong>and <strong>all paragraphs</strong> because there is only one instance of the interpreter for Cassandra</div><br/><div class="alert alert-warning">If the interpreter encounters many @prepare for the <strong>same statement_name</strong> (key),only the <strong>first</strong> statement will be taken into account.</div><br/>Example:<br/><div class="row"><div class="col-md-10 col-md-offset-1"><pre>@prepare[select]=SELECT * FROM spark_demo.albums LIMIT ?@prepare[select]=SELECT * FROM spark_demo.artists LIMIT ?</pre></div></div><br/>For the above example, the prepared statement is <strong>"SELECT * FROM spark_demo.albums LIMIT ?"</strong>.<em>"SELECT * FROM spark_demo.artists LIMIT ?"</em> is ignored because an entry already exists in theprepared statements map with the key <strong>select</strong>.<br/><br/>In the context of Zeppelin, a notebook can be scheduled to be executed at regular interval,thus it is necessary to avoid re-preparing many time the same statement (c
 onsidered an anti-pattern).</p><h3>III @bind</h3><br/><p>Once the statement is prepared (possibly in a separated notebook/paragraph). You can bind values to it:<br/><br/><div class="row"><div class="col-md-10 col-md-offset-1"><pre>@bind[select_first]=10</pre></div></div><br/>Bound values are not mandatory for the <strong>@bind</strong> statement.However if you provide bound values, they need to comply to some syntax:<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<a href="http://docs.datastax.com/en/cql/3.1/cql/cql_using/use_collections_c.html" target="_blank">standard CQL syntax</a>:<ul><li>list:  [‘list_item1’, ’list_item2’, ...]</li><li>set:
  {‘set_item1’, ‘set_item2’, …}</li><li>map: {‘key1’: ‘val1’, ‘key2’: ‘val2’, …}</li></ul></li><li>tuple values should be enclosed between parenthesis(see <a href="http://docs.datastax.com/en/cql/3.1/cql/cql_reference/tupleType.html" target="_blank">tuple CQL syntax</a>):(‘text’, 123, true)</li><li>udt values should be enclosed between brackets(see <a href="http://docs.datastax.com/en/cql/3.1/cql/cql_using/cqlUseUDT.html" target="_blank">udt CQL syntax</a>):{stree_name: ‘Beverly Hills’,  number: 104, zip_code: 90020, state: ‘California’, …}</li></ul><br/><div class="alert alert-info">It is possible to use the <strong>@bind</strong> statement inside a batch: <br/><pre>BEGIN BATCH@bind[insert_user]='jdoe','John DOE'UPDATE users SET age = 27 WHERE login='hsue';APPLY BATCH;</pre></div><br/></p><h3>IV @remove_prepare</h3><br/><p>To avoid for a prepared statement to stay forever in the prepared statement map, you can use the <strong>@remove_prepare
 [statement_name]</strong> syntaxto remove it. Removing a non-existing prepared statement yields no error.</p></div></div></div></div></div><div class="panel panel-default"><div class="panel-heading" role="tab"><h4 class="panel-title"><a role="button" data-toggle="collapse"  aria-expanded="false"><span class="text-info"><strong>Dynamic Forms</strong></span></a></h4></div><div  class="panel-collapse collapse" role="tabpanel"><div class="panel-body"><div class="panel panel-default"><div class="panel-body"><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.<br/><br/>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.<br/><br/>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.<br/><br/>Example:<br/><div class="row"><div class="col-md-10 col-md-offset-1"><pre>#Secondary index on performer styleSELECT name, country, performerFROM spark_demo.performersWHERE name='{{performer=Sheryl Crow|Doof|Fanfarlo|Los Paranoia}}'AND styles CONTAINS '{{style=Rock}}';</pre></div></div><br/>In the above example, the first CQL query will be executed for <em>performer='Sheryl Crow'</em>AND <em>style='Rock'</em>. For subsequent queries, you can change the value directly using the form.Please note that we enclosed the {{ }} block between simple quotes (') because Cassandra expects a String here.We could have also use the <strong>{{style='Rock'}}</strong> syntax but this time, the valuedisplayed on the form is <em>'Rock'</em> and not <em>Rock</em>.<br/><br/><div class="alert alert-info">It is also possible to use dynamic forms for <str
 ong>prepared statements</strong>: <br/><strong>@bind[select]=='{{performer=Sheryl Crow|Doof|Fanfarlo|Los Paranoia}}', '{{style=Rock}}'</strong></div></pre></p></div></div></div></div></div><div class="panel panel-default"><div class="panel-heading" role="tab"><h4 class="panel-title"><a role="button" data-toggle="collapse"  aria-expanded="false"><span class="text-info"><strong>Interpreter Configuration</strong></span></a></h4></div><div  class="panel-collapse collapse" role="tabpanel"><div class="panel-body">The <strong>Cassandra</strong> interpreter comes with some some configuration values for the Java driver:<table class="table table-bordered"><caption><h4>Interpreter Configuration</h4></caption><thead><tr><th>Parameter</th><th>Default Value</th></tr></thead><tbody><tr><td>cassandra.cluster</td><td><strong>Test Cluster</strong></td></tr><tr><td>cassandra.compression.protocol</td><td><strong>NONE</strong>, possible values: LZ4, SNAPPY</td></tr><tr><td>cassandra.credentials.password
 </td><td><strong>none</strong></td></tr><tr><td>cassandra.credentials.username</td><td><strong>none</strong></td></tr><tr><td>cassandra.hosts</td><td><strong>localhost</strong></td></tr><tr><td>cassandra.interpreter.parallelism</td><td><strong>10</strong></td></tr><tr><td>cassandra.keyspace</td><td><strong>system</strong></td></tr><tr><td>cassandra.load.balancing.policy</td><td><strong>DEFAULT</strong>, or a FQCN of a custom class</td></tr><tr><td>cassandra.max.schema.agreement.wait.second</td><td><strong>10</strong></td></tr><tr><td>cassandra.native.port</td><td><strong>9042</strong></td></tr><tr><td>cassandra.pooling.core.connection.per.host.local</td><td><strong>Protocol V2 and below: 2, V3 and above: 1</strong></td></tr><tr><td>cassandra.pooling.core.connection.per.host.remote</td><td><strong>Protocol V2 and below: 1, V3 and above: 1</strong></td></tr><tr><td>cassandra.pooling.heartbeat.interval.seconds</td><td><strong>30</strong></td></tr><tr><td>cassandra.pooling.idle.timeout.
 seconds</td><td><strong>Test Cluster</strong></td></tr><tr><td>cassandra.pooling.max.connection.per.host.local</td><td><strong>Protocol V2 and below: 8, V3 and above: 1</strong></td></tr><tr><td>cassandra.pooling.max.connection.per.host.remote</td><td><strong>Protocol V2 and below: 2, V3 and above: 1</strong></td></tr><tr><td>cassandra.pooling.max.request.per.connection.local</td><td><strong>Protocol V2 and below: 128, V3 and above: 1024</strong></td></tr><tr><td>cassandra.pooling.max.request.per.connection.remote</td><td><strong>Protocol V2 and below: 128, V3 and above: 256</strong></td></tr><tr><td>cassandra.pooling.new.connection.threshold.local</td><td><strong>Protocol V2 and below: 100, V3 and above: 800</strong></td></tr><tr><td>cassandra.pooling.new.connection.threshold.remote</td><td><strong>Protocol V2 and below: 100, V3 and above: 200</strong></td></tr><tr><td>cassandra.pooling.pool.timeout.millisecs</td><td><strong>5000</strong></td></tr><tr><td>cassandra.protocol.version
 </td><td><strong>3</strong></td></tr><tr><td>cassandra.query.default.consistency</td><td><strong>ONE</strong></td></tr><tr><td>cassandra.query.default.fetchSize</td><td><strong>5000</strong></td></tr><tr><td>cassandra.query.default.serial.consistency</td><td><strong>SERIAL</strong></td></tr><tr><td>cassandra.reconnection.policy</td><td><strong>DEFAULT</strong>, or a FQCN of a custom class</td></tr><tr><td>cassandra.retry.policy</td><td><strong>DEFAULT</strong>, or a FQCN of a custom class</td></tr><tr><td>cassandra.socket.connection.timeout.millisecs</td><td><strong>500</strong></td></tr><tr><td>cassandra.socket.read.timeout.millisecs</td><td><strong>12000</strong></td></tr><tr><td>cassandra.socket.tcp.no_delay</td><td><strong>true</strong></td></tr><tr><td>cassandra.speculative.execution.policy</td><td><strong>DEFAULT</strong>, or a FQCN of a custom class</td></tr></tbody></table></div></div></div><div class="panel panel-default"><div class="panel-heading" role="tab"><h4 class="pan
 el-title"><a role="button" data-toggle="collapse"  aria-expanded="false"><span class="text-info"><strong>Shared states</strong></span></a></h4></div><div  class="panel-collapse collapse" role="tabpanel"><div class="panel-body">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 <strong>Future</strong> value in the <strong>InterpreterResult</strong>. It may be an interesting proposal for the <strong>Zeppelin</strong> project.<br/>Another caveat is that the same <strong>com.datastax.driver.core.Session</strong> object is used for <strong>all</strong> notebooks and paragraphs. Consequently, if you use the <em>USE keyspace name;</em> statement to log into a keyspace, it will change the keyspace for <strong>all current users</strong> of the Cassandra interpreter because we only create 1 <strong>com.datastax.driver.core.Session</strong
 > object per instance of <strong>Cassandra</strong> interpreter.<br/>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.<br/>Until <strong>Zeppelin</strong> offers a real multi-users separation, there is a work-around to segregate user environment and states: <em>create different Cassandra interpreter instances</em><br/><ol><li>First go to the <strong>Interpreter</strong> menu and click on the <strong>Create</strong> button</li><li>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</li><li>Click on <strong>Save</strong> to create the new interpreter instance. Now you should be able to see it in the interpreter list</li><li>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</li></ol></div></div></div><div class="panel panel-default"><div class="panel-heading" role="tab"><h4 class="panel-title"><a role="button" data-toggle="collapse"  aria-expanded="false"><span class="text-info"><strong>Change Log</strong></span></a></h4></div><div  class="panel-collapse collapse" role="tabpanel"><div class="panel-body"><strong>2.0</strong>&nbsp;:<br/><ul><li>Update help menu and add changelog</li><li>Add Support for User Defined Functions, User Defined Aggregates and Materialized Views</li><li>Upgrade Java driver version to <strong>3.0.0-rc1</strong></li></ul><strong>1.0</strong>&nbsp;:<br/><ul><li>Initial version</li></ul></div></div></div><div class="panel panel-default"><div class="panel-heading" role="tab"><h4 class="panel-title"><a role="button" data-toggle="collapse"  aria-expanded
 ="false"><span class="text-info"><strong>Contact &amp; Bugs</strong></span></a></h4></div><div  class="panel-collapse collapse" role="tabpanel"><div class="panel-body">If you encounter a bug for this interpreter, please create a <a href="https://issues.apache.org/jira/browse/ZEPPELIN-382?jql=project%20%3D%20ZEPPELIN" target="_blank"><strong>JIRA</strong></a> ticket and ping me on Twitter at <a href="https://twitter.com/doanduyhai" target="_blank"><strong>@doanduyhai</strong></a></div></div></div></div>
\ No newline at end of file