merge upstream

This commit is contained in:
Jeff Steinmetz 2015-11-21 21:07:12 -08:00
commit 5888360f5a
180 changed files with 4997 additions and 1820 deletions

2
.gitignore vendored
View file

@ -17,6 +17,7 @@ conf/interpreter.json
# other generated files
spark/dependency-reduced-pom.xml
reports
#webapp
zeppelin-web/node_modules
@ -26,7 +27,6 @@ zeppelin-web/.sass-cache
zeppelin-web/bower_components
**nbproject/
**node/
zeppelin-web/reports/coverage
# project level

View file

@ -30,10 +30,10 @@ before_script:
script:
# spark 1.5
- mvn package -Pbuild-distr -Phadoop-2.3 -Ppyspark -B
- ./testing/startSparkCluster.sh 1.5.1 2.3
- echo "export SPARK_HOME=`pwd`/spark-1.5.1-bin-hadoop2.3" > conf/zeppelin-env.sh
- ./testing/startSparkCluster.sh 1.5.2 2.3
- echo "export SPARK_HOME=`pwd`/spark-1.5.2-bin-hadoop2.3" > conf/zeppelin-env.sh
- mvn verify -Pusing-packaged-distr -Phadoop-2.3 -Ppyspark -B
- ./testing/stopSparkCluster.sh 1.5.1 2.3
- ./testing/stopSparkCluster.sh 1.5.2 2.3
# spark 1.4
- rm -rf `pwd`/interpreter/spark
- mvn package -DskipTests -Pspark-1.4 -Phadoop-2.3 -Ppyspark -B -pl 'zeppelin-interpreter,spark-dependencies,spark'

82
LICENSE
View file

