feat!: add temporal extension literals#152
Draft
wackywendell wants to merge 1 commit into
Draft
Conversation
9bf90c0 to
3c0fbdf
Compare
a185f25 to
029332f
Compare
c7ccc59 to
eda989e
Compare
029332f to
ccd533f
Compare
ccd533f to
1a1cd7c
Compare
eda989e to
0e87426
Compare
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.
Description
This PR adds first-class extension argument support for temporal typed literals, for example:
Those arguments are represented as
ExtensionValue::Literal(ExtensionLiteral)instead of a generic expression value. Extension handlers can still request them asExpr; the literal widens to a normal Substrait literal expression in that case.Changes
ExtensionLiteral, backed bysubstrait::proto::expression::Literal.date_days,time_micros,timestamp_micros,precision_time_units,precision_timestamp_units, andprecision_timestamp_tz_utc.TryFrom<Literal> for ExtensionLiteralso the supported literal-kind policy lives withExtensionLiteral, not in parser control flow.typed_literalanduntyped_literalso extension argument parsing can match typed literals directly.42:i16as expression values.precisiontime<N>,precisiontimestamp<N>, andprecisiontimestamptz<N>literals, building on trunk's existing precision temporal type parser.API Impact
This is a breaking change for extension handlers that expected temporal typed literal arguments to arrive only as
Expr. Those values now arrive asExtensionValue::Literal, but handlers can still requestExprthroughArgsExtractor.This also adds a new public extension argument type,
ExtensionLiteral.Validation
cargo checkjust fmtjust checkcargo test --docjust testgit verify-commit a185f25e237e 9bf90c0eb687