Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Graphs in JDBC notebook not working

Highlighted

Graphs in JDBC notebook not working

New Contributor

I installed Hue 3.11 and started using the graphs option provided in Hive Notebook which seems to be working fine. I added Presto connectivity via JDBC and ran queries in the Presto JDBC notebook. I then selected the Graphs option.
I can see a field for entering the column for X axis but do not see a field for the Y axis.

Is this a bug or are graphs just not supported for the JDBC notebooks ?

8 REPLIES 8
Highlighted

Re: Graphs in JDBC notebook not working

What are the types of the columns in the result?
(you can see them in the column list)
Highlighted

Re: Graphs in JDBC notebook not working

New Contributor

All the columns are one of the following type:

timestamp

string

date

 

Some of the string field are actually numeric so i ran the query as:

 

select cast(sourceno as integer), cast(destno as integer) from test.analyticdb.logdata

Highlighted

Re: Graphs in JDBC notebook not working

New Contributor

i can see the graph if i run the same query directly against Hive (using the Hive query editor)

Highlighted

Re: Graphs in JDBC notebook not working

Seems like the JDBC metadata is incorrect, could you check what you get
here?
https://github.com/cloudera/hue/blob/master/desktop/libs/notebook/src/notebook/connectors/jdbc.py#L1...
Highlighted

Re: Graphs in JDBC notebook not working

New Contributor

The query returns the following types:

 

INTEGER

VARCHAR

 

I've since debugged the code and noticed that there is a check for numeric data types after getting the metadata of the columns. This check is done against an array which currently  does not contain 'INTEGER'

 

function isNumericColumn(type) {

      return $.inArray(type, ['TINYINT_TYPE', 'SMALLINT_TYPE', 'INT_TYPE', 'BIGINT_TYPE', 'FLOAT_TYPE', 'DOUBLE_TYPE', 'DECIMAL_TYPE', 'TIMESTAMP_TYPE', 'DATE_TYPE']) > -1;

    }

 

The Hive query against the same table works because it returns the following types:

 

INT_TYPE

STRING_TYPE

 

as can be seen above, the INT_TYPE is present in the array.

Highlighted

Re: Graphs in JDBC notebook not working

New Contributor

Is there a resolution to this? We have a query returning Integer and BigInt and these are part of the array INT_TYPE and BIGINT_TYPE. We still don't see the columns in y axis.

 

Thanks,

Goutam

Highlighted

Re: Graphs in JDBC notebook not working

If you do this one line change:
https://github.com/cloudera/hue/commit/5c1b1fb36767be664227fe2c8456703dbc179e86
Does it work?

If not, do you have a screenshot of the list of columns and their types?
Highlighted

Re: Graphs in JDBC notebook not working

New Contributor

Awesome!! this worked..Thanks a lot..

Don't have an account?
Coming from Hortonworks? Activate your account here