beeline -u 'jdbc:hive2://However, the result output format does not work properly::21050/default;auth=noSasl'
> show tables; customers dim_prod mansi sample_07 sample_08 small web_logs +-------+--+ | name | +-------+--+ +-------+--+Notice the output is not inside the columns? The better approach is to use Cloudera Impala JDBC Driver, please follow the steps below: 1. Download the driver from Cloudera Impala JDBC Driver 2. Extract the files and put it somewhere on the host that you need to run beeline command, in my case is under /root/impala-jdbc/jdbc 3. Run the following command to update the HADOOP_CLASSPATH to include the Impala JDBC Driver JARs
export HADOOP_CLASSPATH=`hadoop classpath`:/root/impala-jdbc/jdbc/*4. Finally you are ready to start beeline:
beeline -d "com.cloudera.impala.jdbc41.Driver" -u 'jdbc:impala://You will need to tell beeline the class name for the driver using “-d” option, in my case the driver class is com.cloudera.impala.jdbc41.Driver The output looks much better::21050;AuthMech=0'
> show tables; +------------+--+ | name | +------------+--+ | customers | | dim_prod | | mansi | | sample_07 | | sample_08 | | small | | web_logs | +------------+--+ 7 rows selected (0.219 seconds)However, the best way is to connect from impala-shell which is designed for Impala natively. Hope this helps.
Eric,
How do you set the impala resource pool in beeline from the command line?
This command doesnt work
beeline -u ‘jdbc:hive2://somehost:someport/db_name;principal=impala/Some Kerberos Principal’ -q ‘set REQUEST_POOL=root.FRW_Pool.fixed.other;’
Hi Vzeekan,
Sorry about the late reply and thanks for visiting my blog. I am on business trip in India, hence delayed response.
You can’t run “SET REQUEST_POOL={name}” command, but you can pass the REQUEST_POOL when connecting to Impala if you are using Cloudera Impala JDBC driver, see the doc below for reference:
https://www.cloudera.com/documentation/other/connectors/impala-jdbc/latest/Cloudera-JDBC-Driver-for-Impala-Install-Guide.pdf
On page 22, you can see example there:
jdbc:impala://localhost:18000/default2;AuthMech=3;UID=cloudera;PWD=cloudera;MEM_LIMIT=1000000000;REQUEST_POOL=myPool
Hope this helps.
Also, I believe that if you are using Cloudera Impala JDBC driver, the SET command should work, though I have not tested myself yet. Worth a try.
Cheers
Hi There!
I tried with the JDBC 4.1 2.5.37 driver and get NPE without stacktrace
“`
[email protected]:~/impala-jdbc$ beeline -d “com.cloudera.impala.jdbc41.Driver” -u ‘jdbc:hive2://elephant:21050/default;LogLevel=6;LogPath=`pwd`;principal=impala/elephant@COE.CLOUDERA.COM;AuthMech=1;’
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0
2019-07-11 11:17:38,747 WARN [main] mapreduce.TableMapReduceUtil: The hbase-prefix-tree module jar containing PrefixTreeCodec is not present. Continuing without it.
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0
Connecting to jdbc:hive2://elephant:21050/default;LogLevel=6;LogPath=`pwd`;principal=impala/elephant@COE.CLOUDERA.COM;AuthMech=1;
java.lang.NullPointerException
Beeline version 1.1.0-cdh5.9.0 by Apache Hive
0: jdbc:hive2://elephant:21050/default (closed)> !q
java.lang.NullPointerException
java.lang.NullPointerException
“`
Hi Jose,
The connection string should be “jdbc:impala://elephant:21050” instead of “jdbc:hive2://elephant:21050”. Please give it a try.
Cheers
Eric