Cassandra.ToolsAboutKnowledge Base

Apache Zeppelin

ApacheZeppelin (2581) apache/zeppelin (5527)
Languages:Javascript, Java, HTML, Jupyter Notebook
Templates:Apache
License:Apache 2.0

Getting Started

Zeppelin, a web-based notebook that enables interactive data analytics. You can make beautiful data-driven, interactive and collaborative documents with SQL, Scala and more.

Core features:

Web based notebook style editor. Built-in Apache Spark support To know more about Zeppelin, visit their web site https://zeppelin.apache.org


Installation

Install binary package Please go to install to install Apache Zeppelin from binary package.

Build from source Please check Build from source to build Zeppelin from source.

Requirements

Apache Zeppelin officially supports and is tested on the following environments:

Name Value
OpenJDK or Oracle JDK 1.8 (151+) (set JAVA_HOME)
OS Mac OSX
Ubuntu 18.04
Ubuntu 20.04

If you don't have requirements prepared, install it. (The installation method may vary according to your environment, example is for Ubuntu.)

sudo apt-get update
sudo apt-get install git
sudo apt-get install openjdk-8-jdk
sudo apt-get install npm
sudo apt-get install libfontconfig
sudo apt-get install r-base-dev
sudo apt-get install r-cran-evaluate

Install maven

wget http://www.eu.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
sudo tar -zxf apache-maven-3.6.3-bin.tar.gz -C /usr/local/
sudo ln -s /usr/local/apache-maven-3.6.3/bin/mvn /usr/local/bin/mvn

Notes: - Ensure node is installed by running node --version

  • Ensure maven is running version 3.6.3 or higher with mvn -version - Configure maven to use more memory than usual by export MAVEN_OPTS="-Xmx2g -XX:MaxMetaspaceSize=512m"

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;

The Cassandra interpreter accepts the following commands

Command Type Command Name Description
Help command HELP Display the interactive help menu
Schema commands DESCRIBE KEYSPACE, DESCRIBE CLUSTER, DESCRIBE TABLES ... Custom commands to describe the Cassandra schema
Option commands @consistency, @fetchSize ... Inject runtime options to all statements in the paragraph
Prepared statement commands @prepare, @bind, @remove_prepared Let you register a prepared command and re-use it later by injecting bound values
Native CQL statements All CQL-compatible statements (SELECT, INSERT, CREATE, ...) All CQL statements are executed directly against the Cassandra Server

CQL Statementss

This interpreter is compatible with any CQL statement supported by Cassandra. Ex:

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:

  • @prepare
  • @bind
  • @remove_prepare
  • @consistency
  • @serialConsistency
  • @timestamp
  • @fetchSize
  • @requestTimeOut

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:

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:

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 case-insensitive (except for column names and values). This means that the following statements are equivalent and valid:

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, along with a lot of other documentation about using the Cassandra Interpreter with Zeppelin.

License

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.

DataStax is a registered trademark of DataStax, Inc. and its subsidiaries in the United States and/or other countries.

Apache Cassandra, Apache, Tomcat, Lucene, Solr, Hadoop, Spark, TinkerPop, and Cassandra are trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries.

© 2022 Anant Corporation, All Rights Reserved. All logos, trademarks and registered trademarks are the property of their respective owners.