Specifiy "use database" in Hadoop Hive HQL query
Posted on December 3, 2012 at 1:08pm
We have multiple databases defined in Hive. In Hive command line mode or a script I can issue "use database" followed by a query (example below). When I try to specify the use database in the report query dialog I get an errror. Also I replaced /defualt at the end of JDBC connection string with my database name and it did not like that. Is there a method to specify a database name?
select * from test_table;
Posted on November 5, 2013 at 7:00am
Unfortuately the JDBC Hive driver only allows connecting to the "default" database (this is not a Jaspersoft limitation but a JDBC Hive driver one) - so to get around this just use the table aliasing in dot notation, like this:
select * from store.sales
Connects to database store, table sales!
This is the page that points out the limitation in Hadoop Hive JDBC driver: