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

Always fire QueryCompletedEvent for DDL queries #24651

Merged
merged 2 commits into from
Jan 10, 2025

Conversation

lukasz-stec
Copy link
Member

@lukasz-stec lukasz-stec commented Jan 8, 2025

Description

Previously the event was fired because client protocol
is reading the final query info. That is brittle and theoretically
could be removed making DDL queries fail to trigger query completed event.

Additional context and related issues

A slightly changed version of #24354

Release notes

( X) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

## Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Jan 8, 2025
@lukasz-stec lukasz-stec force-pushed the ls/2501/02-ddl-completed-event branch from c9ee13b to 3fe314c Compare January 8, 2025 11:12
It is needed to test the query execution without reading the
final query info which triggers the QueryCompletedEvent
@lukasz-stec lukasz-stec force-pushed the ls/2501/02-ddl-completed-event branch from 3fe314c to 644161f Compare January 8, 2025 12:08
@lukasz-stec lukasz-stec marked this pull request as ready for review January 8, 2025 13:13
@lukasz-stec lukasz-stec requested a review from dain January 8, 2025 13:13
@ksobolew
Copy link
Contributor

ksobolew commented Jan 8, 2025

Well, there's #24354 too :)

@lukasz-stec
Copy link
Member Author

Well, there's #24354 too :)

Yeah, I mentioned this in the description. This is a slightly refactored version. We can go with your PR too if you want.,

@ksobolew
Copy link
Contributor

ksobolew commented Jan 8, 2025

Yeah, I mentioned this in the description

Oh, you did indeed. I guess I only read the first section. (But the code did look familiar!)

Copy link
Contributor

@ksobolew ksobolew left a comment

Choose a reason for hiding this comment

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

LGTM

try (StandaloneQueryRunner queryRunner = new StandaloneQueryRunner(testSession())) {
queryRunner.installPlugin(new MemoryPlugin());
queryRunner.createCatalog("memory", "memory");
Set<String> queryCompletedQueryIds = new HashSet<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be synchronized somehow?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it should. Good catch.

@lukasz-stec lukasz-stec force-pushed the ls/2501/02-ddl-completed-event branch from 644161f to 973ea75 Compare January 9, 2025 09:00
Previously the event was fired because client protocol
is reading the final query info. That is brittle and theoretically
could be removed making DDL queries fail to trigger query completed event.
@lukasz-stec lukasz-stec force-pushed the ls/2501/02-ddl-completed-event branch from 973ea75 to 95f4b16 Compare January 9, 2025 09:00
@lukasz-stec lukasz-stec requested a review from ksobolew January 9, 2025 09:00
Copy link
Contributor

@ksobolew ksobolew left a comment

Choose a reason for hiding this comment

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

It's fine by me, FWIW

@hashhar hashhar merged commit 34fce45 into trinodb:master Jan 10, 2025
94 checks passed
@hashhar hashhar deleted the ls/2501/02-ddl-completed-event branch January 10, 2025 13:34
@github-actions github-actions bot added this to the 469 milestone Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants