Find file History
Latest commit 2286f84 Sep 18, 2016 albertozgz english fixes
Permalink
..
Failed to load latest commit information.
Images ini code Aug 28, 2016
Linkedin re synch Sep 18, 2016
.gitignore delete Aug 28, 2016
KylinWithHue.odt english fixes Sep 18, 2016
KylinWithHue.pdf ini code Aug 28, 2016
README.md english fixes Sep 18, 2016
pseudo-distributed.ini ini code Aug 28, 2016

README.md

How to use Hue with Kylin

Date: August 2016

Author: Ramón Portolés, Alberto alt text Linkedin

 

Intro

In Hue-2745 v3.10, add jdbc support like Phoenix, Kylin, Redshift, Solr Parallel SQL, …

But … there isn’t any manual to use it with Kylin :(

Pre-requisites

We need an instance of Kylin, with a cube: Quick Start with Sample Cube, will be enough

You can check:

Used Software:

 

1 Install Apache Hue

If you have Hue installed, you can skip this step

I installed Hue on my Ubutu 16.04 LTS. The official Instructions didn’t work but this works fine:

1.A Install & compile Hue:

There isn’t any binary package thus we need to install all pre-requisites to compile with make

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

Download and Compile:

git clone https://github.com/cloudera/hue.git
cd hue
make apps

 

1.B Start and connect

To start Hue:

build/env/bin/hue runserver_plus localhost:8888
  • runserver_plus: is like runserver with debugger
  • localIP: Port, usually Hue uses 8888

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

Its a permission problem of your current user, you can use: sudo to start Hue

Issue 2: Could not connect to …

If you have downloaded Hue’s code from Git, Hive connection is active but not configured → you can skip this message

Issue 3: Address already in use

The port is in use or you have already a Hive process running

You can use ps -ef | grep hue, to find the pid and kill

 

2 Configure Apache Hue for Kylin

Our purpose is to add a snipped in a notebook with Kylin queries

References:

Register JDBC Driver

  1. We need to find the JAR Class for the JDBC Connector

           From Kylin Download Choose Binary and the correct version of Kylin and HBase

           Download & Unpack: in ./lib:

  1. Put this JAR in you Java ClassPATH using your .bashrc

           check the actual value: alt text

           check the permission for this file (Must be accessible for you):

  1. Add this new interface into your Hue.ini

           Where is my hue.ini ?

           * If you have downloaded your code form 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 this lines in [[interpreters]]

[[[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"}'
  1. Try to Start Hue and connect Like ‘Start and connect’

TIP: you will need one JDBC Source for each project

 

Register without password:

We can use this other format:

options='{"url": "jdbc:kylin://172.17.0.2:7070/learn_kylin","driver": "org.apache.kylin.jdbc.Driver"}'

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 ):

You can go to last line alt text

And launch Python Interpreter (see console icon on the right):

In my case: I've forgotten “ 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 :)

 

3 Test querie Example

Add in yours Kylin’s notebook:

alt text > alt text > alt text > alt text

Write a querie, like this:

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

And Execute with: alt text

                       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 Ago 2016, nor in 3.10 and 3.11, but the solution is very easy (Thanks to Shahab Tajik)

Link: You only need to change 3 lines in /desktop/libs/librdbms/src/librdbms/jdbc.py

 

4 Limits

Nowadays, in Hue 3.10 and 3.11

  • Auto-complete isn’t support on JDBC interfaces
  • Max 1.000 records. There is a limitation on JDBC interfaces, because Hue does not support result pagination Hue 3419
  • Obviously: It’s only read-only

 

5 Future Work

Dashboards

There is an amazing feature of Hue: Searh Dasboards / Dynamic Dashboards. You can ‘play’ with this Demo On-lineBut only works with SolR

There is a Jira to solve this: Hue 3228, RoadMap 4.1 Hue MailList and add Dashboards to JDBC connections

Chart & Dynamic Filter

Nowadays, Isn’t compatible, you only can work with Grid

I think the problem is that Hue don’t know how read Kylin Metadata Hue 4011

DB Query

alt text > alt text , Is not yet supported with JDBC

Now only supports Django Databases

   

For any suggestions, feel free to contact me

Thanks, Alberto