Closed karladler closed 8 years ago
@abimelex Could you try to create connection with callback and catch errors for being sure if the connection is started or not?
const config = { /* Your config here... */ }
client.connect(config)
.then((res) => console.log('Success', res))
.catch((err) => console.error(err));
Already did this. Returns 'Connection is established.'
client.connect({
host: 'REDACTED',
port: 21050,
resultType: 'json-array'})
.then((message) => {
console.log(message);
})
.catch(error => console.error(error));
const query = `SELECT item_id FROM table.name`
client.query(query)
.then(result => console.log(result))
.catch(err => console.error(err))
.done(() => client.close().catch(err => console.error(err)));
@abimelex the port should be 21000 in default, there is also connection on 21050 in cloudera. Maybe it creates a connection but cannot create client object because of wrong port number. If you know what to do and changed your impala thrift port as 21050 it should work in this way. It returns 'Connection is established'
when connect
event is triggered in here. Maybe the connect
event is not working correctly, I don't trust that thrift
module. Could you write a test under your node_modules
to understand the problem (example). You can do this either cloning this repo or creating test
folder under your node_modules/node_impala/..
directory.
Real world example (works perfectly): https://github.com/ufukomer/bloomery/blob/master/src/server.js#L47-L49
Yea it is about port! I got the same error when I change my port as 21050:
So I shouldn't send a success message when the wrong connections is established, and you should also change your port as 21000.
Seems legit! I changed the port and it worked. But I guess this is using Hive now, which is a lot slower. Is it somehow possible to use Impala?
No, it is using impala but data is stored inside the hive warehouse so that is why we use Beeswax. Btw it is not possible to use Hive with this module. Because hive uses hiveserver2 and it requires authentication, so it's not possible right now. If you try to switch off Hive and run your query it would still work (for proof).
Don't forget that Beeswax limits the results (max: 1000).
Cool, thanks for the short introduction, I must admit that I havn't any glue of Hadoop etc. I'm just the guy using it's API ;) So I guess this issue can be close. Thanks again!
Using the example there: from https://www.npmjs.com/package/node-impala I got the following error:
The connection to the server seems to be established, but I can not execute the query.