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

[FLINK-32219][sql-client] Fix SqlClient hangs when executing EXECUTE PLAN statement #22703

Merged
merged 2 commits into from
Jun 6, 2023

Conversation

LadyForest
Copy link
Contributor

What is the purpose of the change

This PR fixes the issue that the COMPILE AND EXECUTE PLAN or EXECUTE PLAN statement causes the SQL client to hang forever. The reason is that OperationExecutor didn't take these two kinds of operation kind into account. Instead, they should be dealt with like ModifyOperation.

Brief change log

  • LetOperationExecutor cope with ExecutionPlanOperation and CompileAndExecutePlanOperation.
  • TableEnvironmentImpl should apply TABLE_DML_SYNC for both ModifyOpeartion and ExecutePlanOperation. Both of them are compiled from insert into queries.

Verifying this change

  • Add plan-related tests in theinsert.q to verify that the EXECUTE PLAN and COMPILE AND EXECUTE PLAN statements work as expected after the fix.
  • Verify the SqlClient works normally after submitting EXECUTE PLAN statement.
    image

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? not applicable

@flinkbot
Copy link
Collaborator

flinkbot commented Jun 5, 2023

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@LadyForest
Copy link
Contributor Author

@fsk119, could you help to review the fix when you're available?

@fsk119 fsk119 self-requested a review June 6, 2023 03:38
Copy link
Member

@fsk119 fsk119 left a comment

Choose a reason for hiding this comment

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

Thanks for your fix. I left some minor suggestions.

@LadyForest LadyForest requested a review from fsk119 June 6, 2023 08:30
Copy link
Member

@fsk119 fsk119 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@fsk119 fsk119 left a comment

Choose a reason for hiding this comment

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

LGTM

@fsk119 fsk119 merged commit 83ba6b5 into apache:master Jun 6, 2023
LadyForest added a commit to LadyForest/flink that referenced this pull request Jun 7, 2023
xiangyuf pushed a commit to xiangyuf/flink that referenced this pull request Dec 13, 2023
* [FLINK-32396][jdbc-driver] Support timestamp and timestamp_ltz for jdbc driver…
* [FLINK-33000][sql-gateway] SqlGatewayServiceITCase should utilize…
* [FLINK-33000][sql-gateway] OperationManagerTest should utilize…
* [FLINK-33000][sql-gateway] ResultFetcherTest should utilize…
* [FLINK-32219][sql-client] Fix SqlClient hangs when executing EXECUTE PLAN statement (apache#22703)
* [FLINK-31956][table] Extend COMPILE PLAN statement to read/write from/to Flink FileSystem
* [FLINK-32661][sql-gateway] Fix unstable OperationRelatedITCase.testOperationRelatedApis
* [FLINK-32512][table] Don't register resource to user resource manager when…
* [FLINK-32309][sql-gateway] Use independent resource manager for table environment (apache#22768)
* fix
* [FLINK-32299][gateway] Upload python jar when sql contains python udf jar
* [FLINK-31956][table-planner] Fix COMPILE PLAN statement fails to write to file…

https://code.byted.org/inf/flink/merge_requests/5796
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.

3 participants