node-impala icon indicating copy to clipboard operation
node-impala copied to clipboard

Cannot get data of the sql query.

Open WangJiaoJo opened this issue 7 years ago • 5 comments

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 avatar Aug 31 '17 07:08 WangJiaoJo

Hi, ufukomer,

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

WangJiaoJo avatar Aug 31 '17 08:08 WangJiaoJo

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

ufukomer avatar Sep 01 '17 00:09 ufukomer

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!

WangJiaoJo avatar Sep 01 '17 05:09 WangJiaoJo

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

ufukomer avatar Sep 01 '17 13:09 ufukomer

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 [email protected]" 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!

WangJiaoJo avatar Sep 02 '17 04:09 WangJiaoJo