In Hue-2745 v3.10, add JDBC support like Phoenix, Kylin, Redshift, Solr Parallel SQL, …
However, there isn’t any manual to use with Kylin.
Build a cube sample of Kylin with: Quick Start with Sample Cube, will be enough.
You can check:
If you have Hue installed, you can skip this step.
To install Hue on Ubuntu 16.04 LTS. The official Instructions didn’t work but this works fine:
There isn’t any binary package thus pre-requisites must be installed and compile with the command make
{% highlight Groff markup %} sudo apt-get install --fix-missing -q -y
git
ant
gcc
g++
libkrb5-dev
libmysqlclient-dev
libssl-dev
libsasl2-dev
libsasl2-modules-gssapi-mit
libsqlite3-dev
libtidy-0.99-0
libxml2-dev
libxslt-dev
libffi-dev
make
maven
libldap2-dev
python-dev
python-setuptools
libgmp3-dev
libz-dev {% endhighlight %}
Download and Compile:
{% highlight Groff markup %} git clone https://github.com/cloudera/hue.git cd hue make apps {% endhighlight %}
Start and connect to Hue:
{% highlight Groff markup %} build/env/bin/hue runserver_plus localhost:8888 {% endhighlight %}
The output must be similar to:
Connect using your browser: http://localhost:8888
Important: The first time that you connect to hue, you set Login / Pass for admin
We will use Hue / Hue as login / pass
Issue 1: Could not create home directory
It is a permission problem of your current user, you can use: sudo to start Hue
Issue 2: Could not connect to …
If Hue’s code had been downloaded from Git, Hive connection is active but not configured → skip this message
Issue 3: Address already in use
The port is in use or you have a Hive process running already
You can use ps -ef | grep hue, to find the PID and kill
The purpose is to add a snipped in a notebook with Kylin queries
References:
Register JDBC Driver
From Kylin Download Choose Binary and the correct version of Kylin and HBase
Download & Unpack: in ./lib:
check the actual value:
check the permission for this file (must be accessible to you):
Where is the hue.ini ?
If the code is downloaded from Git: UnzipPath/desktop/conf/pseudo-distributed.ini
(I shared my INI file in GitHub).
If you are using Cloudera: you must use Advanced Configuration Snippet
Other: find your actual hue.ini
Add these lines in [[interpreters]] {% highlight Groff markup %} [[[kylin]]] name=kylin JDBC interface=jdbc options=‘{“url”: “jdbc:kylin://172.17.0.2:7070/learn_kylin”,“driver”: “org.apache.kylin.jdbc.Driver”, “user”: “ADMIN”, “password”: “KYLIN”}’ {% endhighlight %}
TIP: One JDBC Source for each project is need
Register without a password, it can do use this other format: {% highlight Groff markup %} options=‘{“url”: “jdbc:kylin://172.17.0.2:7070/learn_kylin”,“driver”: “org.apache.kylin.jdbc.Driver”}’ {% endhighlight %}
And when you open the Notebook, Hue prompts this:
Issue 1: Hue can’t Start
If you see this when you connect to Hue ( http://localhost:8888 ):
Go to the last line
And launch Python Interpreter (see console icon on the right):
In this case: I've forgotten to close “ after learn_kylin
Issue 2: Password Prompting
In Hue 3.11 there is a bug Hue 4716
In Hue 3.10 with Kylin, I don’t have any problem :)
Add Kylin JDBC as source in the Kylin’s notebook:
>
>
>
Write a query, like this: {% highlight Groff markup %} select part_dt, sum(price) as total_selled, count(distinct seller_id) as sellers from kylin_sales group by part_dt order by part_dt {% endhighlight %}
And Execute with:
Congratulations !!! you are connected to Hue with Kylin
Issue 1: No suitable driver found for jdbc:kylin
There is a bug, not solved since 27 Aug 2016, nor in 3.10 and 3.11, but the solution is very easy:
Link: You only need to change 3 lines in /desktop/libs/librdbms/src/librdbms/jdbc.py
In Hue 3.10 and 3.11
Dashboards There is an amazing feature of Hue: Search Dasboards / Dynamic Dashboards. You can ‘play’ with this Demo On-line. But this only works with SolR.
There is a JIRA to solve this: Hue 3228, is in roadmap for 4.1. Check Hue MailListMailList and add Dashboards to JDBC connections.
Chart & Dynamic Filter Nowadays, it isn’t compatible, you only can work with Grid.
DB Query DB Query does not yet support JDBC.