Commit 3946063
authored
[fix](fe) Fix struct field slot type in NestedColumnPruning for OFFSET-only access (#62446)
Problem Summary: When using struct_element() to access a string field
inside a struct (e.g., length(struct_element(struct_col, 'f3'))), the
NestedColumnPruning rule incorrectly returned Optional.empty() for the
slot type, causing the slot type to become nullable and lose its
original type information.
The fix changes the return value from Optional.empty() to
Optional.of(type) when the column is accessed in OFFSET-only mode (e.g.,
length()), ensuring the slot type remains the original type (e.g.,
varchar).
Release note: None
Test: Added test case in string_length_column_pruning.groovy1 parent 7ec32b4 commit 3946063
File tree
2 files changed
+2
-3
lines changed- fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite
- regression-test/suites/nereids_rules_p0/column_pruning
2 files changed
+2
-3
lines changedLines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
666 | 666 | | |
667 | 667 | | |
668 | 668 | | |
669 | | - | |
670 | | - | |
| 669 | + | |
671 | 670 | | |
672 | 671 | | |
673 | 672 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
0 commit comments