Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to connect node.js application to Impala?

How to connect node.js application to Impala?

New Contributor

Is there a recommended way to connect a Node.js application to Impala?   I cannot find and drivers in npmjs for it.   

 

 

thanks,

Ian

7 REPLIES 7

Re: How to connect node.js application to Impala?

Master Guru
If thrift is supported for node.js, you can try implementing a HS2 spec client to then connect to any ImpalaD's JDBC port via your node.js program.

The thrift interface file can be found at https://github.com/cloudera/hive/blob/cdh5.1.0-release/service/if/TCLIService.thrift

Re: How to connect node.js application to Impala?

New Contributor

Hello,

 

We are now in 2015, is there any update from Cloudera about this topic ?

Maybe a nodejs module is on its way ?

 

Thanks

Highlighted

Re: How to connect node.js application to Impala?

New Contributor

Hi,

 

I'm also looking for the same. If anyone found a solution, please provide a sample application to read data from impala in nodejs app.

Re: How to connect node.js application to Impala?

Cloudera Employee

I've never used node.js before but there seem to be two options:

 

1) As Harsh suggested, thrift can be used to generate an impala client. There is a generic thrift example is at https://thrift.apache.org/tutorial/nodejs . The best impala specific example I could find is a python test case but it should be very similar to what would be done in js https://github.com/cloudera/Impala/blob/cdh5-2.3.0_5.5.0/tests/hs2/test_fetch.py#L127 .

 

2) An easier option may be to use https://www.npmjs.com/package/jdbchttp://www.cloudera.com/content/www/en-us/downloads/connectors/impala/jdbc/2-5-29.html .

 

 

Re: How to connect node.js application to Impala?

New Contributor

Thanks for your response!

 

I used ODBC module read data from Impala and it's working fine.

Re: How to connect node.js application to Impala?

New Contributor

I've created a node module (Impala Client) but haven't published yet. I will make some changes then publish it soon. If you need it as module immediately mail me but if you only need the code that gathers data from HDFS using Impala just mimic the code in the test folder. The code in the test.js file is enough, I have tested it and it's working fine.

https://github.com/ufukomer/node-thrift-impala

Re: How to connect node.js application to Impala?

New Contributor

I've finally released Node Client module for Impala. It's very simple and practical. Check it out:

 

https://github.com/ufukomer/node-impala