Closed colinmarc closed 8 years ago
OK so as soon as I wrote this I spotted your recent merge! However updating the code to read like this:
#!/usr/bin/env ruby
require 'rubygems'
require 'impala'
Impala.connect(url, port, options: {kerberos: {host: host, provider: provider}, username: user, password: password}) do |conn|
puts conn.open?
puts conn.inspect
conn.query('refresh table_name;')
end
Doesn't change the error message. Can you give me a quick example on how to use these new fields? Afraid I can't show the variable contents I'm using because my employer wouldn't be too happy if I did.
@MorganSadr I think the argument is principal
rather than provider
. I also wrote to take either:
{kerberos: {host: 'host', principal: 'principal'}}
or
{sasl: {username: 'username', password: 'password'}}
But not both. But I don't actually understand kerberos so that could be wrong.
@colinmarc Ahh right thanks. I'll give that a go tomorrow and report back. If/when I get something working I'll submit a PR for the README too.
@colinmarc so I got this working in the end:
Impala.connect(url, port, kerberos: { host: host, principal: "#{service}/#{host}@#{realm}" }) do |conn|
results = conn.query(query)
puts results
end
Where url and host are actually the same thing. Unfortunately I have run into this bug as I am running on MacOS so my script segfaults as it finishes. In any case that is the syntax that worked for me. :)
Thanks for your help!
Ok, going to close this, in that case; thanks for the report!
Hi Colin,
Are you still working on this? I'd like to use this gem to connect a rails app I have to an Impala Hadoop instance with Kerberos authentication. Currently using this gem: but it isn't actively developed anymore and doesn't support refresh statements. At the moment using this code:
I get: