ZEPPELIN-440 HiveInterpreter with multiple configuration

- Updated docs for hive
This commit is contained in:
Jongyoul Lee 2015-11-26 12:21:50 +09:00
parent b4f1a1c156
commit 4e0126511b
2 changed files with 106 additions and 1 deletions

View file

@ -36,7 +36,7 @@ limitations under the License.
* [cassandra](./interpreter/cassandra.html)
* [flink](./interpreter/flink.html)
* [geode](./interpreter/geode.html)
* [hive](./pleasecontribute.html)
* [hive](./interpreter/hive.html)
* [ignite](./interpreter/ignite.html)
* [lens](./interpreter/lens.html)
* [md](./interpreter/markdown.html)

105
docs/interpreter/hive.md Normal file
View file

@ -0,0 +1,105 @@
---
layout: page
title: "Hive Interpreter"
description: ""
group: manual
---
{% include JB/setup %}
## Hive Interpreter for Apache Zeppelin
### Configuration
<br/>
<table class="table-configuration">
<tr>
<th>Property</th>
<th>Default</th>
<th>Description</th>
</tr>
<tr>
<td>default.driver</td>
<td>org.apache.hive.jdbc.HiveDriver</td>
<td>Class path of JDBC driver</td>
</tr>
<tr>
<td>default.url</td>
<td>jdbc:hive2://localhost:10000</td>
<td>Url for connection</td>
</tr>
<tr>
<td>default.user</td>
<td></td>
<td><b>(Optional)</b>Username of the connection</td>
</tr>
<tr>
<td>default.password</td>
<td></td>
<td><b>(Optional)</b>Password of the connection</td>
</tr>
<tr>
<td>default.xxx</td>
<td></td>
<td><b>(Optional)</b>Other properties used by the driver</td>
</tr>
<tr>
<td>${prefix}.driver</td>
<td></td>
<td>Driver class path of `%hive(${prefix})`</td>
</tr>
<tr>
<td>${prefix}.url</td>
<td></td>
<td>Url of `%hive(${prefix})`</td>
</tr>
<tr>
<td>${prefix}.user</td>
<td></td>
<td><b>(Optional)</b>Username of the connection of `%hive(${prefix})`</td>
</tr>
<tr>
<td>${prefix}.password</td>
<td></td>
<td><b>(Optional)</b>Password of the connection of `%hive(${prefix})`</td>
</tr>
<tr>
<td>${prefix}.xxx</td>
<td></td>
<td><b>(Optional)</b>Other properties used by the driver of `%hive(${prefix})`</td>
</tr>
</table>
This interpreter provides multiple configuration wih ${prefix}. User can set a multiple connection properties by this prefix. It can be used like `%hive(${prefix})`.
### How to use
Basically, you can use
```sql
%hive
select * from my_table;
```
or
```sql
%hive(etl)
-- 'etl' is a ${prefix}
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 [Zepplein Dynamic Form](https://zeppelin.incubator.apache.org/docs/manual/dynamicform.html) inside your queries. You can use both the `text input` and `select form` parametrization features
```sql
%hive
SELECT ${group_by}, count(*) as count
FROM retail_demo.order_lineitems_pxf
GROUP BY ${group_by=product_id,product_id|product_name|customer_id|store_id}
ORDER BY count ${order=DESC,DESC|ASC}
LIMIT ${limit=10};
```