Skip to content
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

Query execution fails with multiple database connection #65

Open
HDNidhishree opened this issue Aug 30, 2022 · 1 comment
Open

Query execution fails with multiple database connection #65

HDNidhishree opened this issue Aug 30, 2022 · 1 comment

Comments

@HDNidhishree
Copy link

HDNidhishree commented Aug 30, 2022

Hi,

We are executing a query connecting with Trino (Postgres catalog, big query catalog).

We found an issue while executing a query which connects to both of the databases. However the query works fine with 2 joins. But if we use more than 2 joins in the query, the query fails with the following error.

/opt/trino/trino-server/app/node_modules/presto-client/lib/presto-client/index.js:355
if (response.stats.state === 'QUEUED'
^

TypeError: Cannot read property 'state' of undefined
at /opt/trino/trino-server/app/node_modules/presto-client/lib/presto-client/index.js:355:36
at IncomingMessage. (/opt/trino/trino-server/app/node_modules/presto-client/lib/presto-client/index.js:133:13)
at IncomingMessage.emit (events.js:326:22)
at IncomingMessage.EventEmitter.emit (domain.js:483:12)
at endReadableNT (_stream_readable.js:1241:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)`

We are using presto-client package inside a moleculer service. We have deployed our application on premises.

Flow of query generation and execution of query:

  1. We get all the columns from all the database tables that user selects.

  2. Add those column names in the select query which has multiple joins.

  3. Execute the query using presto-client and the result is fetched by accumulating the data retrieved in chunks in the data method
    data [function(error, data, columns, stats) :optional], then push this data result into an array, and finally after all the data is fetched in the success method we are formatting the array data as per our need.

    Please help us out in fixing this issue and do the needful.

Thanks in advance.
app (2).txt

@HDNidhishree
Copy link
Author

@tagomoris Can you please provide an update for this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant