hive-driver icon indicating copy to clipboard operation
hive-driver copied to clipboard

trying out getting started examples, fails at client.openSession

Open myou opened this issue 3 years ago • 5 comments

I traced the code a little bit, in driver.openSession, action.execute(request) seems to hang, and the promise never resolves

confirmed local thrift is running via beeline

myou avatar Feb 03 '22 13:02 myou

needs more information how to reproduce, as openSession is checked in test pipeline https://github.com/lenchv/hive-driver/blob/master/tests/e2e/operations/data_types.test.js#L33

lenchv avatar Aug 20 '22 17:08 lenchv

Same here. I'm using https://github.com/big-data-europe/docker-hive at localhost 10000; The example hang at client.openSession.

addlistener avatar Sep 21 '22 07:09 addlistener

not sure if it is the same use.

background

I have setup a hive server with username & password node v18.7.0

code snippets

const promiseSession = client.openSession({
            client_protocol: TCLIService_types.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10
});

console.debug(await promiseSession)

When we await client.openSession promise, the entire node process exit with 0. No error found and no success hint.

davidkhala avatar Sep 30 '22 09:09 davidkhala

@davidkhala it is not related to this issue, but related to how nodejs works, try to wrap your code with IIFE

(async () => {
    const promiseSession = client.openSession({
                client_protocol: TCLIService_types.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10
    });

    console.debug(await promiseSession)
})()

lenchv avatar Sep 30 '22 09:09 lenchv

@davidkhala it is not related to this issue, but related to how nodejs works, try to wrap your code with IIFE

(async () => {
    const promiseSession = client.openSession({
                client_protocol: TCLIService_types.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10
    });

    console.debug(await promiseSession)
})()

@lenchv thanks for your prompt reply, actually it is just part of full text, and I am quite sure not a syntax error, but the process exit happend within client.openSession.

Here are the context https://github.com/davidkhala/node-databases/blob/main/hive/index.js

davidkhala avatar Sep 30 '22 10:09 davidkhala

@davidkhala sorry, didn't notice your reply back then, hope you found a solution for the problem. For the context, perhaps the issue happens inside the TCP connection itself, so you might try to subscribe on client events to figure out the core problem:

        this.connection = new hive.HiveClient(
            TCLIService,
            TCLIService_types
        );
        this.connection.on('error', console.debug);
        this.connection.on('close', () => console.log('connection closed'));

but this is strange the entire process crashes

lenchv avatar Mar 15 '24 15:03 lenchv