@ -210,68 +210,38 @@
subcomponents is subject to the terms and conditions of the following
licenses.
For the PostgreSQL JDBC driver jar file:
Copyright (c) 1997-2011, PostgreSQL Global Development Group
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the PostgreSQL Global Development Group nor the names
of its contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
This product contains webfonts from 'Font Awesome', which can be obtains at:
* LICENSE:
* SIL OFL 1.1 (http://scripts.sil.org/OFL)
* HOMEPAGE:
* http://fortawesome.github.io/Font-Awesome/
This product contains a stylesheet from 'Font Awesome', which can be obtains at:
========================================================================
The Open Font License
========================================================================
* LICENSE:
* MIT License (http://opensource.org/licenses/mit-license.html)
* HOMEPAGE:
* http://fortawesome.github.io/Font-Awesome/
The following components are provided under the Open Font License. See project link for details.
The text of each license is also included at licenses/LICENSE-[project]-[version].txt.
(OFT 1.1) Font Awesome v4.2.0 (http://fortawesome.github.io/Font-Awesome/) - http://scripts.sil.org/OFL
========================================================================
MIT licenses
========================================================================
The following components are provided under the MIT License. See project link for details.
The text of each license is also included at licenses/LICENSE-[project]-[version].txt.
(The MIT License) Font Awesome (stylesheet) 4.2.0 (http://fortawesome.github.io/Font-Awesome/) - https://fortawesome.github.io/Font-Awesome/license/
(The MIT License) Simple line icons v1.0.0 (http://thesabbir.github.io/simple-line-icons/) - https://github.com/thesabbir/simple-line-icons/tree/1.0.0
(The MIT License) jekyll-bootstrap 0.3.0 (https://github.com/plusjade/jekyll-bootstrap) - https://github.com/plusjade/jekyll-bootstrap
(The MIT License) jekyll 1.3.0 (http://jekyllrb.com/) - https://github.com/jekyll/jekyll/blob/v1.3.0/LICENSE
This product contains embeddable code editor 'Ace', which can be obtains at:
========================================================================
Apache licenses
========================================================================
* LICENSE:
* BSD (https://github.com/ajaxorg/ace/blob/master/LICENSE)
Copyright (c) 2010, Ajax.org B.V.
All rights reserved.
* HOMEPAGE:
* http://ace.c9.io/
The following components are provided under the Apache License. See project link for details.
The text of each license is also included at licenses/LICENSE-[project]-[version].txt.
This product contains 'Simple line icons', which can be obtains at:
* LICENSE:
* MIT License (http://opensource.org/licenses/mit-license.html)
* HOMEPAGE:
* http://thesabbir.github.io/simple-line-icons/
(Apache 2.0) Bootstrap v3.0.2 (http://getbootstrap.com/) - https://github.com/twbs/bootstrap/blob/v3.0.2/LICENSE

View file

@ -30,21 +30,23 @@ If you don't have requirements prepared, install it.
```
sudo apt-get update
sudo apt-get install openjdk-7-jdk
sudo apt-get install git
sudo apt-get install maven
sudo apt-get install nodejs
sudo apt-get install openjdk-7-jdk
sudo apt-get install npm
sudo ln -s /usr/bin/nodejs /usr/bin/node
sudo apt-get install libfontconfig
# install maven
wget http://www.eu.apache.org/dist/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.tar.gz
sudo tar -zxf apache-maven-3.3.3-bin.tar.gz -C /usr/local/
sudo ln -s /usr/local/apache-maven-3.3.3/bin/mvn /usr/local/bin/mvn
```
_Note:_
Ensure node is installed by running `node --version`
Ensure maven is running version 3.1.x or higher with `mvn -version`
_Notes:_
- Ensure node is installed by running `node --version`
- Ensure maven is running version 3.1.x or higher with `mvn -version`
### Build
If you want to build Zeppelin from the source, please first clone this repository. And then:
If you want to build Zeppelin from the source, please first clone this repository, then:
```
mvn clean package -DskipTests
@ -52,15 +54,19 @@ mvn clean package -DskipTests
To build with a specific Spark version, Hadoop version or specific features, define one or more of the `spark`, `pyspark`, `hadoop` and `yarn` profiles, such as:
```
-Pspark-1.5 [Version to run in local spark mode]
-Ppyspark [optional: enable PYTHON support in spark via the %pyspark interpreter]
-Pyarn [optional: enable YARN support]
-Dhadoop.version=2.2.0 [hadoop distribution]
-Phadoop-2.2 [hadoop version]
```
The current default build command runs as:
Currently, final/full distributions run with:
```
mvn clean package -Pspark-1.5 -Phadoop-2.4 -Pyarn -Ppyspark
```
Spark 1.5.x
@ -92,6 +98,26 @@ CDH 5.X
```
mvn clean package -Pspark-1.2 -Dhadoop.version=2.5.0-cdh5.3.0 -Phadoop-2.4 -DskipTests
```
For the MapR Hadoop Distribution, these profiles will handle the Hadoop version. As MapR allows different versions
of Spark to be installed, you should specify which version of Spark is installed on the cluster by adding a Spark profile (-Pspark-1.2, -Pspark-1.3, etc.) as needed. For Hive, check the hive/pom.xml and adjust the version installed as well. The correct Maven
artifacts can be found for every version of MapR at http://doc.mapr.com
MapR 3.x
```
mvn clean package -Pmapr3 -DskipTests
```
MapR 4.0.x
```
mvn clean package -Pmapr40 -DskipTests
```
MapR 4.1
```
mvn clean package -Pmapr41 -DskipTests
```
MapR 5.0
```
mvn clean package -Pmapr50 -DskipTests
```
Yarn (Hadoop 2.7.x)
```
@ -124,6 +150,33 @@ Ignite (1.1.0-incubating and later)
mvn clean package -Dignite.version=1.1.0-incubating -DskipTests
```
Spark-Cassandra integration (Spark 1.1.x)
```
mvn clean package -Pcassandra-spark-1.1 -Dhadoop.version=2.6.0 -Phadoop-2.6 -DskipTests
```
Spark-Cassandra integration (Spark 1.2.x)
```
mvn clean package -Pcassandra-spark-1.2 -Dhadoop.version=2.6.0 -Phadoop-2.6 -DskipTests
```
Spark-Cassandra integration (Spark 1.3.x)
```
mvn clean package -Pcassandra-spark-1.3 -Dhadoop.version=2.6.0 -Phadoop-2.6 -DskipTests
```
Spark-Cassandra integration (Spark 1.4.x)
```
mvn clean package -Pcassandra-spark-1.4 -Dhadoop.version=2.6.0 -Phadoop-2.6 -DskipTests
```
Spark-Cassandra integration (Spark 1.5.x)
```
mvn clean package -Pcassandra-spark-1.5 -Dhadoop.version=2.6.0 -Phadoop-2.6 -DskipTests
```
### Configure
If you wish to configure Zeppelin option (like port number), configure the following files:
@ -171,7 +224,7 @@ Yarn
For configuration details check __./conf__ subdirectory.
### Package
To package the final distribution includint the compressed archive, run:
To package the final distribution including the compressed archive, run:
mvn clean package -Pbuild-distr

View file

@ -79,7 +79,7 @@ if [[ "${INTERPRETER_ID}" == "spark" ]]; then
ZEPPELIN_CLASSPATH=${SPARK_APP_JAR}
export PYTHONPATH="$SPARK_HOME/python/:$PYTHONPATH"
export PYTHONPATH="$SPARK_HOME/python/lib/py4j-0.8.2.1-src.zip:$PYTHONPATH"
export PYTHONPATH="$SPARK_HOME/python/lib/py4j-0.8.2.1-src.zip:$PYTHONPATH"
else
# add Hadoop jars into classpath
if [[ -n "${HADOOP_HOME}" ]]; then
@ -121,9 +121,9 @@ fi
CLASSPATH+=":${ZEPPELIN_CLASSPATH}"
if [[ -n "${SPARK_SUBMIT}" ]]; then
${SPARK_SUBMIT} --class ${ZEPPELIN_SERVER} --driver-class-path "${CLASSPATH}" --driver-java-options "${JAVA_INTP_OPTS}" ${SPARK_SUBMIT_OPTIONS} ${SPARK_APP_JAR} ${PORT} &
${SPARK_SUBMIT} --class ${ZEPPELIN_SERVER} --driver-class-path "${ZEPPELIN_CLASSPATH_OVERRIDES}:${CLASSPATH}" --driver-java-options "${JAVA_INTP_OPTS}" ${SPARK_SUBMIT_OPTIONS} ${SPARK_APP_JAR} ${PORT} &
else
${ZEPPELIN_RUNNER} ${JAVA_INTP_OPTS} -cp ${CLASSPATH} ${ZEPPELIN_SERVER} ${PORT} &
${ZEPPELIN_RUNNER} ${JAVA_INTP_OPTS} -cp ${ZEPPELIN_CLASSPATH_OVERRIDES}:${CLASSPATH} ${ZEPPELIN_SERVER} ${PORT} &
fi
pid=$!

View file

@ -169,7 +169,7 @@ function start() {
initialize_default_directories
nohup nice -n $ZEPPELIN_NICENESS $ZEPPELIN_RUNNER $JAVA_OPTS -cp $CLASSPATH $ZEPPELIN_MAIN >> "${ZEPPELIN_OUTFILE}" 2>&1 < /dev/null &
nohup nice -n $ZEPPELIN_NICENESS $ZEPPELIN_RUNNER $JAVA_OPTS -cp $ZEPPELIN_CLASSPATH_OVERRIDES:$CLASSPATH $ZEPPELIN_MAIN >> "${ZEPPELIN_OUTFILE}" 2>&1 < /dev/null &
pid=$!
if [[ -z "${pid}" ]]; then
action_msg "${ZEPPELIN_NAME} start" "${SET_ERROR}"

View file

@ -85,4 +85,4 @@ if [[ ! -d "${ZEPPELIN_NOTEBOOK_DIR}" ]]; then
$(mkdir -p "${ZEPPELIN_NOTEBOOK_DIR}")
fi
$(exec $ZEPPELIN_RUNNER $JAVA_OPTS -cp $CLASSPATH $ZEPPELIN_SERVER "$@")
$(exec $ZEPPELIN_RUNNER $JAVA_OPTS -cp $ZEPPELIN_CLASSPATH_OVERRIDES:$CLASSPATH $ZEPPELIN_SERVER "$@")

View file

@ -31,6 +31,12 @@
<description>Server port.</description>
</property>
<property>
<name>zeppelin.server.context.path</name>
<value>/</value>
<description>Context Path of the Web Application</description>
</property>
<property>
<name>zeppelin.notebook.dir</name>
<value>notebook</value>

View file

@ -103,9 +103,12 @@ function make_binary_release() {
exit 1
fi
# re-create package with proper dir name
# re-create package with proper dir name with binary license
cd zeppelin-distribution/target/zeppelin-*
mv zeppelin-* zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}
cat ../../src/bin_license/LICENSE >> zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}/LICENSE
cat ../../src/bin_license/NOTICE >> zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}/NOTICE
cp ../../src/bin_license/licenses/* zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}/licenses/
${TAR} cvzf zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}.tgz zeppelin-${RELEASE_NAME}-bin-${BIN_RELEASE_NAME}
# sign bin package

View file

@ -1,2 +1,17 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
source 'https://rubygems.org'
gem 'github-pages'

View file

@ -56,3 +56,6 @@ PLATFORMS
DEPENDENCIES
github-pages
BUNDLED WITH
1.10.4

View file

@ -1,11 +1,9 @@
## Zeppelin project website
Welcome to the Zeppelin documentation!
## Zeppelin documentation
This readme will walk you through building the Zeppelin documentation, which is included here with the Zeppelin source code.
## Build website
## Build documentation
See https://help.github.com/articles/using-jekyll-with-pages#installing-jekyll
**tl;dr version:**
@ -32,9 +30,18 @@ See https://help.github.com/articles/using-jekyll-with-pages#installing-jekyll
```
svn co https://svn.apache.org/repos/asf/incubator/zeppelin asf-zepplelin
```
3. copy zeppelin/_site to asf-zepplelin/site
3. copy zeppelin/_site to asf-zepplelin/site/docs/[VERSION]
4. ```svn commit```
## Adding a new page
rake page name="new-page.md"
## Bumping up version
* `BASE_PATH` property in _config.yml
* `ZEPPELIN <small>([VERSION])</small>` in _includes/themes/zeppelin/_navigation.html
need to be updated

View file

@ -14,7 +14,7 @@ title : Apache Zeppelin (incubating)
tagline: Simplify bigdata analytics
author :
name : The Apache Software Foundation
email : contacts@nflabs.com
email : dev@zeppelin.incubator.apache.org
github : apache
twitter : ASF
feedburner : feedname
@ -55,7 +55,7 @@ JB :
# - Only the following values are falsy: ["", null, false]
# - When setting BASE_PATH it must be a valid url.
# This means always setting the protocol (http|https) or prefixing with "/"
BASE_PATH : false
BASE_PATH : /docs/0.6.0-incubating-SNAPSHOT
# By default, the asset_path is automatically defined relative to BASE_PATH plus the enabled theme.
# ex: [BASE_PATH]/assets/themes/[THEME-NAME]

View file

@ -9,7 +9,7 @@
</button>
<a class="navbar-brand" href="/">
<img src="/assets/themes/zeppelin/img/zeppelin_logo.png" width="50" alt="I'm zeppelin">
Apache Zeppelin <small>(incubating)</small>
Zeppelin <small>(0.6.0-incubating-SNAPSHOT)</small>
</a>
</div>
<nav class="navbar-collapse collapse" role="navigation">
@ -22,31 +22,7 @@
{% assign pages_list = site.pages %}
{% assign group = 'nav-right' %}
{% include JB/pages_list %}
<li><a href="https://github.com/apache/incubator-zeppelin">GitHub</a></li>
<li id="apache">
<a href="#" data-toggle="dropdown" class="dropdown-toggle">Apache<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="http://www.apache.org/foundation/how-it-works.html">Apache Software Foundation</a></li>
<li><a href="http://www.apache.org/licenses/">Apache License</a></li>
<li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
</ul>
</li>
</ul>
</nav><!--/.navbar-collapse -->
</div>
</div>
{% if page.title == "Zeppelin" %}
<div class="jumbotron">
<div class="container">
<h1>Apache Zeppelin <small>(incubating)</small></h1>
<p>A web-based notebook that enables interactive data analytics. <br/>
You can make beautiful data-driven, interactive and collaborative documents with SQL, Scala and more.
</p>
<p><a href="http://youtu.be/_PQbVH_aO5E" target="_zeppelinVideo" class="btn btn-primary btn-lg bigFingerButton" role="button">Watch the video</a>
<a href="./download.html" class="btn btn-primary btn-lg bigFingerButton" role="button">Get Zeppelin</a></p>
</div>
</div>
{% endif %}

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View file

@ -1,65 +0,0 @@
/* Custom container */
.container-narrow {
margin: 0 auto;
max-width: 700px; }
.container-narrow > hr {
margin: 30px 0; }
.navbar .nav {
float: right; }
/* posts index */
.post > h3.title {
position: relative;
padding-top: 10px; }
.post > h3.title span.date {
position: absolute;
right: 0;
font-size: 0.9em; }
.post > .more {
margin: 10px 0;
text-align: left; }
/* post-full*/
.post-full .date {
margin-bottom: 20px;
font-weight: bold; }
/* tag_box */
.tag_box {
list-style: none;
margin: 0;
overflow: hidden; }
.tag_box li {
line-height: 28px; }
.tag_box li i {
opacity: 0.9; }
.tag_box.inline li {
float: left; }
.tag_box a {
padding: 3px 6px;
margin: 2px;
background: #eee;
color: #555;
border-radius: 3px;
text-decoration: none;
border: 1px dashed #cccccc; }
.tag_box a span {
vertical-align: super;
font-size: 0.8em; }
.tag_box a:hover {
background-color: #e5e5e5; }
.tag_box a.active {
background: #57A957;
border: 1px solid #4c964d;
color: #FFF; }

View file

@ -305,7 +305,8 @@ body {
}
.navbar-brand small {
font-size: 60%;
font-size: 14px;
font-family: 'Helvetica Neue', Helvetica;
color: #FFF; }
.navbar-collapse.collapse {

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View file

@ -1,20 +0,0 @@
---
layout: page
title: "Community"
description: ""
group: nav-right
---
{% include JB/setup %}
### Mailing list
Get help using Zeppelin or contribute to the project on our mailing lists:
* [users@zeppelin.incubator.apache.org](http://mail-archives.apache.org/mod_mbox/incubator-zeppelin-users/) is for usage questions, help, and announcements. [subscribe](mailto:users-subscribe@zeppelin.incubator.apache.org?subject=send this email to subscribe), [unsubscribe](mailto:users-unsubscribe@zeppelin.incubator.apache.org?subject=send this email to unsubscribe), [archives](http://mail-archives.apache.org/mod_mbox/incubator-zeppelin-users/)
* [dev@zeppelin.incubator.apache.org](http://mail-archives.apache.org/mod_mbox/incubator-zeppelin-dev/) is for people who want to contribute code to Zeppelin. [subscribe](mailto:dev-subscribe@zeppelin.incubator.apache.org?subject=send this email to subscribe), [unsubscribe](mailto:dev-unsubscribe@zeppelin.incubator.apache.org?subject=send this email to unsubscribe), [archives](http://mail-archives.apache.org/mod_mbox/incubator-zeppelin-dev/)
* [commits@zeppelin.incubator.apache.org](http://mail-archives.apache.org/mod_mbox/incubator-zeppelin-commits/) is for commit messages and patches to Zeppelin. [subscribe](mailto:commits-subscribe@zeppelin.incubator.apache.org?subject=send this email to subscribe), [unsubscribe](mailto:commits-unsubscribe@zeppelin.incubator.apache.org?subject=send this email to unsubscribe), [archives](http://mail-archives.apache.org/mod_mbox/incubator-zeppelin-commits/)
### Issue tracker
[https://issues.apache.org/jira/browse/ZEPPELIN](https://issues.apache.org/jira/browse/ZEPPELIN)

View file

@ -4,6 +4,19 @@ title: "Writing Zeppelin Interpreter"
description: ""
group: development
---
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
{% include JB/setup %}
### What is Zeppelin Interpreter
@ -12,7 +25,7 @@ Zeppelin Interpreter is a language backend. For example to use scala code in Zep
Every Interpreter belongs to an InterpreterGroup. InterpreterGroup is a unit of start/stop interpreter.
Interpreters in the same InterpreterGroup can reference each other. For example, SparkSqlInterpreter can reference SparkInterpreter to get SparkContext from it while they're in the same group.
<img class="img-responsive" style="width:50%; border: 1px solid #ecf0f1;" height="auto" src="../../assets/themes/zeppelin/img/interpreter.png" />
<img class="img-responsive" style="width:50%; border: 1px solid #ecf0f1;" height="auto" src="/assets/themes/zeppelin/img/interpreter.png" />
All Interpreters in the same interpreter group are launched in a single, separate JVM process. The Interpreter communicates with Zeppelin engine via thrift.

View file

@ -4,6 +4,19 @@ title: "Angular Display System"
description: ""
group: display
---
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
{% include JB/setup %}
@ -19,7 +32,7 @@ Therefore, you can not only update scope variable from your interpreter but also
#### Print AngularJS view
To use angular display system, your output should starts with "%angular".
<img src="../../assets/themes/zeppelin/img/screenshots/display_angular.png" width=600px />
<img src="/assets/themes/zeppelin/img/screenshots/display_angular.png" width=600px />
Note that display system is backend independent.
@ -40,16 +53,16 @@ z.angularBind(String name, Object object)
z.angularBindGlobal(String name, Object object)
// unbind angular scope variable 'name' in current notebook.
z.angularBind(String name)
z.angularUnbind(String name)
// unbind angular scope variable 'name' in all notebooks related to current interpreter.
z.angularBindGlobal(String name)
z.angularUnbindGlobal(String name)
```
In the example, let's bind "world" variable 'name'. Then you can see AngularJs view are updated immediately.
<img src="../../assets/themes/zeppelin/img/screenshots/display_angular1.png" width=600px />
<img src="/assets/themes/zeppelin/img/screenshots/display_angular1.png" width=600px />
<br />
@ -78,8 +91,8 @@ z.angularUnwatchGlobal(String name)
Let's make an button, that increment 'run' variable by 1 when it is clicked.
z.angularBind("run", 0) will initialize 'run' to zero. And then register watcher of 'run'.
<img src="../../assets/themes/zeppelin/img/screenshots/display_angular2.png" width=600px />
<img src="/assets/themes/zeppelin/img/screenshots/display_angular2.png" width=600px />
After clicked button, you'll see both 'run' and numWatched are increased by 1
<img src="../../assets/themes/zeppelin/img/screenshots/display_angular3.png" width=600px />
<img src="/assets/themes/zeppelin/img/screenshots/display_angular3.png" width=600px />

View file

@ -0,0 +1,45 @@
---
layout: page
title: "Text/Html Display System"
description: ""
group: display
---
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
{% include JB/setup %}
<a name="text"> </a>
<br />
<br />
### Text
Zeppelin prints output of language backend in text, by default.
<img src="/assets/themes/zeppelin/img/screenshots/display_text.png" />
You can explicitly say you're using text display system.
<img src="/assets/themes/zeppelin/img/screenshots/display_text1.png" />
Note that display system is backend independent.
<a name="html"> </a>
<br />
<br />
### Html
With '%html' directive, Zeppelin treats your output as html
<img src="/assets/themes/zeppelin/img/screenshots/display_html.png" />

View file

@ -0,0 +1,37 @@
---
layout: page
title: "Table Display System"
description: ""
group: display
---
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
{% include JB/setup %}
### Table
If you have data that row seprated by '\n' (newline) and column separated by '\t' (tab) with first row as header row, for example
<img src="/assets/themes/zeppelin/img/screenshots/display_table.png" />
You can simply use %table display system to leverage Zeppelin's built in visualization.
<img src="/assets/themes/zeppelin/img/screenshots/display_table1.png" />
Note that display system is backend independent.
If table contents start with %html, it is interpreted as an HTML.
<img src="/assets/themes/zeppelin/img/screenshots/display_table_html.png" />

View file

@ -4,6 +4,19 @@ title: "Docs"
description: ""
group: nav-right
---
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
{% include JB/setup %}
### Install
@ -19,16 +32,20 @@ group: nav-right
**[Interpreters in zeppelin](manual/interpreters.html)**
* [cassandra](./interpreter/cassandra.html)
* [flink](./interpreter/flink.html)
* [hive](../docs/pleasecontribute.html)
* [ignite](../docs/pleasecontribute.html)
* [lens](./interpreter/lens.html)
* [md](../docs/pleasecontribute.html)
* [sh](../docs/pleasecontribute.html)
* [spark](./interpreter/spark.html)
* [tajo](../docs/pleasecontribute.html)
* [postgresql, hawq](./interpreter/postgresql.html)
* [geode](./interpreter/geode.html)
* [hive](./pleasecontribute.html)
* [ignite](./interpreter/ignite.html)
* [lens](./interpreter/lens.html)
* [md](./pleasecontribute.html)
* [postgresql, hawq](./interpreter/postgresql.html)
* [sh](./pleasecontribute.html)
* [spark](./interpreter/spark.html)
* [tajo](./pleasecontribute.html)
### Storage
* [S3 Storage](./storage/storage.html)
### Display System

View file

@ -1,32 +0,0 @@
---
layout: page
title: "Text/Html Display System"
description: ""
group: display
---
{% include JB/setup %}
<a name="text"> </a>
<br />
<br />
### Text
Zeppelin prints output of language backend in text, by default.
<img src="../../assets/themes/zeppelin/img/screenshots/display_text.png" />
You can explicitly say you're using text display system.
<img src="../../assets/themes/zeppelin/img/screenshots/display_text1.png" />
Note that display system is backend independent.
<a name="html"> </a>
<br />
<br />
### Html
With '%html' directive, Zeppelin treats your output as html
<img src="../../assets/themes/zeppelin/img/screenshots/display_html.png" />

View file

@ -1,24 +0,0 @@
---
layout: page
title: "Table Display System"
description: ""
group: display
---
{% include JB/setup %}
### Table
If you have data that row seprated by '\n' (newline) and column separated by '\t' (tab) with first row as header row, for example
<img src="../../assets/themes/zeppelin/img/screenshots/display_table.png" />
You can simply use %table display system to leverage Zeppelin's built in visualization.
<img src="../../assets/themes/zeppelin/img/screenshots/display_table1.png" />
Note that display system is backend independent.
If table contents start with %html, it is interpreted as an HTML.
<img src="../../assets/themes/zeppelin/img/screenshots/display_table_html.png" />

View file

@ -1,129 +0,0 @@
---
layout: page
title: "Install Zeppelin"
description: ""
group: install
---
{% include JB/setup %}
## Build
#### Prerequisites
* Java 1.7
* None root account
* Apache Maven
Build tested on OSX, CentOS 6.
Checkout source code from [https://github.com/apache/incubator-zeppelin](https://github.com/apache/incubator-zeppelin)
#### Local mode
```
mvn install -DskipTests
```
#### Cluster mode
```
mvn install -DskipTests -Dspark.version=1.1.0 -Dhadoop.version=2.2.0
```
Change spark.version and hadoop.version to your cluster's one.
#### Custom built Spark
Note that is you uses custom build spark, you need build Zeppelin with custome built spark artifact. To do that, deploy spark artifact to local maven repository using
```
sbt/sbt publish-local
```
and then build Zeppelin with your custom built Spark
```
mvn install -DskipTests -Dspark.version=1.1.0-Custom -Dhadoop.version=2.2.0
```
## Configure
Configuration can be done by both environment variable(conf/zeppelin-env.sh) and java properties(conf/zeppelin-site.xml). If both defined, environment vaiable is used.
<table class="table-configuration">
<tr>
<th>zepplin-env.sh</th>
<th>zepplin-site.xml</th>
<th>Default value</th>
<th>Description</th>
</tr>
<tr>
<td>ZEPPELIN_PORT</td>
<td>zeppelin.server.port</td>
<td>8080</td>
<td>Zeppelin server port. Note that port+1 is used for web socket</td>
</tr>
<tr>
<td>ZEPPELIN_NOTEBOOK_DIR</td>
<td>zeppelin.notebook.dir</td>
<td>notebook</td>
<td>Where notebook file is saved</td>
</tr>
<tr>
<td>ZEPPELIN_INTERPRETERS</td>
<td>zeppelin.interpreters</td>
<description></description>
<td>org.apache.zeppelin.spark.SparkInterpreter,<br />org.apache.zeppelin.spark.PySparkInterpreter,<br />org.apache.zeppelin.spark.SparkSqlInterpreter,<br />org.apache.zeppelin.spark.DepInterpreter,<br />org.apache.zeppelin.markdown.Markdown,<br />org.apache.zeppelin.shell.ShellInterpreter,<br />org.apache.zeppelin.hive.HiveInterpreter</td>
<td>Comma separated interpreter configurations [Class]. First interpreter become a default</td>
</tr>
<tr>
<td>ZEPPELIN_INTERPRETER_DIR</td>
<td>zeppelin.interpreter.dir</td>
<td>interpreter</td>
<td>Zeppelin interpreter directory</td>
</tr>
<tr>
<td>MASTER</td>
<td></td>
<td>N/A</td>
<td>Spark master url. eg. spark://master_addr:7077. Leave empty if you want to use local mode</td>
</tr>
<tr>
<td>ZEPPELIN_JAVA_OPTS</td>
<td></td>
<td>N/A</td>
<td>JVM Options</td>
</table>
#### Add jars, files
spark.jars, spark.files property in *ZEPPELIN\_JAVA\_OPTS* adds jars, files into SparkContext.
for example,
ZEPPELIN_JAVA_OPTS="-Dspark.jars=/mylib1.jar,/mylib2.jar -Dspark.files=/myfile1.dat,/myfile2.dat"
or you can do it dynamically with [dependency loader](../interpreter/spark.html#dependencyloading)
## Start/Stop
#### Start Zeppelin
```
bin/zeppelin-daemon.sh start
```
After successful start, visit http://localhost:8080 with your web browser.
Note that port **8081** also need to be accessible for websocket connection.
#### Stop Zeppelin
```
bin/zeppelin-daemon.sh stop
```

View file

@ -1,65 +0,0 @@
---
layout: page
title: "Dynamic Form"
description: ""
group: manual
---
{% include JB/setup %}
## Dynamic Form
Zeppelin dynamically creates input forms. Depending on language backend, there're two different ways to create dynamic form.
Custom language backend can select which type of form creation it wants to use.
<br />
### Using form Templates
This mode creates form using simple template language. It's simple and easy to use. For example Markdown, Shell, SparkSql language backend uses it.
<br />
#### Text input form
To create text input form, use _${formName}_ templates.
for example
<img src="../../assets/themes/zeppelin/img/screenshots/form_input.png" />
Also you can provide default value, using _${formName=defaultValue}_.
<img src="../../assets/themes/zeppelin/img/screenshots/form_input_default.png" />
<br />
#### Select form
To create select form, use _${formName=defaultValue,option1|option2...}_
for example
<img src="../../assets/themes/zeppelin/img/screenshots/form_select.png" />
Also you can separate option's display name and value, using _${formName=defaultValue,option1(DisplayName)|option2(DisplayName)...}_
<img src="../../assets/themes/zeppelin/img/screenshots/form_select_displayname.png" />
<br />
### Creates Programmatically
Some language backend uses programmatic way to create form. For example [ZeppelinContext](./interpreter/spark.html#zeppelincontext) provides form creation API
Here're some examples.
Text input form
<img src="../../assets/themes/zeppelin/img/screenshots/form_input_prog.png" />
Text input form with default value
<img src="../../assets/themes/zeppelin/img/screenshots/form_input_default_prog.png" />
Select form
<img src="../../assets/themes/zeppelin/img/screenshots/form_select_prog.png" />

View file

@ -1,15 +0,0 @@
---
layout: page
title: "Please contribute"
description: ""
group: development
---
{% include JB/setup %}
### Waiting for your help
The content does not exist yet.
We're always welcoming contribution.
If you're interested, please check [How to contribute (website)](./development/howtocontributewebsite.html).

View file

@ -1,64 +0,0 @@
---
layout: page
title: "Zeppelin Release 0.5.0-incubating"
description: ""
group: release
---
{% include JB/setup %}
### Zeppelin Release 0.5.0-incubating
Zeppelin 0.5.0-incubating is the first release under Apache incubation, with contributions from 42 developers and more than 600 commits.
To download Zeppelin 0.5.0-incubating visit the [download](../../download.html) page.
You can visit [issue tracker](https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12316221&version=12329850) for full list of issues being resolved.
### Contributors
The following developers contributed to this release:
* Akshat Aranya - New features and Improvements in UI.
* Alexander Bezzubov -Improvements and Bug fixes in Core, UI, Build system. New feature and Improvements in Spark interpreter. Documentation in roadmap.
* Anthony Corbacho - Improvements in Website. Bug fixes Build system. Improvements and Bug fixes in UI. Documentation in roadmap.
* Brennon York - Improvements and Bug fixes in Build system.
* CORNEAU Damien - New feature, Improvements and Bug fixes in UI and Build system.
* Corey Huang - Improvements in Build system. New feature in Core.
* Digeratus - Improvements in Tutorials.
* Dimitrios Liapis - Improvements in Documentation.
* DuyHai DOAN - New feature in Build system.
* Emmanuelle Raffenne - Bug fixes in UI.
* Eran Medan - Improvements in Documentation.
* Eugene Morozov - Bug fixes in Core.
* Felix Cheung - Improvements in Spark interpreter. Improvements in Documentation. New features, Improvements and Bug fixes in UI.
* Hung Lin - Improvements in Core.
* Hyungu Roh - Bug fixes in UI.
* Ilya Ganelin - Improvements in Tutorials.
* JaeHwa Jung - New features in Tajo interpreter.
* Jakob Homan - Improvements in Website.
* James Carman - Improvements in Build system.
* Jongyoul Lee - Improvements in Core, Build system and Spark interpreter. Bug fixes in Spark Interpreter. New features in Build system and Spark interpreter. Improvements in Documentation.
* Juarez Bochi - Bug fixes in Build system.
* Julien Buret - Bug fixes in Spark interpreter.
* Jérémy Subtil - Bug fixes in Build system.
* Kevin (SangWoo) Kim - New features in Core, Tutorials. Improvements in Documentation. New features, Improvements and Bug fixes in UI.
* Kyoung-chan Lee - Improvements in Documentation.
* Lee moon soo - Improvements in Tutorials. New features, Improvements and Bug fixes in Core, UI, Build system and Spark interpreter. New features in Flink interpreter. Improvments in Documentation.
* Mina Lee - Improvements and Bug fixes in UI. New features in UI. Improvements in Core, Website.
* Rajat Gupta - Bug fixes in Spark interpreter.
* Ram Venkatesh - Improvements in Core, Build system, Spark interpreter and Markdown interpreter. New features and Bug fixes in Hive interpreter.
* Sebastian YEPES - Improvements in Core.
* Seckin Savasci - Improvements in Build system.
* Timothy Shelton - Bug fixes in UI.
* Vincent Botta - New features in UI.
* Young boom - Improvements in UI.
* bobbych - Improvements in Spark interpreter.
* debugger87 - Bug fixes in Core.
* dobachi - Improvements in UI.
* epahomov - Improvements in Core and Spark interpreter.
* kevindai0126 - Improvements in Core.
* rahul agarwal - Bug fixes in Core.
* whisperstream - Improvements in Spark interpreter.
* yundai - Improvements in Core.
Thanks to everyone who made this release possible!

View file

@ -1 +0,0 @@
{"status":"CREATED","message":"","body":{"id":"2AYW25ANY","name":"md2","group":"md","properties":{"propname":"propvalue"},"interpreterGroup":[{"class":"org.apache.zeppelin.markdown.Markdown","name":"md"}]}}

View file

@ -1 +0,0 @@
{"name":"md2","group":"md","properties":{"propname":"propvalue"},"interpreterGroup":[{"class":"org.apache.zeppelin.markdown.Markdown","name":"md"}]}

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
{"status":"OK","message":"","body":[{"id":"2AY6GV7Q3","name":"spark","group":"spark","properties":{"spark.cores.max":"","spark.yarn.jar":"","master":"local[*]","zeppelin.spark.maxResult":"1000","zeppelin.dep.localrepo":"local-repo","spark.app.name":"Zeppelin","spark.executor.memory":"512m","zeppelin.spark.useHiveContext":"true","args":"","spark.home":"","zeppelin.spark.concurrentSQL":"false","zeppelin.pyspark.python":"python"},"interpreterGroup":[{"class":"org.apache.zeppelin.spark.SparkInterpreter","name":"spark"},{"class":"org.apache.zeppelin.spark.PySparkInterpreter","name":"pyspark"},{"class":"org.apache.zeppelin.spark.SparkSqlInterpreter","name":"sql"},{"class":"org.apache.zeppelin.spark.DepInterpreter","name":"dep"}]},{"id":"2AYUGP2D5","name":"md","group":"md","properties":{"":""},"interpreterGroup":[{"class":"org.apache.zeppelin.markdown.Markdown","name":"md"}]},{"id":"2AWBZQVB8","name":"angular","group":"angular","properties":{},"interpreterGroup":[{"class":"org.apache.zeppelin.angular.AngularInterpreter","name":"angular"}]},{"id":"2AWSES8Z8","name":"sh","group":"sh","properties":{},"interpreterGroup":[{"class":"org.apache.zeppelin.shell.ShellInterpreter","name":"sh"}]},{"id":"2AWTCSXEX","name":"hive","group":"hive","properties":{"hive.hiveserver2.url":"jdbc:hive2://localhost:10000","hive.hiveserver2.password":"","hive.hiveserver2.user":"hive"},"interpreterGroup":[{"class":"org.apache.zeppelin.hive.HiveInterpreter","name":"hql"}]}]}

View file

@ -1 +0,0 @@
{"status":"OK","message":"","body":{"id":"2AYW25ANY","name":"md2","group":"md","properties":{"propname":"Otherpropvalue"},"interpreterGroup":[{"class":"org.apache.zeppelin.markdown.Markdown","name":"md"}]}}

View file

@ -1 +0,0 @@
{"name":"md2","group":"md","properties":{"propname":"Otherpropvalue"},"interpreterGroup":[{"class":"org.apache.zeppelin.markdown.Markdown","name":"md"}]}

View file

@ -1 +0,0 @@
{"status": "CREATED","message": "","body": "2AZPHY918"}

View file

@ -1 +0,0 @@
{"name": "name of new notebook"}

View file

@ -1 +0,0 @@
{"status":"OK","message":""}

View file

@ -1,74 +0,0 @@
---
layout: page
title: "Download"
description: ""
group: nav-right
---
{% include JB/setup %}
### Download Zeppelin
The latest release of Apache Zeppelin (incubating) is *0.5.0-incubating*.
- 0.5.0-incubating released on July 23, 2015 ([release notes](./docs/releases/zeppelin-release-0.5.0-incubating.html)) ([git tag](https://git-wip-us.apache.org/repos/asf?p=incubator-zeppelin.git;a=tag;h=refs/tags/v0.5.0))
* Source:
<a style="cursor:pointer" onclick="ga('send', 'event', 'download', 'zeppelin-src', '0.5.0-incubating'); window.location.href='http://www.apache.org/dyn/closer.cgi/incubator/zeppelin/0.5.0-incubating/zeppelin-0.5.0-incubating.tgz'">zeppelin-0.5.0-incubating.tgz</a>
([pgp](https://www.apache.org/dist/incubator/zeppelin/0.5.0-incubating/zeppelin-0.5.0-incubating.tgz.asc),
[md5](https://www.apache.org/dist/incubator/zeppelin/0.5.0-incubating/zeppelin-0.5.0-incubating.tgz.md5),
[sha](https://www.apache.org/dist/incubator/zeppelin/0.5.0-incubating/zeppelin-0.5.0-incubating.tgz.sha))
* Binary built with spark-1.4.0 and hadoop-2.3:
<a style="cursor:pointer" onclick="ga('send', 'event', 'download', 'zeppelin-bin', '0.5.0-incubating'); window.location.href='http://www.apache.org/dyn/closer.cgi/incubator/zeppelin/0.5.0-incubating/zeppelin-0.5.0-incubating-bin-spark-1.4.0_hadoop-2.3.tgz'">zeppelin-0.5.0-incubating-bin-spark-1.4.0_hadoop-2.3.tgz</a>
([pgp](https://www.apache.org/dist/incubator/zeppelin/0.5.0-incubating/zeppelin-0.5.0-incubating-bin-spark-1.4.0_hadoop-2.3.tgz.asc),
[md5](https://www.apache.org/dist/incubator/zeppelin/0.5.0-incubating/zeppelin-0.5.0-incubating-bin-spark-1.4.0_hadoop-2.3.tgz.md5),
[sha](https://www.apache.org/dist/incubator/zeppelin/0.5.0-incubating/zeppelin-0.5.0-incubating-bin-spark-1.4.0_hadoop-2.3.tgz.sha))
* Binary built with spark-1.3.1 and hadoop-2.3:
<a style="cursor:pointer" onclick="ga('send', 'event', 'download', 'zeppelin-bin', '0.5.0-incubating'); window.location.href='http://www.apache.org/dyn/closer.cgi/incubator/zeppelin/0.5.0-incubating/zeppelin-0.5.0-incubating-bin-spark-1.3.1_hadoop-2.3.tgz'">zeppelin-0.5.0-incubating-bin-spark-1.3.1_hadoop-2.3.tgz</a>
([pgp](https://www.apache.org/dist/incubator/zeppelin/0.5.0-incubating/zeppelin-0.5.0-incubating-bin-spark-1.3.1_hadoop-2.3.tgz.asc),
[md5](https://www.apache.org/dist/incubator/zeppelin/0.5.0-incubating/zeppelin-0.5.0-incubating-bin-spark-1.3.1_hadoop-2.3.tgz.md5),
[sha](https://www.apache.org/dist/incubator/zeppelin/0.5.0-incubating/zeppelin-0.5.0-incubating-bin-spark-1.3.1_hadoop-2.3.tgz.sha))
### Verify the integrity of the files
It is essential that you [verify](https://www.apache.org/info/verification.html) the integrity of the downloaded files using the PGP or MD5 signatures. This signature should be matched against the [KEYS](https://www.apache.org/dist/incubator/zeppelin/KEYS) file.
### Build from source
For developers, to get latest *0.6.0-incubating-SNAPSHOT* check [install](./docs/install/install.html) section.
<!--
-------------
### Old release
##### Zeppelin-0.3.3 (2014.03.29)
Download <a onclick="ga('send', 'event', 'download', 'zeppelin', '0.3.3');" href="https://s3-ap-northeast-1.amazonaws.com/zeppel.in/zeppelin-0.3.3.tar.gz">zeppelin-0.3.3.tar.gz</a> ([release note](https://zeppelin-project.atlassian.net/secure/ReleaseNote.jspa?projectId=10001&version=10301))
##### Zeppelin-0.3.2 (2014.03.14)
Download <a onclick="ga('send', 'event', 'download', 'zeppelin', '0.3.2');" href="https://s3-ap-northeast-1.amazonaws.com/zeppel.in/zeppelin-0.3.2.tar.gz">zeppelin-0.3.2.tar.gz</a> ([release note](https://zeppelin-project.atlassian.net/secure/ReleaseNote.jspa?projectId=10001&version=10300))
##### Zeppelin-0.3.1 (2014.03.06)
Download <a onclick="ga('send', 'event', 'download', 'zeppelin', '0.3.1');" href="https://s3-ap-northeast-1.amazonaws.com/zeppel.in/zeppelin-0.3.1.tar.gz">zeppelin-0.3.1.tar.gz</a> ([release note](https://zeppelin-project.atlassian.net/secure/ReleaseNote.jspa?projectId=10001&version=10201))
##### Zeppelin-0.3.0 (2014.02.07)
Download <a onclick="ga('send', 'event', 'download', 'zeppelin', '0.3.0');" href="https://s3-ap-northeast-1.amazonaws.com/zeppel.in/zeppelin-0.3.0.tar.gz">zeppelin-0.3.0.tar.gz</a>, ([release note](https://zeppelin-project.atlassian.net/secure/ReleaseNote.jspa?projectId=10001&version=10200))
##### Zeppelin-0.2.0 (2014.01.22)
Download Download <a onclick="ga('send', 'event', 'download', 'zeppelin', '0.2.0');" href="https://s3-ap-northeast-1.amazonaws.com/zeppel.in/zeppelin-0.2.0.tar.gz">zeppelin-0.2.0.tar.gz</a>, ([release note](https://zeppelin-project.atlassian.net/secure/ReleaseNote.jspa?projectId=10001&version=10001))
-->

View file

@ -1,10 +1,24 @@
---
layout: page
title: Zeppelin
title: Overview
tagline: Less Development, More analysis!
group: nav-right
---
{% include JB/setup %}
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
{% include JB/setup %}
<br />
<div class="row">
<div class="col-md-5">
<h2>Multi-purpose Notebook</h2>
@ -20,7 +34,7 @@ tagline: Less Development, More analysis!
</ul>
</div>
<div class="col-md-7"><img class="img-responsive" style="border: 1px solid #ecf0f1;" height="auto" src="assets/themes/zeppelin/img/notebook.png" /></div>
<div class="col-md-7"><img class="img-responsive" style="border: 1px solid #ecf0f1;" height="auto" src="/assets/themes/zeppelin/img/notebook.png" /></div>
</div>
@ -30,22 +44,21 @@ tagline: Less Development, More analysis!
Zeppelin interpreter concept allows any language/data-processing-backend to be plugged into Zeppelin.
Currently Zeppelin supports many interpreters such as Scala(with Apache Spark), Python(with Apache Spark), SparkSQL, Hive, Markdown and Shell.
<img class="img-responsive" src="assets/themes/zeppelin/img/screenshots/multiple_language_backend.png" />
Adding new language-backend is really simple. Learn [how to write a zeppelin interpreter](./docs/development/writingzeppelininterpreter.html).
<img class="img-responsive" src="/assets/themes/zeppelin/img/screenshots/multiple_language_backend.png" />
Adding new language-backend is really simple. Learn [how to write a zeppelin interpreter](./development/writingzeppelininterpreter.html).
<br />
### Apache Spark integration
Zeppelin provides built-in Apache Spark integration. You don't need to build a separate module, plugin or library for it.
<img src="assets/themes/zeppelin/img/spark_logo.jpg" width="80px" />
<img src="/assets/themes/zeppelin/img/spark_logo.jpg" width="80px" />
Zeppelin's Spark integration provides
- Automatic SparkContext and SQLContext injection
- Runtime jar dependency loading from local filesystem or maven repository. Learn more about [dependency loader](./docs/interpreter/spark.html#dependencyloading).
- Runtime jar dependency loading from local filesystem or maven repository. Learn more about [dependency loader](./interpreter/spark.html#dependencyloading).
- Canceling job and displaying its progress
<br />
@ -55,10 +68,10 @@ Some basic charts are already included in Zeppelin. Visualizations are not limit
<div class="row">
<div class="col-md-6">
<img class="img-responsive" src="./assets/themes/zeppelin/img/graph1.png" />
<img class="img-responsive" src="/assets/themes/zeppelin/img/graph1.png" />
</div>
<div class="col-md-6">
<img class="img-responsive" src="./assets/themes/zeppelin/img/graph2.png" />
<img class="img-responsive" src="/assets/themes/zeppelin/img/graph2.png" />
</div>
</div>
@ -68,10 +81,10 @@ With simple drag and drop Zeppelin aggeregates the values and display them in pi
<div class="row">
<div class="col-md-8">
<img class="img-responsive" src="./assets/themes/zeppelin/img/screenshots/pivot.png" />
<img class="img-responsive" src="/assets/themes/zeppelin/img/screenshots/pivot.png" />
</div>
</div>
Learn more about Zeppelin's Display system. ( [text](./docs/displaysystem/display.html), [html](./docs/displaysystem/display.html#html), [table](./docs/displaysystem/table.html), [angular](./docs/displaysystem/angular.html) )
Learn more about Zeppelin's Display system. ( [text](./displaysystem/display.html), [html](./displaysystem/display.html#html), [table](./displaysystem/table.html), [angular](./displaysystem/angular.html) )
<br />
@ -79,9 +92,9 @@ Learn more about Zeppelin's Display system. ( [text](./docs/displaysystem/displa
Zeppelin can dynamically create some input forms into your notebook.
<img class="img-responsive" src="./assets/themes/zeppelin/img/screenshots/form_input.png" />
<img class="img-responsive" src="/assets/themes/zeppelin/img/screenshots/form_input.png" />
Learn more about [Dynamic Forms](./docs/manual/dynamicform.html).
Learn more about [Dynamic Forms](./manual/dynamicform.html).
<br />
@ -89,7 +102,7 @@ Learn more about [Dynamic Forms](./docs/manual/dynamicform.html).
Notebook URL can be shared among collaborators. Zeppelin can then broadcast any changes in realtime, just like the collaboration in Google docs.
<img src="./assets/themes/zeppelin/img/screenshots/collaboration.png" />
<img src="/assets/themes/zeppelin/img/screenshots/collaboration.png" />
<br />
### Publish
@ -98,13 +111,13 @@ Notebook URL can be shared among collaborators. Zeppelin can then broadcast any
This way, you can easily embed it as an iframe inside of your website.</p>
<div class="row">
<img class="img-responsive center-block" src="./assets/themes/zeppelin/img/screenshots/publish.png" />
<img class="img-responsive center-block" src="/assets/themes/zeppelin/img/screenshots/publish.png" />
</div>
<br />
### 100% Opensource
Apache Zeppelin (incubating) is Apache2 Licensed software. Please check out the [source repository](https://github.com/apache/incubator-zeppelin) and [How to contribute](./docs/development/howtocontribute.html)
Apache Zeppelin (incubating) is Apache2 Licensed software. Please check out the [source repository](https://github.com/apache/incubator-zeppelin) and [How to contribute](./development/howtocontribute.html)
Zeppelin has a very active development community.
Join the [Mailing list](./community.html) and report issues on our [Issue tracker](https://issues.apache.org/jira/browse/ZEPPELIN).

216
docs/install/install.md Normal file
View file

@ -0,0 +1,216 @@
---
layout: page
title: "Install Zeppelin"
description: ""
group: install
---
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
{% include JB/setup %}
## From binary package
Download latest binary package from [Download](../download.html).
## Build from source
Check instructions in [README](https://github.com/apache/incubator-zeppelin/blob/master/README.md) to build from source.
## Configure
Configuration can be done by both environment variable(conf/zeppelin-env.sh) and java properties(conf/zeppelin-site.xml). If both defined, environment vaiable is used.
<table class="table-configuration">
<tr>
<th>zepplin-env.sh</th>
<th>zepplin-site.xml</th>
<th>Default value</th>
<th>Description</th>
</tr>
<tr>
<td>ZEPPELIN_PORT</td>
<td>zeppelin.server.port</td>
<td>8080</td>
<td>Zeppelin server port.</td>
</tr>
<tr>
<td>ZEPPELIN_MEM</td>
<td>N/A</td>
<td>-Xmx1024m -XX:MaxPermSize=512m</td>
<td>JVM mem options</td>
</tr>
<tr>
<td>ZEPPELIN_INTP_MEM</td>
<td>N/A</td>
<td>ZEPPELIN_MEM</td>
<td>JVM mem options for interpreter process</td>
</tr>
<tr>
<td>ZEPPELIN_JAVA_OPTS</td>
<td>N/A</td>
<td></td>
<td>JVM Options</td>
</tr>
<tr>
<td>ZEPPELIN_ALLOWED_ORIGINS</td>
<td>zeppelin.server.allowed.origins</td>
<td>*</td>
<td>Allows a way to specify a ',' separated list of allowed origins for rest and websockets. i.e. http://localhost:8080</td>
</tr>
<tr>
<td>ZEPPELIN_SERVER_CONTEXT_PATH</td>
<td>zeppelin.server.context.path</td>
<td>/</td>
<td>Context Path of the Web Application</td>
</tr>
<tr>
<td>ZEPPELIN_SSL</td>
<td>zeppelin.ssl</td>
<td>false</td>
<td></td>
</tr>
<tr>
<td>ZEPPELIN_SSL_CLIENT_AUTH</td>
<td>zeppelin.ssl.client.auth</td>
<td>false</td>
<td></td>
</tr>
<tr>
<td>ZEPPELIN_SSL_KEYSTORE_PATH</td>
<td>zeppelin.ssl.keystore.path</td>
<td>keystore</td>
<td></td>
</tr>
<tr>
<td>ZEPPELIN_SSL_KEYSTORE_TYPE</td>
<td>zeppelin.ssl.keystore.type</td>
<td>JKS</td>
<td></td>
</tr>
<tr>
<td>ZEPPELIN_SSL_KEYSTORE_PASSWORD</td>
<td>zeppelin.ssl.keystore.password</td>
<td></td>
<td></td>
</tr>
<tr>
<td>ZEPPELIN_SSL_KEY_MANAGER_PASSWORD</td>
<td>zeppelin.ssl.key.manager.password</td>
<td></td>
<td></td>
</tr>
<tr>
<td>ZEPPELIN_SSL_TRUSTSTORE_PATH</td>
<td>zeppelin.ssl.truststore.path</td>
<td></td>
<td></td>
</tr>
<tr>
<td>ZEPPELIN_SSL_TRUSTSTORE_TYPE</td>
<td>zeppelin.ssl.truststore.type</td>
<td></td>
<td></td>
</tr>
<tr>
<td>ZEPPELIN_SSL_TRUSTSTORE_PASSWORD</td>
<td>zeppelin.ssl.truststore.password</td>
<td></td>
<td></td>
</tr>
<tr>
<td>ZEPPELIN_NOTEBOOK_HOMESCREEN</td>
<td>zeppelin.notebook.homescreen</td>
<td></td>
<td>Id of notebook to be displayed in homescreen ex) 2A94M5J1Z</td>
</tr>
<tr>
<td>ZEPPELIN_NOTEBOOK_HOMESCREEN_HIDE</td>
<td>zeppelin.notebook.homescreen.hide</td>
<td>false</td>
<td>hide homescreen notebook from list when this value set to "true"</td>
</tr>
<tr>
<td>ZEPPELIN_NOTEBOOK_DIR</td>
<td>zeppelin.notebook.dir</td>
<td>notebook</td>
<td>Where notebook file is saved</td>
</tr>
<tr>
<td>ZEPPELIN_NOTEBOOK_S3_BUCKET</td>
<td>zeppelin.notebook.s3.bucket</td>
<td>zeppelin</td>
<td>Bucket where notebook saved</td>
</tr>
<tr>
<td>ZEPPELIN_NOTEBOOK_S3_USER</td>
<td>zeppelin.notebook.s3.user</td>
<td>user</td>
<td>User in bucket where notebook saved. For example bucket/user/notebook/2A94M5J1Z/note.json</td>
</tr>
<tr>
<td>ZEPPELIN_NOTEBOOK_STORAGE</td>
<td>zeppelin.notebook.storage</td>
<td>org.apache.zeppelin.notebook.repo.VFSNotebookRepo</td>
<td>Comma separated list of notebook storage</td>
</tr>
<tr>
<td>ZEPPELIN_NOTEBOOK_RELOAD_FROM_STORAGE</td>
<td>zeppelin.notebook.reloadAllNotesFromStorage</td>
<td>false</td>
<td>Notebook list and contents will be always loaded from repository if set true. If set false, modified notebooks or new notebooks added on file system level won't be reflected on Zeppelin till user restarts Zeppelin.</td>
</tr>
<tr>
<td>ZEPPELIN_INTERPRETERS</td>
<td>zeppelin.interpreters</td>
<description></description>
<td>org.apache.zeppelin.spark.SparkInterpreter,<br />org.apache.zeppelin.spark.PySparkInterpreter,<br />org.apache.zeppelin.spark.SparkSqlInterpreter,<br />org.apache.zeppelin.spark.DepInterpreter,<br />org.apache.zeppelin.markdown.Markdown,<br />org.apache.zeppelin.shell.ShellInterpreter,<br />org.apache.zeppelin.hive.HiveInterpreter<br />
...
</td>
<td>Comma separated interpreter configurations [Class]. First interpreter become a default</td>
</tr>
<tr>
<td>ZEPPELIN_INTERPRETER_DIR</td>
<td>zeppelin.interpreter.dir</td>
<td>interpreter</td>
<td>Zeppelin interpreter directory</td>
</tr>
</table>
<br />
You'll also need to configure individual interpreter. Information can be found in 'Interpreter' section in this documentation.
For example [Spark](../interpreter/spark.html).
<br />
## Start/Stop
#### Start Zeppelin
```
bin/zeppelin-daemon.sh start
```
After successful start, visit http://localhost:8080 with your web browser.
#### Stop Zeppelin
```
bin/zeppelin-daemon.sh stop
```

View file

@ -4,6 +4,19 @@ title: "Install Zeppelin to connect with existing YARN cluster"
description: ""
group: install
---
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
{% include JB/setup %}
## Introduction

View file

@ -0,0 +1,807 @@
---
layout: page
title: "Cassandra Interpreter"
description: "Cassandra Interpreter"
group: manual
---
{% include JB/setup %}
<hr/>
## 1. Cassandra CQL Interpreter for Apache Zeppelin
<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>
<hr/>
## 2. Enabling Cassandra Interpreter
In a notebook, to enable the **Cassandra** interpreter, click on the **Gear** icon and select **Cassandra**
<center>
![Interpreter Binding](../assets/themes/zeppelin/img/docs-img/cassandra-InterpreterBinding.png)
![Interpreter Selection](../assets/themes/zeppelin/img/docs-img/cassandra-InterpreterSelection.png)
</center>
<hr/>
## 3. Using the Cassandra Interpreter
In a paragraph, use **_%cassandra_** to select the **Cassandra** interpreter and then input all commands.
To access the interactive help, type **HELP;**
<center>
![Interactive Help](../assets/themes/zeppelin/img/docs-img/cassandra-InteractiveHelp.png)
</center>
<hr/>
## 4. Interpreter Commands
The **Cassandra** interpreter accepts the following commands
<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>
</center>
<hr/>
## 5. CQL statements
This interpreter is compatible with any CQL statement supported by Cassandra. Ex:
```sql
INSERT INTO users(login,name) VALUES('jdoe','John DOE');
SELECT * FROM users WHERE login='jdoe';
```
Each statement should be separated by a semi-colon ( **;** ) except the special commands below:
1. @prepare
2. @bind
3. @remove_prepare
4. @consistency
5. @serialConsistency
6. @timestamp
7. @retryPolicy
8. @fetchSize
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:
```sql
USE spark_demo;
SELECT * FROM albums_by_country LIMIT 1; SELECT * FROM countries LIMIT 1;
SELECT *
FROM artists
WHERE login='jlennon';
```
Batch statements are supported and can span multiple lines, as well as DDL(CREATE/ALTER/DROP) statements:
```sql
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
);
```
CQL statements are <strong>case-insensitive</strong> (except for column names and values).
This means that the following statements are equivalent and valid:
```sql
INSERT INTO users(login,name) VALUES('jdoe','John DOE');
Insert into users(login,name) vAlues('hsue','Helen SUE');
```
The complete list of all CQL statements and versions can be found below:
<center>
<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>
<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_intro_c.html
</a>
</td>
</tr>
<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>
</table>
</center>
<hr/>
## 6. Comments in statements
It is possible to add comments between statements. Single line comments start with the hash sign (#). Multi-line comments are enclosed between /** and **/. Ex:
```sql
#First comment
INSERT INTO users(login,name) VALUES('jdoe','John DOE');
/**
Multi line
comments
**/
Insert into users(login,name) vAlues('hsue','Helen SUE');
```
<hr/>
## 7. Syntax Validation
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 **Cassandra**
Most of the time, syntax errors are due to **missing semi-colons** between statements or **typo errors**.
<hr/>
## 8. Schema commands
To make schema discovery easier and more interactive, the following commands are supported:
<center>
<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>
<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 user defined types in the <strong>current (logged) keyspace</strong></td>
</tr>
<tr>
<td nowrap><strong>DESCRIBE FUNCTIONS &lt;keyspace_name&gt;;</strong></td>
<td>List all existing user defined functions in the given keyspace</td>
</tr>
<tr>
<td nowrap><strong>DESCRIBE AGGREGATES &lt;keyspace_name&gt;;</strong></td>
<td>List all existing user defined aggregates in the given keyspace</td>
</tr>
<tr>
<td nowrap><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 nowrap><strong>DESCRIBE TABLE (&lt;keyspace_name&gt;).&lt;table_name&gt;;</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>
<tr>
<td nowrap><strong>DESCRIBE TYPE (&lt;keyspace_name&gt;).&lt;type_name&gt;;</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>
<tr>
<td nowrap><strong>DESCRIBE FUNCTION (&lt;keyspace_name&gt;).&lt;function_name&gt;;</strong></td>
<td>Describe the given user defined function. The keyspace is optional</td>
</tr>
<tr>
<td nowrap><strong>DESCRIBE AGGREGATE (&lt;keyspace_name&gt;).&lt;aggregate_name&gt;;</strong></td>
<td>Describe the given user defined aggregate. The keyspace is optional</td>
</tr>
</table>
</center>
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.
<br/>
<center>
![Describe Schema](../assets/themes/zeppelin/img/docs-img/cassandra-DescribeSchema.png)
</center>
<hr/>
## 9. Runtime Parameters
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:
<br/>
<center>
<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>
Some parameters only accept restricted values:
<br/>
<center>
<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_ONE, LOCAL_QUORUM, EACH_QUORUM</strong></td>
</tr>
<tr>
<td nowrap>Serial Consistency Level</td>
<td><strong>SERIAL, LOCAL_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_CONSISTENCY, FALLTHROUGH, LOGGING_DEFAULT, LOGGING_DOWNGRADING, LOGGING_FALLTHROUGH</strong></td>
</tr>
<tr>
<td nowrap>Fetch Size</td>
<td>Any integer value</td>
</tr>
</table>
</center>
>Please note that you should **not** add semi-colon ( **;** ) at the end of each parameter statement
Some examples:
```sql
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;
```
Some remarks about query parameters:
> 1. **many** query parameters can be set in the same paragraph
> 2. if the **same** query parameter is set many time with different values, the interpreter only take into account the first value
> 3. each query parameter applies to **all CQL statements** in the same paragraph, unless you override the option using plain CQL text (like forcing timestamp with the USING clause)
> 4. the order of each query parameter with regard to CQL statement does not matter
<hr/>
## 10. Support for Prepared Statements
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:
1. **@prepare**
2. **@bind**
3. **@remove_prepared**
Example:
```
@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]
```
<br/>
#### a. @prepare
<br/>
You can use the syntax _"@prepare[statement_name]=SELECT ..."_ to create a prepared statement.
The _statement_name_ is **mandatory** because the interpreter prepares the given statement with the Java driver and
saves the generated prepared statement in an **internal hash map**, using the provided _statement_name_ as search key.
> Please note that this internal prepared statement map is shared with **all notebooks** and **all paragraphs** because
there is only one instance of the interpreter for Cassandra
> If the interpreter encounters **many** @prepare for the **same _statement_name_ (key)**, only the **first** statement will be taken into account.
Example:
```
@prepare[select]=SELECT * FROM spark_demo.albums LIMIT ?
@prepare[select]=SELECT * FROM spark_demo.artists LIMIT ?
```
For the above example, the prepared statement is _SELECT * FROM spark_demo.albums LIMIT ?_.
_SELECT * FROM spark_demo.artists LIMIT ?_ is ignored because an entry already exists in the prepared statements map with the key select.
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)**.
<br/>
<br/>
#### b. @bind
<br/>
Once the statement is prepared (possibly in a separated notebook/paragraph). You can bind values to it:
```
@bind[select_first]=10
```
Bound values are not mandatory for the **@bind** statement. However if you provide bound values, they need to comply to some syntax:
* String values should be enclosed between simple quotes ( )
* Date values should be enclosed between simple quotes ( ) and respect the formats:
1. yyyy-MM-dd HH:MM:ss
2. yyyy-MM-dd HH:MM:ss.SSS
* **null** is parsed as-is
* **boolean** (true|false) are parsed as-is
* collection values must follow the **[standard CQL syntax]**:
* list: [list_item1, list_item2, ...]
* set: {set_item1, set_item2, …}
* map: {key1: val1, key2: val2, …}
* **tuple** values should be enclosed between parenthesis (see **[Tuple CQL syntax]**): (text, 123, true)
* **udt** values should be enclosed between brackets (see **[UDT CQL syntax]**): {stree_name: Beverly Hills, number: 104, zip_code: 90020, state: California, …}
> It is possible to use the @bind statement inside a batch:
>
> ```sql
>
> BEGIN BATCH
> @bind[insert_user]='jdoe','John DOE'
> UPDATE users SET age = 27 WHERE login='hsue';
> APPLY BATCH;
> ```
<br/>
#### c. @remove_prepare
<br/>
To avoid for a prepared statement to stay forever in the prepared statement map, you can use the
**@remove_prepare[statement_name]** syntax to remove it.
Removing a non-existing prepared statement yields no error.
<hr/>
## 11. Using Dynamic Forms
Instead of hard-coding your CQL queries, it is possible to use the mustache syntax ( **\{\{ \}\}** ) to inject simple value or multiple choices forms.
The syntax for simple parameter is: **\{\{input_Label=default value\}\}**. 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.
The syntax for multiple choices parameter is: **\{\{input_Label=value1 | value2 | … | valueN \}\}**. By default the first choice is used for CQL query
the first time the paragraph is executed.
Example:
{% raw %}
#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}}';
{% endraw %}
In the above example, the first CQL query will be executed for _performer='Sheryl Crow' AND style='Rock'_.
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 **\{\{style='Rock'\}\}** syntax but this time, the value displayed on the form is **_'Rock'_** and not **_Rock_**.
It is also possible to use dynamic forms for **prepared statements**:
{% raw %}
@bind[select]=='{{performer=Sheryl Crow|Doof|Fanfarlo|Los Paranoia}}', '{{style=Rock}}'
{% endraw %}
<hr/>
## 12. Execution parallelism and shared states
It is possible to execute many paragraphs in parallel. However, at the back-end side, were still using synchronous queries.
_Asynchronous execution_ is only possible when it is possible to return a `Future` value in the `InterpreterResult`.
It may be an interesting proposal for the **Zeppelin** project.
Another caveat is that the same `com.datastax.driver.core.Session` object is used for **all** notebooks and paragraphs.
Consequently, if you use the **USE _keyspace name_;** statement to log into a keyspace, it will change the keyspace for
**all current users** of the **Cassandra** interpreter because we only create 1 `com.datastax.driver.core.Session` object
per instance of **Cassandra** interpreter.
The same remark does apply to the **prepared statement hash map**, it is shared by **all users** using the same instance of **Cassandra** interpreter.
Until **Zeppelin** offers a real multi-users separation, there is a work-around to segregate user environment and states:
_create different **Cassandra** interpreter instances_
For this, first go to the **Interpreter** menu and click on the **Create** button
<br/>
<br/>
<center>
![Create Interpreter](../assets/themes/zeppelin/img/docs-img/cassandra-NewInterpreterInstance.png)
</center>
In the interpreter creation form, put **cass-instance2** as **Name** and select the **cassandra**
in the interpreter drop-down list
<br/>
<br/>
<center>
![Interpreter Name](../assets/themes/zeppelin/img/docs-img/cassandra-InterpreterName.png)
</center>
Click on **Save** to create the new interpreter instance. Now you should be able to see it in the interpreter list.
<br/>
<br/>
<center>
![Interpreter In List](../assets/themes/zeppelin/img/docs-img/cassandra-NewInterpreterInList.png)
</center>
Go back to your notebook and click on the **Gear** icon to configure interpreter bindings.
You should be able to see and select the **cass-instance2** interpreter instance in the available
interpreter list instead of the standard **cassandra** instance.
<br/>
<br/>
<center>
![Interpreter Instance Selection](../assets/themes/zeppelin/img/docs-img/cassandra-InterpreterInstanceSelection.png)
</center>
<hr/>
## 13. Interpreter Configuration
To configure the **Cassandra** interpreter, go to the **Interpreter** menu and scroll down to change the parameters.
The **Cassandra** interpreter is using the official **[Cassandra Java Driver]** and most of the parameters are used
to configure the Java driver
Below are the configuration parameters and their default value.
<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_ONE, LOCAL_QUORUM, EACH_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_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>
<hr/>
## 14. Bugs & Contacts
If you encounter a bug for this interpreter, please create a **[JIRA]** ticket and ping me on Twitter
at **[@doanduyhai]**
[Cassandra Java Driver]: https://github.com/datastax/java-driver
[standard CQL syntax]: http://docs.datastax.com/en/cql/3.1/cql/cql_using/use_collections_c.html
[Tuple CQL syntax]: http://docs.datastax.com/en/cql/3.1/cql/cql_reference/tupleType.html
[UDT CQL syntax]: http://docs.datastax.com/en/cql/3.1/cql/cql_using/cqlUseUDT.html
[JIRA]: https://issues.apache.org/jira/browse/ZEPPELIN-382?jql=project%20%3D%20ZEPPELIN
[@doanduyhai]: https://twitter.com/doanduyhai

116
docs/interpreter/ignite.md Normal file
View file

@ -0,0 +1,116 @@
---
layout: page
title: "Ignite Interpreter"
description: "Ignite user guide"
group: manual
---
{% include JB/setup %}
## Ignite Interpreter for Apache Zeppelin
### Overview
[Apache Ignite](https://ignite.apache.org/) 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.
![Apache Ignite](../assets/themes/zeppelin/img/docs-img/ignite-logo.png)
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.
### Installing and Running Ignite example
In order to use Ignite interpreters, you may install Apache Ignite in some simple steps:
1. Download Ignite [source release](https://ignite.apache.org/download.html#sources) or [binary release](https://ignite.apache.org/download.html#binaries) 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 `path/to/your-Zeppelin/ignite/pom.xml` ( Of course, in Zeppelin source release ). Please check `ignite.version` .<br>Currently, Zeppelin provides ignite only in Zeppelin source release. So, if you download Zeppelin binary release( `zeppelin-0.5.0-incubating-bin-spark-xxx-hadoop-xx` ), you can not use ignite interpreter on Zeppelin. We are planning to include ignite in a future binary release.
2. 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.
* In case of Eclipse, Eclipse -> File -> Import -> Existing Maven Projects
* Set examples directory path to Eclipse and select the pom.xml.
* Then start `org.apache.ignite.examples.ExampleNodeStartup` (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.
> **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.**
```
$ nohup java -jar </path/to/your Jar file name>
```
### Configuring Ignite Interpreter
At the "Interpreters" menu, you may edit Ignite interpreter or create new one. Zeppelin provides these properties for Ignite.
<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 [Ignite Cluster Configuration](https://apacheignite.readme.io/v1.2/docs/cluster-config) 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 [Ignite Clients vs. Servers](https://apacheignite.readme.io/v1.2/docs/clients-vs-servers) 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 [Zero Deployment](https://apacheignite.readme.io/v1.2/docs/zero-deployment) section for details. Use true or false values in order to enable or disable P2P class loading respectively.</td>
</tr>
</table>
![Configuration of Ignite Interpreter](../assets/themes/zeppelin/img/docs-img/ignite-interpreter-setting.png)
### Interpreter Binding for Zeppelin Notebook
After configuring Ignite interpreter, create your own notebook. Then you can bind interpreters like below image.
![Binding Interpreters](../assets/themes/zeppelin/img/docs-img/ignite-interpreter-binding.png)
For more interpreter binding information see [here](http://zeppelin.incubator.apache.org/docs/manual/interpreters.html).
### How to use Ignite SQL interpreter
In order to execute SQL query, use ` %ignite.ignitesql ` prefix. <br>
Supposing you are running `org.apache.ignite.examples.streaming.wordcount.StreamWords`, then you can use "words" cache( Of course you have to specify this cache name to the Ignite interpreter setting section `ignite.jdbc.url` of Zeppelin ).
For example, you can select top 10 words in the words cache using the following query
```
%ignite.ignitesql
select _val, count(_val) as cnt from String group by _val order by cnt desc limit 10
```
![IgniteSql on Zeppelin](../assets/themes/zeppelin/img/docs-img/ignite-sql-example.png)
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.
```
%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 _)
```
![Using Scala Code](../assets/themes/zeppelin/img/docs-img/ignite-scala-example.png)
Apache Ignite also provides a guide docs for Zeppelin ["Ignite with Apache Zeppelin"](https://apacheignite.readme.io/docs/data-analysis-with-apache-zeppelin)

View file

@ -11,7 +11,7 @@ group: manual
### Overview
[Apache Lens](https://lens.apache.org/) provides an Unified Analytics interface. Lens aims to cut the Data Analytics silos by providing a single view of data across multiple tiered data stores and optimal execution environment for the analytical query. It seamlessly integrates Hadoop with traditional data warehouses to appear like one.
![Apache Lens](/assets/themes/zeppelin/img/docs-img/lens-logo.png)
![Apache Lens](../assets/themes/zeppelin/img/docs-img/lens-logo.png)
### Installing and Running Lens
In order to use Lens interpreters, you may install Apache Lens in some simple steps:
@ -75,11 +75,11 @@ At the "Interpreters" menu, you can to edit Lens interpreter or create new one.
</tr>
</table>
![Apache Lens Interpreter Setting](/assets/themes/zeppelin/img/docs-img/lens-interpreter-setting.png)
![Apache Lens Interpreter Setting](../assets/themes/zeppelin/img/docs-img/lens-interpreter-setting.png)
### Interpreter Bindging for Zeppelin Notebook
After configuring Lens interpreter, create your own notebook, then you can bind interpreters like below image.
![Zeppelin Notebook Interpreter Biding](/assets/themes/zeppelin/img/docs-img/lens-interpreter-binding.png)
![Zeppelin Notebook Interpreter Biding](../assets/themes/zeppelin/img/docs-img/lens-interpreter-binding.png)
For more interpreter binding information see [here](http://zeppelin.incubator.apache.org/docs/manual/interpreters.html).
@ -159,14 +159,14 @@ As you can see in this video, they are using Lens Client Shell(./bin/lens-cli.sh
```
![Lens Query Result](/assets/themes/zeppelin/img/docs-img/lens-result.png)
![Lens Query Result](../assets/themes/zeppelin/img/docs-img/lens-result.png)
These are just examples that provided in advance by Lens. If you want to explore whole tutorials of Lens, see the [tutorial video](https://cwiki.apache.org/confluence/display/LENS/2015/07/13/20+Minute+video+demo+of+Apache+Lens+through+examples).
### Lens UI Service
Lens also provides web UI service. Once the server starts up, you can open the service on http://serverhost:19999/index.html and browse. You may also check the structure that you made and use query easily here.
![Lens UI Servive](/assets/themes/zeppelin/img/docs-img/lens-ui-service.png)
![Lens UI Servive](../assets/themes/zeppelin/img/docs-img/lens-ui-service.png)

View file

@ -7,7 +7,7 @@ group: manual
{% include JB/setup %}
## Spark
## Spark Interpreter
[Apache Spark](http://spark.apache.org) is supported in Zeppelin with
Spark Interpreter group, which consisted of 4 interpreters.
@ -41,10 +41,54 @@ Spark Interpreter group, which consisted of 4 interpreters.
</table>
<br /><br />
### Configuration
<hr />
Without any configuration, Spark interpreter works out of box in local mode. But if you want to connect to your Spark cluster, you'll need following two simple steps.
#### 1. export SPARK_HOME
In **conf/zeppelin-env.sh**, export SPARK_HOME environment variable with your Spark installation path.
for example
```bash
export SPARK_HOME=/usr/lib/spark
```
You can optionally export HADOOP\_CONF\_DIR and SPARK\_SUBMIT\_OPTIONS
```bash
export HADOOP_CONF_DIR=/usr/lib/hadoop
export SPARK_SUBMIT_OPTIONS="--packages com.databricks:spark-csv_2.10:1.2.0"
```
<br />
#### 2. set master in Interpreter menu.
After start Zeppelin, go to **Interpreter** menu and edit **master** property in your Spark interpreter setting. The value may vary depending on your Spark cluster deployment type.
for example,
* **local[*]** in local mode
* **spark://master:7077** in standalone cluster
* **yarn-client** in Yarn client mode
* **mesos://host:5050** in Mesos cluster
<br />
That's it. Zeppelin will work with any version of Spark and any deployment type without rebuild Zeppelin in this way. (Zeppelin 0.5.5-incubating release works up to Spark 1.5.1)
Note that without exporting SPARK_HOME, it's running in local mode with included version of Spark. The included version may vary depending on the build profile.
<br /> <br />
### SparkContext, SQLContext, ZeppelinContext
<hr />
SparkContext, SQLContext, ZeppelinContext are automatically created and exposed as variable names 'sc', 'sqlContext' and 'z', respectively, both in scala and python environments.
@ -54,7 +98,11 @@ Note that scala / python environment shares the same SparkContext, SQLContext, Z
<a name="dependencyloading"> </a>
<br />
<br />
### Dependency loading
### Dependency Management
<hr />
There are two ways to load external library in spark interpreter. First is using Zeppelin's %dep interpreter and second is loading Spark properties.
#### 1. Dynamic Dependency Loading via %dep interpreter
When your code requires external library, instead of doing download/copy/restart Zeppelin, you can easily do following jobs using %dep interpreter.
@ -64,6 +112,7 @@ When your code requires external library, instead of doing download/copy/restart
* Automatically add libraries to SparkCluster (You can turn off)
Dep interpreter leverages scala environment. So you can write any Scala code here.
Note that %dep interpreter should be used before %spark, %pyspark, %sql.
Here's usages.
@ -77,6 +126,9 @@ z.addRepo("RepoName").url("RepoURL")
// add maven snapshot repository
z.addRepo("RepoName").url("RepoURL").snapshot()
// add credentials for private maven repository
z.addRepo("RepoName").url("RepoURL").username("username").password("password")
// add artifact from filesystem
z.load("/path/to.jar")
@ -98,14 +150,56 @@ z.load("groupId:artifactId:version").exclude("groupId:*")
z.load("groupId:artifactId:version").local()
```
Note that %dep interpreter should be used before %spark, %pyspark, %sql.
<br />
#### 2. Loading Spark Properties
Once `SPARK_HOME` is set in `conf/zeppelin-env.sh`, Zeppelin uses `spark-submit` as spark interpreter runner. `spark-submit` supports two ways to load configurations. The first is command line options such as --master and Zeppelin can pass these options to `spark-submit` by exporting `SPARK_SUBMIT_OPTIONS` in conf/zeppelin-env.sh. Second is reading configuration options from `SPARK_HOME/conf/spark-defaults.conf`. Spark properites that user can set to distribute libraries are:
<table class="table-configuration">
<tr>
<th>spark-defaults.conf</th>
<th>SPARK_SUBMIT_OPTIONS</th>
<th>Applicable Interpreter</th>
<th>Description</th>
</tr>
<tr>
<td>spark.jars</td>
<td>--jars</td>
<td>%spark</td>
<td>Comma-separated list of local jars to include on the driver and executor classpaths.</td>
</tr>
<tr>
<td>spark.jars.packages</td>
<td>--packages</td>
<td>%spark</td>
<td>Comma-separated list of maven coordinates of jars to include on the driver and executor classpaths. Will search the local maven repo, then maven central and any additional remote repositories given by --repositories. The format for the coordinates should be groupId:artifactId:version.</td>
</tr>
<tr>
<td>spark.files</td>
<td>--files</td>
<td>%pyspark</td>
<td>Comma-separated list of files to be placed in the working directory of each executor.</td>
</tr>
</table>
Note that adding jar to pyspark is only availabe via %dep interpreter at the moment
<br/>
Here are few examples:
* SPARK\_SUBMIT\_OPTIONS in conf/zeppelin-env.sh
export SPARK_SUBMIT_OPTIONS="--packages com.databricks:spark-csv_2.10:1.2.0 --jars /path/mylib1.jar,/path/mylib2.jar --files /path/mylib1.py,/path/mylib2.zip,/path/mylib3.egg"
* SPARK_HOME/conf/spark-defaults.conf
spark.jars /path/mylib1.jar,/path/mylib2.jar
spark.jars.packages com.databricks:spark-csv_2.10:1.2.0
spark.files /path/mylib1.py,/path/mylib2.egg,/path/mylib3.zip
<a name="zeppelincontext"> </a>
<br />
<br />
### ZeppelinContext
<hr />
Zeppelin automatically injects ZeppelinContext as variable 'z' in your scala/python environment. ZeppelinContext provides some additional functions and utility.
@ -160,4 +254,4 @@ In sql environment, you can create form in simple template.
select * from ${table=defaultTableName} where text like '%${search}%'
```
To learn more about dynamic form, checkout [Dynamic Form](../dynamicform.html).
To learn more about dynamic form, checkout [Dynamic Form](../manual/dynamicform.html).

126
docs/manual/dynamicform.md Normal file
View file

@ -0,0 +1,126 @@
---
layout: page
title: "Dynamic Form"
description: ""
group: manual
---
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
{% include JB/setup %}
## Dynamic Form
Zeppelin dynamically creates input forms. Depending on language backend, there're two different ways to create dynamic form.
Custom language backend can select which type of form creation it wants to use.
<br />
### Using form Templates
This mode creates form using simple template language. It's simple and easy to use. For example Markdown, Shell, SparkSql language backend uses it.
<br />
#### Text input form
To create text input form, use _${formName}_ templates.
for example
<img src="/assets/themes/zeppelin/img/screenshots/form_input.png" />
Also you can provide default value, using _${formName=defaultValue}_.
<img src="/assets/themes/zeppelin/img/screenshots/form_input_default.png" />
<br />
#### Select form
To create select form, use _${formName=defaultValue,option1|option2...}_
for example
<img src="/assets/themes/zeppelin/img/screenshots/form_select.png" />
Also you can separate option's display name and value, using _${formName=defaultValue,option1(DisplayName)|option2(DisplayName)...}_
<img src="/assets/themes/zeppelin/img/screenshots/form_select_displayname.png" />
<br />
### Creates Programmatically
Some language backend uses programmatic way to create form. For example [ZeppelinContext](../interpreter/spark.html#zeppelincontext) provides form creation API
Here're some examples.
Text input form
You can do this in Scala
```scala
%spark
println("Hello "+z.input("name"))
```
Or Python
```python
%pyspark
print("Hello "+z.input("name"))
```
<img src="/assets/themes/zeppelin/img/screenshots/form_input_prog.png" />
Text input form with default value
Scala
```scala
%spark
println("Hello "+z.input("name", "sun"))
```
Python
```python
%pyspark
print("Hello "+z.input("name", "sun"))
```
<img src="/assets/themes/zeppelin/img/screenshots/form_input_default_prog.png" />
Select form
Scala
```scala
%spark
println("Hello "+z.select("day", Seq(("1","mon"),
("2","tue"),
("3","wed"),
("4","thurs"),
("5","fri"),
("6","sat"),
("7","sun"))))
```
Python
```python
%pyspark
print("Hello "+z.select("day", [("1","mon"),
("2","tue"),
("3","wed"),
("4","thurs"),
("5","fri"),
("6","sat"),
("7","sun")]))
```
<img src="/assets/themes/zeppelin/img/screenshots/form_select_prog.png" />

View file

@ -4,6 +4,19 @@ title: "Interpreters"
description: ""
group: manual
---
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
{% include JB/setup %}
@ -19,13 +32,13 @@ Zeppelin Interpreter is the plug-in which enable zeppelin user to use a specific
When you click on the ```+Create``` button in the interpreter page the interpreter drop-down list box will present all the available interpreters on your server.
<img src="../../assets/themes/zeppelin/img/screenshots/interpreter_create.png">
<img src="/assets/themes/zeppelin/img/screenshots/interpreter_create.png">
### What is zeppelin interpreter setting?
Zeppelin interpreter setting is the configuration of a given interpreter on zeppelin server. For example, the properties requried for hive JDBC interpreter to connect to the Hive server.
<img src="../../assets/themes/zeppelin/img/screenshots/interpreter_setting.png">
<img src="/assets/themes/zeppelin/img/screenshots/interpreter_setting.png">
### What is zeppelin interpreter group?
Every Interpreter belongs to an InterpreterGroup. InterpreterGroup is a unit of start/stop interpreter.
@ -35,7 +48,7 @@ SparkSQL and the dependency loader.
Technically, Zeppelin interpreters from the same group are running in the same JVM.
Interpreters belong to a single group a registered together and all of their properties are listed in the interpreter setting.
<img src="../../assets/themes/zeppelin/img/screenshots/interpreter_setting_spark.png">
<img src="/assets/themes/zeppelin/img/screenshots/interpreter_setting_spark.png">
### Programming langages for interpreter

View file

@ -4,6 +4,19 @@ title: "Notebook as Homepage"
description: ""
group: manual
---
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
{% include JB/setup %}
## Customize your zeppelin homepage
@ -38,7 +51,7 @@ The process for creating your homepage is very simple as shown below:
for example
<img src="../../assets/themes/zeppelin/img/screenshots/homepage_notebook_id.png" />
<img src="/assets/themes/zeppelin/img/screenshots/homepage_notebook_id.png" />
Set the notebook id to the ```ZEPPELIN_NOTEBOOK_HOMESCREEN``` environment variable
or ```zeppelin.notebook.homescreen``` property.
@ -84,7 +97,7 @@ you need to do is use our %angular support.
```
After running the notebook you will see output similar to this one:
<img src="../../assets/themes/zeppelin/img/screenshots/homepage_notebook_list.png" />
<img src="/assets/themes/zeppelin/img/screenshots/homepage_notebook_list.png" />
The main trick here relays in linking the ```<div>``` to the controller:

View file

@ -1 +0,0 @@
zeppelin-project.org

28
docs/pleasecontribute.md Normal file
View file

@ -0,0 +1,28 @@
---
layout: page
title: "Please contribute"
description: ""
group: development
---
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
{% include JB/setup %}
### Waiting for your help
The content does not exist yet.
We're always welcoming contribution.
If you're interested, please check [How to contribute (website)](./development/howtocontributewebsite.html).

View file

@ -4,6 +4,19 @@ title: "Interpreter REST API"
description: ""
group: rest-api
---
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
{% include JB/setup %}
## Zeppelin REST API
@ -47,7 +60,50 @@ group: rest-api
<tr>
<td> sample JSON response
</td>
<td> [Interpreter list sample](rest-json/rest-json-interpreter-list.json)
<td>
<pre>
{
"status": "OK",
"message": "",
"body": {
"md.md": {
"name": "md",
"group": "md",
"className": "org.apache.zeppelin.markdown.Markdown",
"properties": {},
"path": "/zeppelin/interpreter/md"
},
"spark.spark": {
"name": "spark",
"group": "spark",
"className": "org.apache.zeppelin.spark.SparkInterpreter",
"properties": {
"spark.executor.memory": {
"defaultValue": "512m",
"description": "Executor memory per worker instance. ex) 512m, 32g"
},
"spark.cores.max": {
"defaultValue": "",
"description": "Total number of cores to use. Empty value uses all available core."
},
},
"path": "/zeppelin/interpreter/spark"
},
"spark.sql": {
"name": "sql",
"group": "spark",
"className": "org.apache.zeppelin.spark.SparkSqlInterpreter",
"properties": {
"zeppelin.spark.maxResult": {
"defaultValue": "1000",
"description": "Max number of SparkSQL result to display."
}
},
"path": "/zeppelin/interpreter/spark"
}
}
}
</pre>
</td>
</tr>
</table>
@ -79,7 +135,48 @@ group: rest-api
<tr>
<td> sample JSON response
</td>
<td> [Setting list sample](rest-json/rest-json-interpreter-setting.json)
<td>
<pre>
{
"status": "OK",
"message": "",
"body": [
{
"id": "2AYUGP2D5",
"name": "md",
"group": "md",
"properties": {
"_empty_": ""
},
"interpreterGroup": [
{
"class": "org.apache.zeppelin.markdown.Markdown",
"name": "md"
}
]
},
{
"id": "2AY6GV7Q3",
"name": "spark",
"group": "spark",
"properties": {
"spark.cores.max": "",
"spark.executor.memory": "512m",
},
"interpreterGroup": [
{
"class": "org.apache.zeppelin.spark.SparkInterpreter",
"name": "spark"
},
{
"class": "org.apache.zeppelin.spark.SparkSqlInterpreter",
"name": "sql"
}
]
}
]
}
</pre>
</td>
</tr>
</table>
@ -111,13 +208,48 @@ group: rest-api
<tr>
<td> sample JSON input
</td>
<td> [Create JSON sample](rest-json/rest-json-interpreter-create.json)
<td>
<pre>
{
"name": "Markdown setting name",
"group": "md",
"properties": {
"propname": "propvalue"
},
"interpreterGroup": [
{
"class": "org.apache.zeppelin.markdown.Markdown",
"name": "md"
}
]
}
</pre>
</td>
</tr>
<tr>
<td> sample JSON response
</td>
<td> [Create response sample](rest-json/rest-json-interpreter-create-response.json)
<td>
<pre>
{
"status": "CREATED",
"message": "",
"body": {
"id": "2AYW25ANY",
"name": "Markdown setting name",
"group": "md",
"properties": {
"propname": "propvalue"
},
"interpreterGroup": [
{
"class": "org.apache.zeppelin.markdown.Markdown",
"name": "md"
}
]
}
}
</pre>
</td>
</tr>
</table>
@ -150,13 +282,48 @@ group: rest-api
<tr>
<td> sample JSON input
</td>
<td> [Update JSON sample](rest-json/rest-json-interpreter-update.json)
<td>
<pre>
{
"name": "Markdown setting name",
"group": "md",
"properties": {
"propname": "Otherpropvalue"
},
"interpreterGroup": [
{
"class": "org.apache.zeppelin.markdown.Markdown",
"name": "md"
}
]
}
</pre>
</td>
</tr>
<tr>
<td> sample JSON response
</td>
<td> [Update response sample](rest-json/rest-json-interpreter-update-response.json)
<td>
<pre>
{
"status": "OK",
"message": "",
"body": {
"id": "2AYW25ANY",
"name": "Markdown setting name",
"group": "md",
"properties": {
"propname": "Otherpropvalue"
},
"interpreterGroup": [
{
"class": "org.apache.zeppelin.markdown.Markdown",
"name": "md"
}
]
}
}
</pre>
</td>
</tr>
</table>
@ -189,7 +356,8 @@ group: rest-api
<tr>
<td> sample JSON response
</td>
<td> [Delete response sample](rest-json/rest-json-interpreter-delete-response.json)
<td>
<pre>{"status":"OK"}</pre>
</td>
</tr>
</table>

View file

@ -4,6 +4,19 @@ title: "Notebook REST API"
description: ""
group: rest-api
---
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
{% include JB/setup %}
## Zeppelin REST API
@ -20,8 +33,40 @@ group: rest-api
<br />
### Notebook REST API list
Notebooks can be created, deleted or cloned using the following REST API
Notebooks REST API supports the following operations: List, Create, Delete & Clone as detailed in the following table
<table class="table-configuration">
<col width="200">
<tr>
<th>List notebooks</th>
<th></th>
</tr>
<tr>
<td>Description</td>
<td>This ```GET``` method list the available notebooks on your server.
Notebook JSON contains the ```name``` and ```id``` of all notebooks.
</td>
</tr>
<tr>
<td>URL</td>
<td>```http://[zeppelin-server]:[zeppelin-port]/api/notebook```</td>
</tr>
<tr>
<td>Success code</td>
<td>200</td>
</tr>
<tr>
<td> Fail code</td>
<td> 500 </td>
</tr>
<tr>
<td> sample JSON response </td>
<td><pre>{"status":"OK","message":"","body":[{"name":"Homepage","id":"2AV4WUEMK"},{"name":"Zeppelin Tutorial","id":"2A94M5J1Z"}]}</pre></td>
</tr>
</table>
<br/>
<table class="table-configuration">
<col width="200">
<tr>
@ -48,11 +93,11 @@ group: rest-api
</tr>
<tr>
<td> sample JSON input </td>
<td> [Create JSON sample](rest-json/rest-json-notebook-create.json)</td>
<td><pre>{"name": "name of new notebook"}</pre></td>
</tr>
<tr>
<td> sample JSON response </td>
<td> [Create response sample](rest-json/rest-json-notebook-create-response.json) </td>
<td><pre>{"status": "CREATED","message": "","body": "2AZPHY918"}</pre></td>
</tr>
</table>
@ -83,7 +128,7 @@ group: rest-api
</tr>
<tr>
<td> sample JSON response </td>
<td> [Delete response sample](rest-json/rest-json-notebook-delete-response.json) </td>
<td><pre>{"status":"OK","message":""}</pre></td>
</tr>
</table>
@ -116,11 +161,11 @@ group: rest-api
</tr>
<tr>
<td> sample JSON input </td>
<td> [Clone JSON sample](rest-json/rest-json-notebook-create.json)</td>
<td><pre>{"name": "name of new notebook"}</pre></td>
</tr>
<tr>
<td> sample JSON response </td>
<td> [Clone response sample](rest-json/rest-json-notebook-create-response.json) </td>
<td><pre>{"status": "CREATED","message": "","body": "2AZPHY918"}</pre></td>
</tr>
</table>

View file

@ -0,0 +1,14 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

View file

@ -3,6 +3,19 @@ layout: page
title: "Screenshots"
description: ""
---
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
{% include JB/setup %}
<div class="row">

80
docs/storage/storage.md Normal file
View file

@ -0,0 +1,80 @@
---
layout: page
title: "Storage"
description: "Notebook Storage option for Zeppelin"
group: storage
---
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
### Notebook Storage
In Zeppelin there are two option for storage Notebook, by default the notebook is storage in the notebook folder in your local File System and the second option is S3.
</br>
#### Notebook Storage in S3
For notebook storage in S3 you need the AWS credentials, for this there are three options, the enviroment variable ```AWS_ACCESS_KEY_ID``` and ```AWS_ACCESS_SECRET_KEY```, credentials file in the folder .aws in you home and IAM role for your instance. For complete the need steps is necessary:
</br>
you need the following folder structure on S3
```
bucket_name/
username/
notebook/
```
set the enviroment variable in the file **zeppelin-env.sh**:
```
export ZEPPELIN_NOTEBOOK_S3_BUCKET = bucket_name
export ZEPPELIN_NOTEBOOK_S3_USER = username
```
in the file **zeppelin-site.xml** uncommet and complete the next property:
```
<!--If used S3 to storage, it is necessary the following folder structure bucket_name/username/notebook/-->
<property>
<name>zeppelin.notebook.s3.user</name>
<value>username</value>
<description>user name for s3 folder structure</description>
</property>
<property>
<name>zeppelin.notebook.s3.bucket</name>
<value>bucket_name</value>
<description>bucket name for notebook storage</description>
</property>
```
uncomment the next property for use S3NotebookRepo class:
```
<property>
<name>zeppelin.notebook.storage</name>
<value>org.apache.zeppelin.notebook.repo.S3NotebookRepo</value>
<description>notebook persistence layer implementation</description>
</property>
```
comment the next property:
```
<property>
<name>zeppelin.notebook.storage</name>
<value>org.apache.zeppelin.notebook.repo.VFSNotebookRepo</value>
<description>notebook persistence layer implementation</description>
</property>
```

View file

@ -4,7 +4,19 @@ title: "Tutorial"
description: "Tutorial is valid for Spark 1.3 and higher"
group: tutorial
---
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
### Zeppelin Tutorial
We will assume you have Zeppelin installed already. If that's not the case, see [Install](../install/install.html).

View file

@ -35,7 +35,7 @@
<url>http://zeppelin.incubator.apache.org</url>
<properties>
<flink.version>0.9.0</flink.version>
<flink.version>0.10.0</flink.version>
<flink.akka.version>2.3.7</flink.akka.version>
<flink.scala.binary.version>2.10</flink.scala.binary.version>
<flink.scala.version>2.10.4</flink.scala.version>

View file

@ -20,8 +20,6 @@ package org.apache.zeppelin.flink;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.net.URL;
@ -31,7 +29,6 @@ import java.util.List;
import java.util.Map;
import java.util.Properties;
import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.api.scala.FlinkILoop;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.runtime.minicluster.LocalFlinkMiniCluster;
@ -46,7 +43,6 @@ import org.slf4j.LoggerFactory;
import scala.Console;
import scala.None;
import scala.Option;
import scala.Some;
import scala.runtime.AbstractFunction0;
import scala.tools.nsc.Settings;
@ -137,7 +133,7 @@ public class FlinkInterpreter extends Interpreter {
private int getPort() {
if (localMode()) {
return localFlinkCluster.getJobManagerRPCPort();
return localFlinkCluster.getLeaderRPCPort();
} else {
return Integer.parseInt(getProperty("port"));
}
@ -332,7 +328,12 @@ public class FlinkInterpreter extends Interpreter {
private void startFlinkMiniCluster() {
localFlinkCluster = new LocalFlinkMiniCluster(flinkConf, false);
localFlinkCluster.waitForTaskManagersToBeRegistered();
try {
localFlinkCluster.start(true);
} catch (Exception e){
throw new RuntimeException("Could not start Flink mini cluster.", e);
}
}
private void stopFlinkMiniCluster() {

View file

@ -32,10 +32,21 @@
<version>0.6.0-incubating-SNAPSHOT</version>
<name>Zeppelin: Hive interpreter</name>
<url>http://www.apache.org</url>
<!--
<repositories>
<repository>
<id>mapr-releases</id>
<url>http://repository.mapr.com/maven/</url>
<snapshots><enabled>false</enabled></snapshots>
<releases><enabled>true</enabled></releases>
</repository>
</repositories>
-->
<properties>
<hive.hive.version>0.14.0</hive.hive.version>
<hive.hadoop.version>2.6.0</hive.hadoop.version>
<!--<hive.hive.version>1.0.0-mapr-1504</hive.hive.version>
<hive.hadoop.version>2.7.0-mapr-1506</hive.hadoop.version> -->
</properties>
<dependencies>
<dependency>

View file

@ -225,80 +225,16 @@
</plugins>
</build>
<repositories>
<repository>
<id>inmobi.repo</id>
<url>https://github.com/InMobi/mvn-repo/raw/master/releases</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>inmobi.snapshots</id>
<url>https://github.com/InMobi/mvn-repo/raw/master/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>central</id>
<url>http://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>cloudera</id>
<url>https://repository.cloudera.com/artifactory/cloudera-repos</url>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
<repository>
<id>Codehaus repository</id>
<url>http://repository.codehaus.org/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>apache.snapshots.repo</id>
<url>https://repository.apache.org/content/groups/snapshots</url>
<name>Apache Snapshots Repository</name>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>default</id>
<url>https://repository.apache.org/content/groups/public/</url>
</repository>
<repository>
<id>projectlombok.org</id>
<url>http://projectlombok.org/mavenrepo</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<!-- see https://jira.springsource.org/browse/SHL-52 -->
<repository>
<id>ext-release-local</id>
<url>http://repo.springsource.org/simple/ext-release-local/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<profiles>
<profile>
<id>vendor-repo</id>
<repositories>
<repository>
<id>cloudera</id>
<url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
</repository>
</repositories>
</profile>
</profiles>
</project>

View file

@ -0,0 +1,176 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS

View file

@ -0,0 +1,82 @@
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting — in part or in whole — any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

View file

@ -0,0 +1,21 @@
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View file

@ -0,0 +1,21 @@
(The MIT License)
Copyright (c) 2008 Tom Preston-Werner
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View file

@ -0,0 +1,21 @@
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View file

@ -0,0 +1,21 @@
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

33
pom.xml
View file

@ -425,6 +425,7 @@
<configuration>
<excludes>
<exclude>**/*.keywords</exclude>
<exclude>reports/**</exclude>
<exclude>**/.idea/</exclude>
<exclude>**/*.iml</exclude>
<exclude>.git/</exclude>
@ -435,7 +436,6 @@
<exclude>**/*.avsc</exclude>
<exclude>**/*.avro</exclude>
<exclude>**/*.log</exclude>
<exclude>**/docs/**</exclude>
<exclude>**/test/resources/**</exclude>
<exclude>**/.settings/*</exclude>
<exclude>**/.classpath</exclude>
@ -451,13 +451,44 @@
<exclude>**/notebook/**</exclude>
<exclude>_tools/site/css/*</exclude>
<exclude>**/README.md</exclude>
<exclude>DEPENDENCIES</exclude>
<exclude>DEPLOY.md</exclude>
<exclude>CONTRIBUTING.md</exclude>
<exclude>STYLE.md</exclude>
<exclude>Roadmap.md</exclude>
<exclude>**/licenses/**</exclude>
<exclude>**/zeppelin-distribution/src/bin_license/**</exclude>
<exclude>conf/interpreter.json</exclude>
<exclude>conf/zeppelin-env.sh</exclude>
<exclude>spark-*-bin*/**</exclude>
<!-- bundled from bootstrap -->
<exclude>docs/assets/themes/zeppelin/bootstrap/**</exclude>
<exclude>docs/assets/themes/zeppelin/css/style.css</exclude>
<exclude>docs/_includes/themes/zeppelin/_jumbotron.html</exclude>
<exclude>docs/_includes/themes/zeppelin/_navigation.html</exclude>
<!-- bundled from jekyll-bootstrap -->
<exclude>docs/404.html</exclude>
<exclude>docs/_config.yml</exclude>
<exclude>docs/_includes/JB/**</exclude>
<exclude>docs/_layouts/**</exclude>
<exclude>docs/_plugins/**</exclude>
<exclude>docs/atom.xml</exclude>
<exclude>docs/_includes/themes/zeppelin/default.html</exclude>
<exclude>docs/_includes/themes/zeppelin/page.html</exclude>
<exclude>docs/_includes/themes/zeppelin/post.html</exclude>
<exclude>docs/_includes/themes/zeppelin/settings.yml</exclude>
<exclude>docs/Rakefile</exclude>
<exclude>docs/rss.xml</exclude>
<exclude>docs/sitemap.txt</exclude>
<!-- bundled from jekyll -->
<exclude>docs/assets/themes/zeppelin/css/syntax.css</exclude>
<!-- docs (website) build target dir -->
<exclude>docs/_site/**</exclude>
<exclude>docs/Gemfile.lock</exclude>
</excludes>
</configuration>

View file

@ -54,13 +54,6 @@
<py4j.version>0.8.2.1</py4j.version>
</properties>
<repositories>
<repository>
<id>cloudera</id>
<url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
@ -349,6 +342,16 @@
</dependencies>
<profiles>
<profile>
<id>vendor-repo</id>
<repositories>
<repository>
<id>cloudera</id>
<url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
</repository>
</repositories>
</profile>
<profile>
<id>spark-1.1</id>
<dependencies>
@ -432,9 +435,7 @@
<dependency>
<groupId>com.datastax.spark</groupId>
<artifactId>spark-cassandra-connector_${scala.binary.version}</artifactId>
<!--You need to build your own version of Spark Cassandra connector 1.3.0-SNAPSHOT
because it is not yet released-->
<version>1.3.0-SNAPSHOT</version>
<version>1.3.1</version>
<exclusions>
<exclusion>
<groupId>org.joda</groupId>
@ -455,10 +456,31 @@
</dependencies>
</profile>
<profile>
<id>cassandra-spark-1.4</id>
<properties>
<spark.version>1.4.1</spark.version>
</properties>
<dependencies>
<dependency>
<groupId>com.datastax.spark</groupId>
<artifactId>spark-cassandra-connector_${scala.binary.version}</artifactId>
<version>1.4.0</version>
<exclusions>
<exclusion>
<groupId>org.joda</groupId>
<artifactId>joda-convert</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</profile>
<profile>
<id>spark-1.5</id>
<properties>
<spark.version>1.5.1</spark.version>
<spark.version>1.5.2</spark.version>
<akka.group>com.typesafe.akka</akka.group>
<akka.version>2.3.11</akka.version>
<protobuf.version>2.5.0</protobuf.version>
@ -467,7 +489,31 @@
<dependencies>
</dependencies>
</profile>
<profile>
<id>cassandra-spark-1.5</id>
<properties>
<spark.version>1.5.1</spark.version>
<akka.group>com.typesafe.akka</akka.group>
<akka.version>2.3.11</akka.version>
<protobuf.version>2.5.0</protobuf.version>
</properties>
<dependencies>
<dependency>
<groupId>com.datastax.spark</groupId>
<artifactId>spark-cassandra-connector_${scala.binary.version}</artifactId>
<version>1.5.0-M2</version>
<exclusions>
<exclusion>
<groupId>org.joda</groupId>
<artifactId>joda-convert</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</profile>
<profile>
<id>hadoop-0.23</id>
<!-- SPARK-1121: Adds an explicit dependency on Avro to work around a
@ -542,16 +588,62 @@
<yarn.version>2.3.0-mapr-4.0.0-FCS</yarn.version>
<jets3t.version>0.7.1</jets3t.version>
</properties>
<repositories>
<repository>
<id>mapr-releases</id>
<url>http://repository.mapr.com/maven/</url>
<snapshots><enabled>false</enabled></snapshots>
<releases><enabled>true</enabled></releases>
</repository>
</repositories>
</profile>
<profile>
<id>mapr4</id>
<id>mapr40</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<hadoop.version>2.3.0-mapr-4.0.0-FCS</hadoop.version>
<yarn.version>2.3.0-mapr-4.0.0-FCS</yarn.version>
<hadoop.version>2.4.1-mapr-1503</hadoop.version>
<yarn.version>2.4.1-mapr-1503</yarn.version>
<jets3t.version>0.9.3</jets3t.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
<version>2.4.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>3.4.5-mapr-1503</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>mapr-releases</id>
<url>http://repository.mapr.com/maven/</url>
<snapshots><enabled>false</enabled></snapshots>
<releases><enabled>true</enabled></releases>
</repository>
</repositories>
</profile>
<profile>
<id>mapr41</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<hadoop.version>2.5.1-mapr-1503</hadoop.version>
<yarn.version>2.5.1-mapr-1503</yarn.version>
<jets3t.version>0.7.1</jets3t.version>
</properties>
<dependencies>
@ -569,9 +661,55 @@
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>3.4.5-mapr-1406</version>
<version>3.4.5-mapr-1503</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>mapr-releases</id>
<url>http://repository.mapr.com/maven/</url>
<snapshots><enabled>false</enabled></snapshots>
<releases><enabled>true</enabled></releases>
</repository>
</repositories>
</profile>
<profile>
<id>mapr50</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<hadoop.version>2.7.0-mapr-1506</hadoop.version>
<yarn.version>2.7.0-mapr-1506</yarn.version>
<jets3t.version>0.9.3</jets3t.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
<version>2.4.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>3.4.5-mapr-1503</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>mapr-releases</id>
<url>http://repository.mapr.com/maven/</url>
<snapshots><enabled>false</enabled></snapshots>
<releases><enabled>true</enabled></releases>
</repository>
</repositories>
</profile>
<profile>

View file

@ -43,13 +43,6 @@
<py4j.version>0.8.2.1</py4j.version>
</properties>
<repositories>
<repository>
<id>cloudera</id>
<url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
@ -301,6 +294,18 @@
</dependency>
</dependencies>
<profiles>
<profile>
<id>vendor-repo</id>
<repositories>
<repository>
<id>cloudera</id>
<url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
</repository>
</repositories>
</profile>
</profiles>
<build>
<plugins>
<plugin>

View file

@ -183,7 +183,9 @@ public class DepInterpreter extends Interpreter {
if (sparkInterpreter != null && sparkInterpreter.isSparkContextInitialized()) {
return new InterpreterResult(Code.ERROR,
"Must be used before SparkInterpreter (%spark) initialized");
"Must be used before SparkInterpreter (%spark) initialized\n" +
"Hint: put this paragraph before any Spark code and " +
"restart Zeppelin/Interpreter" );
}
scala.tools.nsc.interpreter.Results.Result ret = intp.interpret(st);

View file

@ -82,9 +82,6 @@ public class PySparkInterpreter extends Interpreter implements ExecuteResultHand
"spark",
PySparkInterpreter.class.getName(),
new InterpreterPropertyBuilder()
.add("spark.home",
SparkInterpreter.getSystemDefault("SPARK_HOME", "spark.home", ""),
"Spark home path. Should be provided for pyspark")
.add("zeppelin.pyspark.python",
SparkInterpreter.getSystemDefault("PYSPARK_PYTHON", null, "python"),
"Python command to run pyspark with").build());
@ -96,16 +93,6 @@ public class PySparkInterpreter extends Interpreter implements ExecuteResultHand
scriptPath = System.getProperty("java.io.tmpdir") + "/zeppelin_pyspark.py";
}
private String getSparkHome() {
String sparkHome = getProperty("spark.home");
if (sparkHome == null) {
throw new InterpreterException("spark.home is undefined");
} else {
return sparkHome;
}
}
private void createPythonScript() {
ClassLoader classLoader = getClass().getClassLoader();
File out = new File(scriptPath);
@ -297,6 +284,12 @@ public class PySparkInterpreter extends Interpreter implements ExecuteResultHand
@Override
public InterpreterResult interpret(String st, InterpreterContext context) {
SparkInterpreter sparkInterpreter = getSparkInterpreter();
if (sparkInterpreter.getSparkVersion().isUnsupportedVersion()) {
return new InterpreterResult(Code.ERROR, "Spark "
+ sparkInterpreter.getSparkVersion().toString() + " is not supported");
}
if (!pythonscriptRunning) {
return new InterpreterResult(Code.ERROR, "python process not running"
+ outputStream.toString());
@ -327,7 +320,6 @@ public class PySparkInterpreter extends Interpreter implements ExecuteResultHand
+ outputStream.toString());
}
SparkInterpreter sparkInterpreter = getSparkInterpreter();
if (!sparkInterpreter.getSparkVersion().isPysparkSupported()) {
return new InterpreterResult(Code.ERROR, "pyspark "
+ sparkInterpreter.getSparkContext().version() + " is not supported");

View file

@ -100,10 +100,6 @@ public class SparkInterpreter extends Interpreter {
.add("spark.cores.max",
getSystemDefault(null, "spark.cores.max", ""),
"Total number of cores to use. Empty value uses all available core.")
.add("spark.yarn.jar",
getSystemDefault("SPARK_YARN_JAR", "spark.yarn.jar", ""),
"The location of the Spark jar file. If you use yarn as a cluster, "
+ "we should set this value")
.add("zeppelin.spark.useHiveContext",
getSystemDefault("ZEPPELIN_SPARK_USEHIVECONTEXT",
"zeppelin.spark.useHiveContext", "true"),
@ -310,7 +306,7 @@ public class SparkInterpreter extends Interpreter {
}
//TODO(jongyoul): Move these codes into PySparkInterpreter.java
String pysparkBasePath = getSystemDefault("SPARK_HOME", "spark.home", null);
String pysparkBasePath = getSystemDefault("SPARK_HOME", null, null);
File pysparkPath;
if (null == pysparkBasePath) {
pysparkBasePath = getSystemDefault("ZEPPELIN_HOME", "zeppelin.home", "../");
@ -609,6 +605,11 @@ public class SparkInterpreter extends Interpreter {
*/
@Override
public InterpreterResult interpret(String line, InterpreterContext context) {
if (sparkVersion.isUnsupportedVersion()) {
return new InterpreterResult(Code.ERROR, "Spark " + sparkVersion.toString()
+ " is not supported");
}
z.setInterpreterContext(context);
if (line == null || line.trim().length() == 0) {
return new InterpreterResult(Code.SUCCESS);

View file

@ -115,9 +115,14 @@ public class SparkSqlInterpreter extends Interpreter {
@Override
public InterpreterResult interpret(String st, InterpreterContext context) {
SQLContext sqlc = null;
SparkInterpreter sparkInterpreter = getSparkInterpreter();
if (sparkInterpreter.getSparkVersion().isUnsupportedVersion()) {
return new InterpreterResult(Code.ERROR, "Spark "
+ sparkInterpreter.getSparkVersion().toString() + " is not supported");
}
sqlc = getSparkInterpreter().getSQLContext();
SparkContext sc = sqlc.sparkContext();
if (concurrentSQL()) {
sc.setLocalProperty("spark.scheduler.pool", "fair");

View file

@ -16,28 +16,47 @@
*/
package org.apache.zeppelin.spark;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Provide reading comparing capability of spark version returned from SparkContext.version()
*/
public enum SparkVersion {
SPARK_1_0_0,
SPARK_1_0_1,
SPARK_1_1_0,
SPARK_1_1_1,
SPARK_1_2_0,
SPARK_1_2_1,
SPARK_1_2_2,
SPARK_1_3_0,
SPARK_1_3_1,
SPARK_1_4_0,
SPARK_1_4_1,
SPARK_1_5_0,
SPARK_1_5_1;
public class SparkVersion {
Logger logger = LoggerFactory.getLogger(SparkVersion.class);
public static final SparkVersion SPARK_1_0_0 = SparkVersion.fromVersionString("1.0.0");
public static final SparkVersion SPARK_1_1_0 = SparkVersion.fromVersionString("1.1.0");
public static final SparkVersion SPARK_1_2_0 = SparkVersion.fromVersionString("1.2.0");
public static final SparkVersion SPARK_1_3_0 = SparkVersion.fromVersionString("1.3.0");
public static final SparkVersion SPARK_1_4_0 = SparkVersion.fromVersionString("1.4.0");
public static final SparkVersion SPARK_1_5_0 = SparkVersion.fromVersionString("1.5.0");
public static final SparkVersion SPARK_1_6_0 = SparkVersion.fromVersionString("1.6.0");
public static final SparkVersion MIN_SUPPORTED_VERSION = SPARK_1_0_0;
public static final SparkVersion UNSUPPORTED_FUTURE_VERSION = SPARK_1_6_0;
private int version;
private String versionString;
SparkVersion() {
version = Integer.parseInt(name().substring("SPARK_".length()).replaceAll("_", ""));
SparkVersion(String versionString) {
this.versionString = versionString;
try {
int pos = versionString.indexOf('-');
String numberPart = versionString;
if (pos > 0) {
numberPart = versionString.substring(0, pos);
}
version = Integer.parseInt(numberPart.replaceAll("\\.", ""));
} catch (Exception e) {
logger.error("Can not recognize Spark version " + versionString +
". Assume it's a future release", e);
// assume it is future release
version = 999;
}
}
public int toNumber() {
@ -45,17 +64,16 @@ public enum SparkVersion {
}
public String toString() {
return name().substring("SPARK_".length()).replaceAll("_", ".");
return versionString;
}
public boolean isUnsupportedVersion() {
return olderThan(MIN_SUPPORTED_VERSION) || newerThanEquals(UNSUPPORTED_FUTURE_VERSION);
}
public static SparkVersion fromVersionString(String versionString) {
for (SparkVersion v : values()) {
// Check for the beginning of the version string to allow for "1.5.0-SNAPSHOT"
if (versionString.startsWith(v.toString())) {
return v;
}
}
throw new IllegalArgumentException();
return new SparkVersion(versionString);
}
public boolean isPysparkSupported() {
@ -78,6 +96,10 @@ public enum SparkVersion {
return this.olderThan(SPARK_1_3_0);
}
public boolean equals(Object versionToCompare) {
return version == ((SparkVersion) versionToCompare).version;
}
public boolean newerThan(SparkVersion versionToCompare) {
return version > versionToCompare.version;
}

View file

@ -21,6 +21,8 @@ import java.io.File;
import java.net.MalformedURLException;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import org.sonatype.aether.RepositorySystem;
import org.sonatype.aether.RepositorySystemSession;
@ -28,6 +30,7 @@ import org.sonatype.aether.artifact.Artifact;
import org.sonatype.aether.collection.CollectRequest;
import org.sonatype.aether.graph.DependencyFilter;
import org.sonatype.aether.repository.RemoteRepository;
import org.sonatype.aether.repository.Authentication;
import org.sonatype.aether.resolution.ArtifactResolutionException;
import org.sonatype.aether.resolution.ArtifactResult;
import org.sonatype.aether.resolution.DependencyRequest;
@ -153,6 +156,10 @@ public class DependencyContext {
for (Repository repo : repositories) {
RemoteRepository rr = new RemoteRepository(repo.getName(), "default", repo.getUrl());
rr.setPolicy(repo.isSnapshot(), null);
Authentication auth = repo.getAuthentication();
if (auth != null) {
rr.setAuthentication(auth);
}
collectRequest.addRepository(rr);
}

View file

@ -16,7 +16,7 @@
*/
package org.apache.zeppelin.spark.dep;
import org.sonatype.aether.repository.Authentication;
/**
*
*
@ -25,6 +25,8 @@ public class Repository {
private boolean snapshot = false;
private String name;
private String url;
private String username = null;
private String password = null;
public Repository(String name){
this.name = name;
@ -51,4 +53,28 @@ public class Repository {
public String getUrl() {
return url;
}
public Repository username(String username) {
this.username = username;
return this;
}
public Repository password(String password) {
this.password = password;
return this;
}
public Repository credentials(String username, String password) {
this.username = username;
this.password = password;
return this;
}
protected Authentication getAuthentication() {
Authentication auth = null;
if (this.username != null && this.password != null) {
auth = new Authentication(this.username, this.password);
}
return auth;
}
}

View file

@ -78,6 +78,22 @@ class PyZeppelinContext(dict):
def get(self, key):
return self.__getitem__(key)
def input(self, name, defaultValue = ""):
return self.z.input(name, defaultValue)
def select(self, name, options, defaultValue = ""):
# auto_convert to ArrayList doesn't match the method signature on JVM side
tuples = map(lambda items: self.__tupleToScalaTuple2(items), options)
iterables = gateway.jvm.scala.collection.JavaConversions.collectionAsScalaIterable(tuples)
return self.z.select(name, defaultValue, iterables)
def __tupleToScalaTuple2(self, tuple):
if (len(tuple) == 2):
return gateway.jvm.scala.Tuple2(tuple[0], tuple[1])
else:
raise IndexError("options must be a list of tuple of 2")
class SparkVersion(object):
SPARK_1_4_0 = 140
SPARK_1_3_0 = 130

Some files were not shown because too many files have changed in this diff Show more