[BugFix] Merge access groups in setUnnest to fix BE SIGSEGV with stac…#75012
[BugFix] Merge access groups in setUnnest to fix BE SIGSEGV with stac…#75012xhumanoid wants to merge 1 commit into
Conversation
…ked UNNESTs on the same array column Signed-off-by: Aliaksei Dziomin <diominay@gmail.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 84d0a853c1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| System.out.println("PLAN: " + plan); | ||
| // After fix: both c2_sub1 (used by t1.c2_sub1 in WHERE) and c2_sub2 (used by t2.c2_sub2) must | ||
| // be retained in the pruned type, otherwise BE crashes when reading the missing field. | ||
| assertVerbosePlanContains(sql, "[ARRAY<struct<c2_sub1 int(11), c2_sub2 int(11)>>]"); |
There was a problem hiding this comment.
Include backticks in the expected pruned type
When this test runs, the verbose plan formats complex types through ArrayType/StructType.toString(), and struct field names are emitted with backticks; the existing assertions in this class for the same array_struct_nest.c2 type also expect struct<c2_sub1 ...>. This new expected substring omits those backticks, so a corrected plan that retains both fields still will not contain this string and the added FE unit test will fail in CI.
Useful? React with 👍 / 👎.
| "from array_struct_nest, unnest(c2) as t(t1), unnest(c2) as tt(t2) " + | ||
| "where t1.c2_sub1 = 5"; | ||
| String plan = getVerboseExplain(sql); | ||
| System.out.println("PLAN: " + plan); |
There was a problem hiding this comment.
will remove it in next commit
[Java-Extensions Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[BE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
…ked UNNESTs on the same array column
Merge access paths into the input column's access group instead of overwriting.
Multiple UNNEST operators may share the same input array column (e.g. UNNEST(a), UNNEST(a)),
and each one's downstream consumers may need different subfields of the array element.
A hard put would drop access paths recorded by earlier UNNESTs and cause the scan to
prune subfields that are still needed, leading to BE crashes when reading missing fields.
Fixes #issue
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: