fix: support CAST/TRY CAST expressions for return_field_from_args - #24334
Open
dd-annarose wants to merge 1 commit into
Open
fix: support CAST/TRY CAST expressions for return_field_from_args#24334dd-annarose wants to merge 1 commit into
dd-annarose wants to merge 1 commit into
Conversation
Functions like date_part require the value of one of their arguments to determine their return type. This commit adds support for CAST/TRY_CAST in addition to Literal values. This change is required as constant-folding cannot run before analysis. It casts logical fields once (not per row) so there is no impact in terms of performance.
dd-annarose
force-pushed
the
annarose/constant-date-part
branch
from
August 13, 2026 16:20
bcc580c to
14b61b5
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #24334 +/- ##
==========================================
- Coverage 81.29% 81.14% -0.16%
==========================================
Files 1110 1112 +2
Lines 385336 386940 +1604
Branches 385336 386940 +1604
==========================================
+ Hits 313261 313967 +706
- Misses 53594 54478 +884
- Partials 18481 18495 +14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Which issue does this PR close?
Rationale for this change
Functions like date_part require the value of one of their arguments to determine their return type.
This PR adds support for CAST/TRY_CAST in addition to Literal values.
This change is required as constant-folding cannot run before analysis. It casts logical fields once (not per row) so there is no impact in terms of performance.
Are these changes tested?
Yes,
date_part.slthas been updated with two tests.Are there any user-facing changes?
No.