Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Impala queries through impala JDBC is running with empty user

avatar
Master Collaborator

Hi All,

 

I'm using zeppelin to run report using impala.

 

I downloaded impala JDBC to my linux machine, when i'm looking at the impala queries at cloudera manager, i see my queries running with empty user " ".

 

I didn't integrate LDAP authnitication yet with Impala.

 

I have 2 small questions:

 

1- where and how i can pass the user that i need the queries to run with in the impala JDBC?

 

2- How i can restrict only queries qith user specific to run.

1 ACCEPTED SOLUTION

avatar
Expert Contributor

I am very happy to report that this finally did the trick for me.  I had not thought to leave the PWD field blank but that was the answer.

 

Here is my final connection string that is working perfectly with DBeaver:

 

jdbc:impala://1.0.0.1:21050/mydb;AuthMech=3;UID=myuser;UseSasl=0;PWD=

 

@FawzeI think this issue can finally be marked as resolved

View solution in original post

37 REPLIES 37

avatar
Master Collaborator

Already tried this, I don't know how some can run query without user.

 

When i'm looking at CM i see akot of queries running with empty user and cann't localize the queries source and user, which make me hesitate to stop impala at my production cluster.

avatar
Master Collaborator

Anyone here who is familiar with apache zeppelin?

avatar
Master Collaborator

Any help?

avatar
Super Collaborator

Hi Fawze,

 

what version of the Impala JDBC driver are you using? What did you already try? The documentation of the latest version of the JDBC driver does not mention a "SID" parameter, but your connection string does. However, the documentation describes a "UID" parameter. Can you try using that one instead?

 

Cheers, Lars

avatar
Master Collaborator

Hi Lars,

 

In your comments before you asked me to check the UID and i mentioned the version 'm using, unfortunately, it doesn't work.

avatar
Super Collaborator

Hi Fawze,

 

That version should have been downloaded from Cloudera and as such the downloaded file comes with its own version number. The current version is 2.5.36. "ImpalaJDBC4.jar" is the name of the file, not the version.

 

What is the connection string you used? What was the error you received?

 

Thanks, Lars

avatar
Master Collaborator

jdbc:impala://ropr-dhc001:21050/;UID=fawze

 

Cloudera_ImpalaJDBC_2.5.5.1007.zip

 

No erros but the queries are running without user.

avatar
Super Collaborator

Your version of the driver seems to be 2.5.5. The current version is 2.5.36 and can be found here: http://www.cloudera.com/downloads/connectors/impala/jdbc/2-5-36.html

 

Please try again with the latest version and see if that help. The UID parameter should be supported there.

avatar
New Contributor
Using Cloudera JDBC41_2.5.38.

Tried various combinations but no luck using JDBC, user is empty.

DataSource ds = new com.cloudera.impala.jdbc41.DataSource();
ds.setURL("jdbc:impala://<host>:21050;UseSasl=0;UID=test;AuthMech=0");
ds.setUserID("test");
ds.setLoginTimeout(60);
ds.setCustomProperty("UID", "test");
ds.setCustomProperty("USER", "test");
ds.setLogLevel(LogLevel.TRACE.toString());
ds.setLogDirectory("C:\\temp\\impala_log");
String sql = "select ....";

try (Connection connection = ds.getConnection(); ResultSet rs = connection.createStatement().executeQuery(sql) {

// print

We do not have authentication turned on so I do get result back but "user" is empty on impalad host http://<impaladhost>:25000/queries
25000/queries



I see that in python -> impala/hiveserver2.py it tries to read from os environment variable ('USER', 'USERNAME') etc.
I tried to do TRACE log for cloudera but could not make much sense of logs.

If I use hue from cloudera manager then I do see user in impalad.

Any idea what can I do in Java JDBC without turning on User or User/Password authentication.
 

avatar
New Contributor

I have exactly the same empty username issue. My driver is Impala JDBC v2.5.41 and I am not using username/password authentication. Not having the user name makes searching queries by user impossible. Anyone here can help?