Skip to content

fix(transform): compute year and month in UTC - #3237

Open
jaideeppyne wants to merge 1 commit into
apache:mainfrom
jaideeppyne:fix/year-month-utc
Open

jaideeppyne wants to merge 1 commit into
apache:mainfrom
jaideeppyne:fix/year-month-utc

Conversation

@jaideeppyne

Copy link
Copy Markdown

Which issue does this PR close?

What changes are included in this PR?

Year::transform and Month::transform called Arrow date_part, which converts each timestamp into the array's timezone tag before reading year/month. Iceberg computes those transforms in UTC (DateTimeUtil / transform_literal), so a non-UTC tag produced the wrong partition value near a year or month boundary.

Timestamp arrays are retagged as +00:00 (same epoch values) before date_part. Day and Hour already work from the raw epoch and are unchanged.

Are these changes tested?

Unit test test_year_and_month_ignore_non_utc_timezone_tag covers -1 micros tagged Asia/Kathmandu, which must stay year/month -1 rather than 0. Existing year/month array tests still pass.

AI Disclosure

Year and Month used Arrow date_part, which converts into the array's
timezone tag before reading the calendar field. Iceberg computes those
transforms in UTC, and transform_literal already did.

Retag timestamp arrays as +00:00 before date_part so array and literal
paths agree for non-UTC tags.

Closes apache#3142
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.

Year and Month transforms depend on the input array's timezone tag; Iceberg computes them in UTC

1 participant