[Gandiva] Add timestamp precision support infrastructure and extractYear POC#128
Draft
telemenar wants to merge 10000 commits intodremio:dremiofrom
Draft
[Gandiva] Add timestamp precision support infrastructure and extractYear POC#128telemenar wants to merge 10000 commits intodremio:dremiofrom
telemenar wants to merge 10000 commits intodremio:dremiofrom
Conversation
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.
Summary
This PR adds core infrastructure for supporting all four timestamp precisions (SECOND, MILLISECOND, MICROSECOND, NANOSECOND) in Gandiva, along with a proof-of-concept implementation for
extractYear.Changes
Phase 1: Core Infrastructure
MICROS_*,NANOS_*,SECS_*constants totime_constants.hEpochTimePointT<Duration>class for precision-aware time operationsgdv_timestamp_{sec,ms,us,ns}type aliases intypes.hFunctionSignature::Hash()to include TimeUnit for temporal typestimestamp_{sec,ms,us,ns}()helpers andTIMESTAMP_PRECISION_TYPESmacroPhase 2: Proof of Concept - extractYear
extractYear_timestamp_{sec,ms,us,ns}functionsEpochTimePointTtemplateMotivation
Currently, Gandiva internally operates on milliseconds for most timestamp functions, which can lead to precision loss when working with microsecond or nanosecond timestamps. This PR establishes the foundation for native multi-precision support.
Testing
EpochTimePointTtemplate with all precisionsextractYearwith all precisionsCo-authored by Augment Code
Pull Request opened by Augment Code with guidance from the PR author