-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
connect hive database using node js #66
Comments
@ArunKarthick-pss could you share an error and the code that reproduces it? Also, did you manage to connect using other clients such as "beeline" from that computer? Are you sure that host is accessible from the computer? |
@lenchv,this is my code,Here I put log for both client and session variable.The client variable returns circular json response and session variable does not return anything.so please help me on this. const hive = require('hive-driver'); client.connect(
).then(async client => { console.log('session',session);
}).catch(error => { |
@ArunKarthick-pss I see, I get the same behavior with your code if I try to connect to the Hive Server with LDAP authentication strategy. Could you change your code the following way:
Notice, that I use |
@lenchv I tired to implement which you have given the code above.But it is not working.The below following error will be shown. getaddrinfo ENOTFOUND xxxxxx |
@ArunKarthick-pss do you have this error during connecting or session opening? Are you sure the hostname you are trying to connect is accessible?
|
@lenchv, the hostname accessibility is working fine,while I implement PlainTcpAuthentication,the hostname connection is not working in my code.please find the below code. const hive = require('hive-driver');
}).catch(error => { In my above code,I have put logs for client and session variable.but both the variable does not return anything. |
@ArunKarthick-pss well, I have an assumption that the issue is in lib/connection/transports/TcpTransport.ts
The difference between NoSaslAuthentication and PlainTcpAuthentication that NoSaslAuthentication doesn't wait until connect is done, and it is why you don't have an error in it. But PlainTcpAuthentication does, and apparently connection breaks because there is something wrong with hostname resolving. Try to figure out whether you can create a simple TCP connection:
See net.createConnection options, perhaps you need some specific ones. Also, you can make sure that node js properly resolves your hostname:
And if on your system "nslookup " works properly, you can try to pass directly IP address instead of hostname. If you manage to connect with some specific options, I can update the library, or you can send a pull request. |
@lenchv I have tired for both net and dns checking with my hostname. It's working fine.But still the session can't be established.Please help me on this |
Hi @lenchv,please help on above which I have mentioned issue. |
@ArunKarthick-pss Unfortunately I cannot reproduce such behavior. I need your help to figure out what is wrong with the connection and find out how to fix it. Try to debug step-by-step and find exactly on what lines the connection fails. Also, try to narrow down the issue, if your are able to connect using simple snippet I shared above, then try to authenticate manually. The below code initiates TCP Plain authentication:
Did you also try using a resolved IP address instead of hostname? Also, what are HiveServer logs? Does it output anything? |
I easily can get the same error if I try to connect to non-existing hostname, which is definitely cannot be resolved:
Are you sure the hostname you typed is correct? |
@lenchv Here I have write two functions, first one is hive database connection and second one is session establishment to hive database, the connection is working fine but the session establishment function does not return anything please refer the code below.If anything I am wrong please correct it. const thrift=require('thrift') //Create a Thrift client const createHiveConnection=async()=>{
}) connection.on('error',(err)=>{
} createHiveConnection() const executeQuery=async()=>{
} executeQuery() |
@lenchv ,
|
|
I have tired to connect hive database from node js using hive-driver npm package.But the session can't be established.This is the major issue for this package.my node version is 16.5.0 and my npm version is 8.5.5. If any other solution is there,please let me know
The text was updated successfully, but these errors were encountered: