Skip to content

fix: Fix Axiom timestamp display format to match Presto#16929

Open
maniloya wants to merge 1 commit intofacebookincubator:mainfrom
maniloya:export-D98248129
Open

fix: Fix Axiom timestamp display format to match Presto#16929
maniloya wants to merge 1 commit intofacebookincubator:mainfrom
maniloya:export-D98248129

Conversation

@maniloya
Copy link
Copy Markdown
Contributor

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

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
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 26, 2026

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 67190ff
🔍 Latest deploy log https://app.netlify.com/projects/meta-velox/deploys/69c4b5660304ab0008cf30d5

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 26, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync bot commented Mar 26, 2026

@maniloya has exported this pull request. If you are a Meta employee, you can view the originating Diff in D98248129.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant