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

fix: avoid send empty record batch to client #796

Merged

Conversation

ShiKaiWi
Copy link
Member

@ShiKaiWi ShiKaiWi commented Mar 30, 2023

Which issue does this PR close?

Closes #

Rationale for this change

Currently, empty record batch will be generated by the datafusion, and will be sent to the client too. Avoid the empty record batch because it is a waste for both server and client.

What changes are included in this PR?

  • Avoid encoding the empty record batch into the SqlQueryResponse;

Are there any user-facing changes?

  1. The client won't receive any empty record batch;
  2. The schema information won't be sent to the client if the whole query response is empty;

As for the second cheanges, all the sdks has been tested for the compatibility.

How does this change test

Existing tests.

Copy link
Contributor

@chunshao90 chunshao90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chunshao90 chunshao90 added this pull request to the merge queue Mar 31, 2023
Merged via the queue into apache:main with commit 0831a84 Mar 31, 2023
chunshao90 pushed a commit to chunshao90/ceresdb that referenced this pull request May 15, 2023
@ShiKaiWi ShiKaiWi deleted the fix-avoid-empty-record-batch-in-sql-resp branch May 29, 2023 08:36
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

Successfully merging this pull request may close these issues.

2 participants