Repository navigation
Conversation
… mode EARLY_FIRE is a streaming interval-join hint, but it is registered as a JoinStrategy, so the batch join rules passed it to checkJoinStrategyValid. That method has no case for it and threw "Unknown join strategy : EARLY_FIRE" for every batch query with the hint, inner joins included. Skip the hint there, as is already done for LOOKUP, so the batch planner chooses the join as if no hint were given. Also stop containsJoinStrategyHint from counting it: a join marked as hinted is never turned into an adaptive join, so the ignored hint would otherwise still change the batch plan under the default configuration.
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
EARLY_FIREis a streaming interval-join hint, but it is registered as aJoinStrategy. In batch mode the join rules passed it toBatchPhysicalJoinRuleBase#checkJoinStrategyValid, which has no case for it, so every batch query with the hint failed at planning withUnknown join strategy : EARLY_FIRE, inner joins included. This pull request makes batch mode ignore the hint, so such a query plans exactly as it would without the hint.Brief change log
BatchPhysicalJoinRuleBase#checkJoinStrategyValidreturns(false, false)forEARLY_FIRE, as it already does forLOOKUP, so the batch rules skip the hint and choose the join as if no hint were given.JoinUtil#containsJoinStrategyHintno longer countsEARLY_FIRE. Otherwise the batch hash join and sort-merge join rules mark the join as hinted, which keeps it from becoming an adaptive join, so the ignored hint would still change the plan under the default configuration. A real strategy hint next toEARLY_FIREstill marks the join as hinted.Verifying this change
This change added tests and can be verified as follows:
plan/hints/batch/EarlyFireJoinHintTest. For a LEFT and an INNER interval join, it plans the query with and without the hint, with adaptive broadcast join enabled as in the default configuration. It checks that the plan without the hint contains anAdaptiveJoin, then that the optimized physical and execution plans with the hint are identical to it.EarlyFireJoinHintTest#testStrategyHintStillAppliesWithEarlyFirechecks thatEARLY_FIREnext toSHUFFLE_MERGE(o)plans exactly likeSHUFFLE_MERGE(o)alone, with noAdaptiveJoin, so the user's strategy hint is still honored.checkJoinStrategyValidchange the tests fail withUnknown join strategy : EARLY_FIRE. Without thecontainsJoinStrategyHintchange the two hint-only tests fail because the hinted plan is a plainHashJoininstead of theAdaptiveJoin.EarlyFireJoinHintTest,AdaptiveJoinTestandAdaptiveJoinBatchRestoreTeststill pass.Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code 2.1.322 (Claude Opus 5.5)