Repository navigation
Conversation
The merged column of a USING join is the left input coerced to the common type when the two input types differ. For binary-compatible types such as varchar vs text or int vs oid the parser emits a RelabelType, which CTranslatorQueryToDXL::TranslateJoinExprInFromToDXL rejected with an assertion that only allowed Var, FuncExpr and CoalesceExpr. On assert-enabled builds every such query fell back to the Postgres planner: CTranslatorQueryToDXL.cpp:4145: Failed assertion: IsA(join_alias_node, Var) || IsA(join_alias_node, FuncExpr) || IsA(join_alias_node, CoalesceExpr) References to join alias columns are flattened by CQueryMutators::NormalizeQuery before the join itself is translated, which is why the FuncExpr case already worked without any special handling. The projection element only has to be an expression the scalar translator understands, so drop the enumeration. Nodes the scalar translator does not support still raise the regular unsupported-feature exception and fall back cleanly. Add a regression case to join_gp covering varchar/text and int/oid USING columns, including the nested left join shape from the aggregates test.
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.
The merged column of a USING join is the left input coerced to the common type when the two input types differ. For binary-compatible types such as varchar vs text or int vs oid the parser emits a RelabelType, which CTranslatorQueryToDXL::TranslateJoinExprInFromToDXL rejected with an assertion that only allowed Var, FuncExpr and CoalesceExpr. On assert-enabled builds every such query fell back to the Postgres planner:
CTranslatorQueryToDXL.cpp:4145: Failed assertion:
IsA(join_alias_node, Var) || IsA(join_alias_node, FuncExpr) ||
IsA(join_alias_node, CoalesceExpr)
References to join alias columns are flattened by
CQueryMutators::NormalizeQuery before the join itself is translated, which is why the FuncExpr case already worked without any special handling. The projection element only has to be an expression the scalar translator understands, so drop the enumeration. Nodes the scalar translator does not support still raise the regular unsupported-feature exception and fall back cleanly.
Add a regression case to join_gp covering varchar/text and int/oid USING columns, including the nested left join shape from the aggregates test.
Fixes #ISSUE_Number
What does this PR do?
Type of Change
Breaking Changes
Test Plan
make installcheckmake -C src/test installcheck-cbdb-parallelImpact
Performance:
User-facing changes:
Dependencies:
Checklist
Additional Context
CI Skip Instructions