Reputation: 6871
I'm trying to execute the following Hive query:
"USE DATABASE1; SHOW TABLES"
Returns the following error:
HiveServerException: Error while compiling statement: FAILED: ParseException line 1:13 missing EOF at ';' near 'DATABASE1'
Upvotes: 1
Views: 10649
Reputation: 139
You can simply use the below command to get it done.
show tables in <YOUR_DATABASE_NAME>;
Upvotes: 3
Reputation: 3897
I could not get hive to reproduce your error but this might help.
Don't submit with quotes around it and make sure you close your last line with ";". Use this code here:
use database1; show tables;
Upvotes: 1
Reputation: 23949
Untested, but some simple database APIs don't support multiple statements very well. Looking at the API, try something like this:
RBHive.connect(address, port) do |connection|
connection.execute('USE DATABASE1')
connection.fetch('SHOW TABLES')
end
Upvotes: 0