Skip to content

Fix #3049: apply force_microsecond_precision to TIMESTAMP_NTZ/LTZ(7) - #3050

Open
inchang-ing wants to merge 1 commit into
snowflakedb:mainfrom
inchang-ing:fix-3049
Open

inchang-ing wants to merge 1 commit into
snowflakedb:mainfrom
inchang-ing:fix-3049

Conversation

@inchang-ing

Copy link
Copy Markdown

Fixes #3049.

When force_microsecond_precision is enabled, TIMESTAMP_NTZ/LTZ columns at scale 7 (sent by the server as a plain int64 of nanosecond units) had their column type set to timestamp[us] but were still scaled up to nanoseconds, yielding 1000x-too-large values that raised OverflowError on conversion. The int64 branch now truncates the value to microseconds to match the emitted schema.

Added a unit regression test (test/unit/test_arrow_force_microsecond_precision.py) covering both TIMESTAMP_NTZ and TIMESTAMP_LTZ at scale 7.

…NTZ/LTZ(7)

When force_microsecond_precision is set, TIMESTAMP_NTZ/LTZ columns at
scale 7 are sent by the server as a plain int64 (nanosecond units). The
int64 branch set the column type to timestamp[us] but still scaled the
value up to nanoseconds, producing 1000x-too-large values that raised
OverflowError on conversion. Truncate the value to microseconds to match
the emitted schema.

@snowflake-security-bot snowflake-security-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Snowflake Security Review

Security grade: A — Passed ✅

This PR was classified as LOW risk by the automated pre-screen.

@inchang-ing

Copy link
Copy Markdown
Author

Gentle ping on this one - it extends force_microsecond_precision to TIMESTAMP_NTZ / TIMESTAMP_LTZ(7) bindings, fixing #3049. CI is green and the branch is mergeable. Let me know if any changes are needed. Thanks!

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SNOW-4249453: force_microsecond_precision returns nanosecond values labeled timestamp[us] for TIMESTAMP_NTZ/LTZ(7)

1 participant