Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,7 @@ public Optional<DataType> pruneDataType() {
return Optional.of(type);
} else if (isStringOffsetOnly) {
// Only the offset array is accessed (e.g. length(str_col)).
// The slot type stays unchanged (varchar); the access path tells BE to skip char data.
return Optional.empty();
return Optional.of(type);
} else if (!accessPartialChild) {
return Optional.empty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ suite("string_length_column_pruning") {
contains "OFFSET"
notContains "type=bigint"
}
//sql "select length(struct_element(struct_col, 'f3')) from slcp_str_tbl"
sql "select length(struct_element(struct_col, 'f3')) from slcp_str_tbl"
// length() in both SELECT and WHERE: predicate must remain length(str_col) > 1,
// never be rewritten to CAST(str_col AS int) > 1. Slot type must stay varchar.
explain {
Expand Down
Loading