Fix subfield pushdown arg index for selecting entire struct column #25471
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.
Summary: Currently, seeing index out of range errors for cases when a struct column is read, but none of its subfields are referenced
Reviewed By: rschlussel
Differential Revision: D76869401
Test Plan
For cases when the struct column does not have any of its subfields referenced, the fb_reshape_row expression is passed into the toSubfield method

When a subfield is actually read in the query, a DEREFERENCE is passed in

In the dereference case, the elements immutablelist builder will have at least one element. In the first case, the list builder will be empty
Manual tests:
Verifier query that caught the empty subfields bug:
0.294-edge2: 20250618_024807_00003_snxkc. Failed with index out of range
0.294-20250618.023458-171: 20250618_025504_00004_29vsz succeed
Arg pushdown
20250618_025745_00008_29vsz correct query plan with pushed down subfield
20250618_025948_00010_29vsz query plan with non relevant function
20250618_030040_00011_29vsz expected plan
Release Notes
Please follow release notes guidelines and fill in the release notes below.