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

HiveUtils.fetchAll fetches one block too many #21

Open
fjakobs opened this issue Jul 8, 2022 · 2 comments
Open

HiveUtils.fetchAll fetches one block too many #21

fjakobs opened this issue Jul 8, 2022 · 2 comments
Labels
Component: Core Issues related to DBSQLClient, DBSQLSession, and DBSQLOperation

Comments

@fjakobs
Copy link
Contributor

fjakobs commented Jul 8, 2022

I noticed that HiveUtils.fetchAll calls driver.fetchResults twice for small operations that fit in a single response. Apparently checkIfOperationHasMoreRows returns true if the response contains any rows regardless of the hasMoreRows value provided by the server.

This might not be a big issue for fetching large datasets but for small operations on high latency connections this is pretty impactful.

@susodapop
Copy link
Contributor

Thanks for calling attention to this.

Since this project started as a fork of Hive-driver, it integrates the official Apache Hive thrift definition. Databricks maintains backwards compatibility with this definition. But unfortunately the Hive thrift definition has a quirk where it always sends hasMoreRows==false regardless whether more rows are available at the server. Thus we fetch twice to guarantee nothing was left behind on the server.

In the coming quarter we'll transition this connector to use our own thrift definition which has been revised to include sensible hasMoreRows behaviour.

cc: @moderakh

@fjakobs
Copy link
Contributor Author

fjakobs commented Jul 26, 2022

Nice!

@kravets-levko kravets-levko added the Component: Core Issues related to DBSQLClient, DBSQLSession, and DBSQLOperation label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Core Issues related to DBSQLClient, DBSQLSession, and DBSQLOperation
Projects
None yet
Development

No branches or pull requests

3 participants