node-impala
node-impala copied to clipboard
Cannot get data of the sql query.
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!
Hi, ufukomer,
Could I ask one more question? Whether the connection configuration should include impala username and password? Thank you so much!
@WangJiaoJo I think your port should be 21000 (#8). You don't need to include your username and password, no authentication is required (#14).
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 Yes, probably. It does not support Kerberos. So, I should add an error to promise response. Let's keep this issue open.
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!