Closed kshitij-badani closed 10 years ago
You can't supply multiple commands in the same call to fetch()
or execute()
. This is not a limitation of RBHive - it's how the Thrift service works. It isn't the same as the CLI interface, which would allow this.
I am using this gem to connect to the HiveServer via thrift and for the following sample query- i am getting parseException error
Query: RBHive.tcli_connect('my.host.name',10_000,{}) do |c| c.fetch("USE dbname;SHOW TABLES") end
Initializing transport buffered Connecting to HiveServer2 my.host.name on port 10000 Executing Hive Query: USE dbname;SHOW TABLES /usr/local/lib/ruby/gems/1.9.1/gems/rbhive-0.6.0/lib/rbhive/t_c_l_i_connection.rb:336:in'
raise_error_if_failed!': Error while processing statement: FAILED: ParseException line 1:7 missing EOF at ';' near 'dbname' (RuntimeError) from /usr/local/lib/ruby/gems/1.9.1/gems/rbhive-0.6.0/lib/rbhive/t_c_l_i_connection.rb:203:in
block in fetch' from /usr/local/lib/ruby/gems/1.9.1/gems/rbhive-0.6.0/lib/rbhive/t_c_l_i_connection.rb:294:inblock in safe' from <internal:prelude>:10:in
synchronize' from /usr/local/lib/ruby/gems/1.9.1/gems/rbhive-0.6.0/lib/rbhive/t_c_l_i_connection.rb:294:insafe' from /usr/local/lib/ruby/gems/1.9.1/gems/rbhive-0.6.0/lib/rbhive/t_c_l_i_connection.rb:200:in
fetch' from hive.rb:4:inblock in <main>' from /usr/local/lib/ruby/gems/1.9.1/gems/rbhive-0.6.0/lib/rbhive/t_c_l_i_connection.rb:56:in
tcli_connect' from hive.rb:3:in `However following works fine: RBHive.tcli_connect('my.host.name',10_000,{}) do |c| c.fetch("USE dbname")
c.fetch("SHOW TABLES") end