[Gandiva] Add timestamp precision support infrastructure and extractYear POC#128
Closed
telemenar wants to merge 1 commit intodremio:dremio_27.0_20from
Closed
[Gandiva] Add timestamp precision support infrastructure and extractYear POC#128telemenar wants to merge 1 commit intodremio:dremio_27.0_20from
telemenar wants to merge 1 commit intodremio:dremio_27.0_20from
Conversation
…ractYear POC
Phase 1: Core Infrastructure
- Add MICROS_*, NANOS_*, SECS_* constants to time_constants.h
- Create templated EpochTimePointT<Duration> class for precision-aware time operations
- Add gdv_timestamp_{sec,ms,us,ns} type aliases in types.h
- Update FunctionSignature::Hash() to include TimeUnit for temporal types
- Add timestamp_{sec,ms,us,ns}() helpers and TIMESTAMP_PRECISION_TYPES macro
Phase 2: Proof of Concept - extractYear
- Implement extractYear_timestamp_{sec,ms,us,ns} functions
- Register precision-specific extractYear in function registry
- Add unit tests for EpochTimePointT template
- Add unit tests for precision-specific extractYear
- Add FunctionSignature hash tests for timestamp precisions
- Add integration test for extractYear with all precisions
855a4be to
15d9013
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.
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