Skip to content

[fix](fe) Fix struct field slot type in NestedColumnPruning for OFFSET-only access#62446

Merged
HappenLee merged 1 commit intoapache:masterfrom
HappenLee:fix-struct-field-slot-type
Apr 14, 2026
Merged

[fix](fe) Fix struct field slot type in NestedColumnPruning for OFFSET-only access#62446
HappenLee merged 1 commit intoapache:masterfrom
HappenLee:fix-struct-field-slot-type

Conversation

@HappenLee
Copy link
Copy Markdown
Contributor

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.groovy

…T-only access

Issue Number: close #xxx

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.groovy
@HappenLee
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@hello-stephen
Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 100.00% (1/1) 🎉
Increment coverage report
Complete coverage report

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Apr 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@HappenLee HappenLee merged commit 3946063 into apache:master Apr 14, 2026
30 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants