Skip to content
979 changes: 465 additions & 514 deletions docs/interpreter/cassandra.md

Large diffs are not rendered by default.

105 changes: 44 additions & 61 deletions docs/interpreter/elasticsearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ group: manual
---
{% include JB/setup %}


## Elasticsearch Interpreter for Apache Zeppelin
[Elasticsearch](https://www.elastic.co/products/elasticsearch) is a highly scalable open-source full-text search and analytics engine. It allows you to store, search, and analyze big volumes of data quickly and in near real time. It is generally used as the underlying engine/technology that powers applications that have complex search features and requirements.

<br />
## 1. Configuration

## Configuration
<table class="table-configuration">
<tr>
<th>Property</th>
Expand Down Expand Up @@ -45,24 +42,20 @@ group: manual
![Interpreter configuration](../assets/themes/zeppelin/img/docs-img/elasticsearch-config.png)
</center>


> **Note #1 :** You can add more properties to configure the Elasticsearch client.

> **Note #2 :** If you use Shield, you can add a property named `shield.user` with a value containing the name and the password ( format: `username:password` ). For more details about Shield configuration, consult the [Shield reference guide](https://www.elastic.co/guide/en/shield/current/_using_elasticsearch_java_clients_with_shield.html). Do not forget, to copy the shield client jar in the interpreter directory (`ZEPPELIN_HOME/interpreters/elasticsearch`).

<br />
## 2. Enabling the Elasticsearch Interpreter

## Enabling the Elasticsearch Interpreter
In a notebook, to enable the **Elasticsearch** interpreter, click the **Gear** icon and select **Elasticsearch**.

<br />
## 3. Using the Elasticsearch Interpreter

## Using the Elasticsearch Interpreter
In a paragraph, use `%elasticsearch` to select the Elasticsearch interpreter and then input all commands. To get the list of available commands, use `help`.

```bash
| %elasticsearch
| help
%elasticsearch
help

Elasticsearch interpreter:
General format: <command> /<indices>/<types>/<id> <option> <JSON>
- indices: list of indices separated by commas (depends on the command)
Expand All @@ -84,19 +77,17 @@ Commands:

> **Tip :** Use ( Ctrl + . ) for autocompletion.


### Get
With the `get` command, you can find a document by id. The result is a JSON document.

```bash
| %elasticsearch
| get /index/type/id
%elasticsearch
get /index/type/id
```

Example:
![Elasticsearch - Get](../assets/themes/zeppelin/img/docs-img/elasticsearch-get.png)


### Search
With the `search` command, you can send a search query to Elasticsearch. There are two formats of query:

Expand All @@ -106,53 +97,50 @@ With the `search` command, you can send a search query to Elasticsearch. There a
* This is a shortcut to a query like that: `{ "query": { "query_string": { "query": "__HERE YOUR QUERY__", "analyze_wildcard": true } } }`
* See [Elasticsearch query string syntax](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax) for more details about the content of such a query.


```bash
| %elasticsearch
| search /index1,index2,.../type1,type2,... <JSON document containing the query or query_string elements>
%elasticsearch
search /index1,index2,.../type1,type2,... <JSON document containing the query or query_string elements>
```

If you want to modify the size of the result set, you can add a line that is setting the size, before your search command.

```bash
| %elasticsearch
| size 50
| search /index1,index2,.../type1,type2,... <JSON document containing the query or query_string elements>
%elasticsearch
size 50
search /index1,index2,.../type1,type2,... <JSON document containing the query or query_string elements>
```


> A search query can also contain [aggregations](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html). If there is at least one aggregation, the result of the first aggregation is shown, otherwise, you get the search hits.


Examples:

* With a JSON query:

```bash
| %elasticsearch
| search / { "query": { "match_all": { } } }
|
| %elasticsearch
| search /logs { "query": { "query_string": { "query": "request.method:GET AND status:200" } } }
|
| %elasticsearch
| search /logs { "aggs": {
| "content_length_stats": {
| "extended_stats": {
| "field": "content_length"
| }
| }
| } }
%elasticsearch
search / { "query": { "match_all": { } } }
%elasticsearch
search /logs { "query": { "query_string": { "query": "request.method:GET AND status:200" } } }
%elasticsearch
search /logs { "aggs": {
"content_length_stats": {
"extended_stats": {
"field": "content_length"
}
}
} }
```

* With query_string elements:

```bash
| %elasticsearch
| search /logs request.method:GET AND status:200
|
| %elasticsearch
| search /logs (404 AND (POST OR DELETE))
%elasticsearch
search /logs request.method:GET AND status:200
%elasticsearch
search /logs (404 AND (POST OR DELETE))
```

> **Important** : a document in Elasticsearch is a JSON document, so it is hierarchical, not flat as a row in a SQL table.
Expand Down Expand Up @@ -199,13 +187,12 @@ Examples:
* With a query containing a multi-bucket aggregation:
![Elasticsearch - Search with aggregation (multi-bucket)](../assets/themes/zeppelin/img/docs-img/elasticsearch-agg-multi-bucket-pie.png)


### Count
With the `count` command, you can count documents available in some indices and types. You can also provide a query.

```bash
| %elasticsearch
| count /index1,index2,.../type1,type2,... <JSON document containing the query OR a query string>
%elasticsearch
count /index1,index2,.../type1,type2,... <JSON document containing the query OR a query string>
```

Examples:
Expand All @@ -216,34 +203,30 @@ Examples:
* With a query:
![Elasticsearch - Count with query](../assets/themes/zeppelin/img/docs-img/elasticsearch-count-with-query.png)


### Index
With the `index` command, you can insert/update a document in Elasticsearch.

```bash
| %elasticsearch
| index /index/type/id <JSON document>
|
| %elasticsearch
| index /index/type <JSON document>
%elasticsearch
index /index/type/id <JSON document>

%elasticsearch
index /index/type <JSON document>
```

### Delete
With the `delete` command, you can delete a document.

```bash
| %elasticsearch
| delete /index/type/id
%elasticsearch
delete /index/type/id
```


### Apply Zeppelin Dynamic Forms

You can leverage [Zeppelin Dynamic Form]({{BASE_PATH}}/manual/dynamicform.html) inside your queries. You can use both the `text input` and `select form` parameterization features.

```bash
| %elasticsearch
| size ${limit=10}
| search /index/type { "query": { "match_all": { } } }
%elasticsearch
size ${limit=10}
search /index/type { "query": { "match_all": { } } }
```

4 changes: 0 additions & 4 deletions docs/interpreter/flink.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ group: manual
---
{% include JB/setup %}


## Flink interpreter for Apache Zeppelin
[Apache Flink](https://flink.apache.org) is an open source platform for distributed stream and batch data processing. Flink’s core is a streaming dataflow engine that provides data distribution, communication, and fault tolerance for distributed computations over data streams. Flink also builds batch processing on top of the streaming engine, overlaying native iteration support, managed memory, and program optimization.

<br>
## How to start local Flink cluster, to test the interpreter
Zeppelin comes with pre-configured flink-local interpreter, which starts Flink in a local mode on your machine, so you do not need to install anything.

Expand Down Expand Up @@ -38,10 +36,8 @@ At the "Interpreters" menu, you have to create a new Flink interpreter and provi
For more information about Flink configuration, you can find it [here](https://ci.apache.org/projects/flink/flink-docs-release-0.10/setup/config.html).

## How to test it's working

In example, by using the [Zeppelin notebook](https://www.zeppelinhub.com/viewer/notebooks/aHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL05GTGFicy96ZXBwZWxpbi1ub3RlYm9va3MvbWFzdGVyL25vdGVib29rcy8yQVFFREs1UEMvbm90ZS5qc29u) is from Till Rohrmann's presentation [Interactive data analysis with Apache Flink](http://www.slideshare.net/tillrohrmann/data-analysis-49806564) for Apache Flink Meetup.


```
%sh
rm 10.txt.utf-8
Expand Down
60 changes: 23 additions & 37 deletions docs/interpreter/geode.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ group: manual
---
{% include JB/setup %}


## Geode/Gemfire OQL Interpreter for Apache Zeppelin

<br/>
<table class="table-configuration">
<tr>
<th>Name</th>
Expand All @@ -23,7 +20,6 @@ group: manual
</tr>
</table>

<br/>
This interpreter supports the [Geode](http://geode.incubator.apache.org/) [Object Query Language (OQL)](http://geode-docs.cfapps.io/docs/developing/querying_basics/oql_compared_to_sql.html). With the OQL-based querying language:

[<img align="right" src="http://img.youtube.com/vi/zvzzA9GXu3Q/3.jpg" alt="zeppelin-view" hspace="10" width="200"></img>](https://www.youtube.com/watch?v=zvzzA9GXu3Q)
Expand All @@ -38,7 +34,6 @@ This interpreter supports the [Geode](http://geode.incubator.apache.org/) [Objec
This [Video Tutorial](https://www.youtube.com/watch?v=zvzzA9GXu3Q) illustrates some of the features provided by the `Geode Interpreter`.

### Create Interpreter

By default Zeppelin creates one `Geode/OQL` instance. You can remove it or create more instances.

Multiple Geode instances can be created, each configured to the same or different backend Geode cluster. But over time a `Notebook` can have only one Geode interpreter instance `bound`. That means you _cannot_ connect to different Geode clusters in the same `Notebook`. This is a known Zeppelin limitation.
Expand All @@ -53,38 +48,35 @@ In the `Notebook` click on the `settings` icon in the top right corner. The sele
### Configuration
You can modify the configuration of the Geode from the `Interpreter` section. The Geode interpreter expresses the following properties:


<table class="table-configuration">
<tr>
<th>Property Name</th>
<th>Description</th>
<th>Default Value</th>
</tr>
<tr>
<td>geode.locator.host</td>
<td>The Geode Locator Host</td>
<td>localhost</td>
</tr>
<tr>
<td>geode.locator.port</td>
<td>The Geode Locator Port</td>
<td>10334</td>
</tr>
<tr>
<td>geode.max.result</td>
<td>Max number of OQL result to display to prevent the browser overload</td>
<td>1000</td>
</tr>
</table>
<table class="table-configuration">
<tr>
<th>Property Name</th>
<th>Description</th>
<th>Default Value</th>
</tr>
<tr>
<td>geode.locator.host</td>
<td>The Geode Locator Host</td>
<td>localhost</td>
</tr>
<tr>
<td>geode.locator.port</td>
<td>The Geode Locator Port</td>
<td>10334</td>
</tr>
<tr>
<td>geode.max.result</td>
<td>Max number of OQL result to display to prevent the browser overload</td>
<td>1000</td>
</tr>
</table>

### How to use

> *Tip 1: Use (CTRL + .) for OQL auto-completion.*

> *Tip 2: Always start the paragraphs with the full `%geode.oql` prefix tag! The short notation: `%geode` would still be able run the OQL queries but the syntax highlighting and the auto-completions will be disabled.*

#### Create / Destroy Regions

The OQL specification does not support [Geode Regions](https://cwiki.apache.org/confluence/display/GEODE/Index#Index-MainConceptsandComponents) mutation operations. To `create`/`destroy` regions one should use the [GFSH](http://geode-docs.cfapps.io/docs/tools_modules/gfsh/chapter_overview.html) shell tool instead. In the following it is assumed that the GFSH is colocated with Zeppelin server.

```bash
Expand All @@ -105,9 +97,7 @@ EOF

Above snippet re-creates two regions: `regionEmployee` and `regionCompany`. Note that you have to explicitly specify the locator host and port. The values should match those you have used in the Geode Interpreter configuration. Comprehensive list of [GFSH Commands by Functional Area](http://geode-docs.cfapps.io/docs/tools_modules/gfsh/gfsh_quick_reference.html).

#### Basic OQL


#### Basic OQL
```sql
%geode.oql
SELECT count(*) FROM /regionEmployee
Expand Down Expand Up @@ -144,12 +134,9 @@ Following query will return the EntrySet value as a Blob:
SELECT e.key, e.value FROM /regionEmployee.entrySet e
```


> Note: You can have multiple queries in the same paragraph but only the result from the first is displayed. [[1](https://issues.apache.org/jira/browse/ZEPPELIN-178)], [[2](https://issues.apache.org/jira/browse/ZEPPELIN-212)].


#### GFSH Commands From The Shell

Use the Shell Interpreter (`%sh`) to run OQL commands form the command line:

```bash
Expand All @@ -159,7 +146,6 @@ gfsh -e "connect" -e "list members"
```

#### Apply Zeppelin Dynamic Forms

You can leverage [Zeppelin Dynamic Form](../manual/dynamicform.html) inside your OQL queries. You can use both the `text input` and `select form` parameterization features

```sql
Expand Down
8 changes: 2 additions & 6 deletions docs/interpreter/hive.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ group: manual
---
{% include JB/setup %}


## Hive Interpreter for Apache Zeppelin
The [Apache Hive](https://hive.apache.org/) ™ data warehouse software facilitates querying and managing large datasets residing in distributed storage. Hive provides a mechanism to project structure onto this data and query the data using a SQL-like language called HiveQL. At the same time this language also allows traditional map/reduce programmers to plug in their custom mappers and reducers when it is inconvenient or inefficient to express this logic in HiveQL.


## 1. Configuration
### Configuration
<table class="table-configuration">
<tr>
<th>Property</th>
Expand Down Expand Up @@ -71,9 +69,8 @@ The [Apache Hive](https://hive.apache.org/) ™ data warehouse software facilita
</table>

This interpreter provides multiple configuration with `${prefix}`. User can set a multiple connection properties by this prefix. It can be used like `%hive(${prefix})`.

## 2. How to use

## How to use
Basically, you can use

```sql
Expand All @@ -92,7 +89,6 @@ select * from my_table;
You can also run multiple queries up to 10 by default. Changing these settings is not implemented yet.

### Apply Zeppelin Dynamic Forms

You can leverage [Zeppelin Dynamic Form]({{BASE_PATH}}/manual/dynamicform.html) inside your queries. You can use both the `text input` and `select form` parameterization features.

```sql
Expand Down
Loading