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

[KYUUBI #6869]Fix Beeline SQL querying cannot be stopped immediately by pressing Ctrl-C. #6879

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Whojohn
Copy link

@Whojohn Whojohn commented Jan 6, 2025

🔍 Description

Issue References 🔗

This pull request fixes #6869

Describe Your Solution 🔧

Expose isCancelled in KyuubiStatement ;And expose beeline cancelImmediate for user.

Why are the changes needed?

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

How was this patch tested?

This PR should recover CI and include negative and positive cases ;

Was this patch authored or co-authored using generative AI tooling?

No

@pan3793
Copy link
Member

pan3793 commented Jan 6, 2025

cc @link3280 @wForget

@pan3793
Copy link
Member

pan3793 commented Jan 6, 2025

the Kyuubi BeeLine is derived from Hive BeeLine(which is derived from SQLLine), does upstream BeeLine/SQLLine have similar functionalities?

@Whojohn
Copy link
Author

Whojohn commented Jan 7, 2025

the Kyuubi BeeLine is derived from Hive BeeLine(which is derived from SQLLine), does upstream BeeLine/SQLLine have similar functionalities?

SQLLine combine with flink jdbc without those problem.(BeeLine not test yet.)

SQLLine without those problem because cancel is work.

The fix way i try as fllow:

  1. Fix cancel problem
    When pressing Ctrl-C, Beeline calls statement.cancel. However, the AbstractOperation#cancelOperation and OperationManager#cancelOperation checks the state in the cleanup method, causing the cancel operation to be ignored if the state is FINISHED. This issue is due to kyuubi Flink's state being FINISHED, which is not allowed in the current state check. To fix this problem, it seems that the cancel operation does not finish the Flink fetch, causing Beeline to continue calling result.next. The more I try to fix it, the more I find it breaks through too many mechanisms.
  2. Fix this in BufferedRows as this pr done. (Because from now beeline depends on resultset.next but ignore cancel is calling.)

By the way flink sql cancel stuck problem is more complex. Those i fix just consider data keep coming.

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

Successfully merging this pull request may close these issues.

[Bug] Fix Beeline SQL querying cannot be stopped immediately by pressing Ctrl-C.
2 participants