fix: Fix Axiom timestamp display format to match Presto#16929
Open
maniloya wants to merge 1 commit intofacebookincubator:mainfrom
Open
fix: Fix Axiom timestamp display format to match Presto#16929maniloya wants to merge 1 commit intofacebookincubator:mainfrom
maniloya wants to merge 1 commit intofacebookincubator:mainfrom
Conversation
Summary: [velox] Fix Axiom timestamp display format to match Presto ## Summary Axiom formats timestamps as `2024-01-15T12:00:00.000000000` (ISO 8601 with `T` separator, nanosecond precision) while Presto uses `2024-01-15 12:00:00.000` (space separator, millisecond precision). Both represent the same value but the string difference causes false-positive `COLUMN_MISMATCH` verifier failures and can break downstream consumers expecting Presto format. The root cause is that `PrestoTypes::valueToString()` had no special handling for the `Timestamp` type — it fell through to `Timestamp::toString()` which uses default `TimestampToStringOptions` (`'T'` separator, nanosecond precision). This change adds a `timestampToPrestoString` helper to `PrestoTypes` that uses Presto-compatible options: - `precision = kMilliseconds` (3 decimal places) - `zeroPaddingYear = true` - `dateTimeSeparator = ' '` (space instead of `T`) The template `valueToString` now delegates to this helper for `Timestamp` values, following the same pattern as `TIMESTAMP_WITH_TIME_ZONE`, `IPADDRESS`, `UUID`, and other custom types. Differential Revision: D98248129
✅ Deploy Preview for meta-velox canceled.
|
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:
[velox] Fix Axiom timestamp display format to match Presto
Summary
Axiom formats timestamps as
2024-01-15T12:00:00.000000000(ISO 8601 withTseparator, nanosecond precision) while Presto uses2024-01-15 12:00:00.000(space separator, millisecond precision). Bothrepresent the same value but the string difference causes false-positive
COLUMN_MISMATCHverifier failures and can break downstream consumersexpecting Presto format.
The root cause is that
PrestoTypes::valueToString()had no special handlingfor the
Timestamptype — it fell through toTimestamp::toString()whichuses default
TimestampToStringOptions('T'separator, nanosecondprecision).
This change adds a
timestampToPrestoStringhelper toPrestoTypesthatuses Presto-compatible options:
precision = kMilliseconds(3 decimal places)zeroPaddingYear = truedateTimeSeparator = ' '(space instead ofT)The template
valueToStringnow delegates to this helper forTimestampvalues, following the same pattern as
TIMESTAMP_WITH_TIME_ZONE,IPADDRESS,UUID, and other custom types.Differential Revision: D98248129