Skip to content

Conversation

@abhishekrb19
Copy link
Contributor

Migrate ITNestedQueryPushDownTest to the embedded test framework.

This specific test has particularly been very flaky on PRs often requiring multiple reruns . A few recent failed runs: https://github.com/apache/druid/actions/runs/19917476737/job/57101420884 and https://github.com/apache/druid/actions/runs/19696360296/job/56424984581

Kudos to @kfaraz for leading the efforts on the embedded test framework. The migration itself was quite straightforward. While porting the test, I noticed a SQL bug related to forcePushDownNestedQuery, please see the related disabled test.

This PR has:

  • been self-reviewed.
  • added integration tests.

…laky IT).

The ITNestedQueryPushDownTest has recently been very flaky.
So this patch migrates it to the Embedded test framework and hopefully
should resolve any flakiness in this IT for good.
@github-actions github-actions bot added the GHA label Dec 4, 2025
@kfaraz
Copy link
Contributor

kfaraz commented Dec 4, 2025

Thanks a lot for picking this up, @abhishekrb19 ! 🎉 🎉
I was about to take a look but you beat me to it. Thanks for saving me the trouble!! 🥳

@abhishekrb19
Copy link
Contributor Author

Thanks, @kfaraz! I've also added the original native queries for completeness. Please let me know what you think.
While doing so, I noticed that some of the utilities can be moved into QueryTestBase, so they can be shared across other embedded query tests. The other embedded query tests can also just extend QueryTestBase

* Hook for the additional setup that needs to be done before all tests.
*/
protected void beforeAll()
protected void beforeAll() throws IOException
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe generalize to just have throws Exception.

Copy link
Contributor

@kfaraz kfaraz left a comment

Choose a reason for hiding this comment

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

Looks good, left some suggestions.

);

// Nested group by query with force push down and renamed dimensions
cluster.callApi().verifySqlQuery(
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's put each query into a separate test method of its own, for both native and SQL cases.


final String sql = StringUtils.format(
"SET waitUntilSegmentsLoad = TRUE;\n"
+ "REPLACE INTO \"%s\" OVERWRITE ALL\n"
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be possible to use MoreResources.MSQ.INSERT_TINY_WIKI_JSON here?

Copy link
Contributor Author

@abhishekrb19 abhishekrb19 Dec 4, 2025

Choose a reason for hiding this comment

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

Yeah, I think so. The tiny_wiki* datasets contain a timestamp column, while the original wikiticker dataset used in this test has a time column, so switching between them breaks the test with InsertTimeNull: Null timestamp (__time) encountered during INSERT or REPLACE.. We could separately reconcile this by updating one of the datasets and relevant tests (probably tiny_wiki?) that will let us reuse things more cleanly; for now, I've just left this wikiticker query in.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for checking! Yeah, this shouldn't block the PR (this change is much needed! 😄 ).
We can dedupe later.

Comment on lines +384 to +386
broker.bindings()
.jsonMapper()
.writeValueAsString(new LocalInputSource(null, null, Collections.singletonList(wikiFile), null))
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be simplified in a manner similar to how MoreResources.MSQ.INSERT_TINY_WIKI_JSON does it?

@abhishekrb19 abhishekrb19 merged commit 9cfc715 into master Dec 4, 2025
56 checks passed
@abhishekrb19 abhishekrb19 deleted the migrate_nested_push branch December 4, 2025 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants