There appears to be an issue with using SET commands where there are leading spaces in the query. This affects Hive 2 #tcli_connect with options { :hive_version => 12 }. In Hive 1 with #connect, however, this appears to work as expected. Compare the working:
RBHive.tcli_connect('hive.example.com', 10002, { :hive_version => 12 }) do |conn|
conn.execute("SET mapred.fairscheduler.pool=swimming")
conn.execute("SELECT * FROM chairs")
end
which results in mapred.fairscheduler.pool being set to swimming, with the seemingly faulty:
RBHive.tcli_connect('hive.example.com', 10002, { :hive_version => 12 }) do |conn|
conn.execute(" SET mapred.fairscheduler.pool=swimming")
conn.execute("SELECT * FROM chairs")
end
RBHive.tcli_connect('hive.example.com', 10002, { :hive_version => 12 }) do |conn|
conn.execute(%Q{
SET mapred.fairscheduler.pool=swimming
})
conn.execute("SELECT * FROM chairs")
end
which results in SET mapred.fairscheduler.pool being set to swimming and the setting not being applied (note the leading SET).
There appears to be an issue with using
SET
commands where there are leading spaces in the query. This affects Hive 2#tcli_connect
with options{ :hive_version => 12 }
. In Hive 1 with#connect
, however, this appears to work as expected. Compare the working:which results in
mapred.fairscheduler.pool
being set toswimming
, with the seemingly faulty:which results in
SET mapred.fairscheduler.pool
being set toswimming
and the setting not being applied (note the leadingSET
).