forward3d / rbhive

Ruby gem for querying Apache Hive
http://www.forward3d.com
MIT License
98 stars 75 forks source link

Set credentials #42

Open HSDen opened 8 years ago

HSDen commented 8 years ago

Hi,

How do we set authentication params like user and password, while using tcli_connect or connect methods?

lloydpick commented 8 years ago

There is a PR https://github.com/forward3d/rbhive/pull/23 that offers Kerberos connectivity, but this is yet to be merged into master.

0bserver07 commented 8 years ago

@Selenium-hari here is an example:


RBHive.tcli_connect('address', 10_000, { transport: :sasl,:sasl_params  => {:username => "username",:password  => "password"},logger: Logger.new(STDOUT), hive_version: 10 }) do |connection|
  connection.fetch 'SELECT * FROM users LIMIT 5'
end