ufukomer / node-impala

Node Client for Impala using Apache Thrift
https://www.npmjs.com/package/node-impala
MIT License
31 stars 12 forks source link

Cannot get data of the sql query. #16

Open WangJiaoJo opened 7 years ago

WangJiaoJo commented 7 years ago

Hi, ufukomer,

I use Node.js to run the code, here is my code, `var impalaDB = require('node-impala'); const client = impalaDB.createClient();

client.connect({ host: '10.2.18.185', port: 21050, resultType: 'json-array' }) .then(function (message) { console.log(message); //this output 'Connection established' }) .catch(function (err) { console.log(err); });

client.query('show databases') .then(result => console.log(result)) .catch(err => console.error(err)) .done(() => client.close().catch(err => console.error(err))); //here output nothing `

Could you please explain why the query doesn't output anything, result or err? Thank you so much!

WangJiaoJo commented 7 years ago

Hi, ufukomer,

Could I ask one more question? Whether the connection configuration should include impala username and password? Thank you so much!

ufukomer commented 7 years ago

@WangJiaoJo I think your port should be 21000 (#8). You don't need to include your username and password, no authentication is required (#14).

WangJiaoJo commented 7 years ago

Hi, ufukomer,

I have changed the port to 21000. But the result is same as previous. Only output the "Connnection established" but the query statement still output nothing. Is that because the server that I use open the Kerberos authentication?

Thank you so much!

ufukomer commented 7 years ago

@WangJiaoJo Yes, probably. It does not support Kerberos. So, I should add an error to promise response. Let's keep this issue open.

WangJiaoJo commented 7 years ago

Hi, ufukomer, Thanks so much!

Also, I have tried another way. Before I run the command "node impala.js", I type the command "kinit -kt /root/eedep.keytab eedep@DFMCIT.COM" in the terminal on the server which could authenticate Kerberos.

While this not works, do you think this way has some reasonability?

Let's keep focus on this issue!