Skip to content

Add more timezone IDs and add tests to validate timezone compatibility#18636

Open
timothy-e wants to merge 1 commit into
apache:masterfrom
timothy-e:timothy-e-add-more-timezones
Open

Add more timezone IDs and add tests to validate timezone compatibility#18636
timothy-e wants to merge 1 commit into
apache:masterfrom
timothy-e:timothy-e-add-more-timezones

Conversation

@timothy-e
Copy link
Copy Markdown
Contributor

Summary

Appends 44 timezone entries to pinot-common/src/main/resources/zone-index.properties. The entries cover:

  • America/Coyhaique
  • Etc/GMT, Etc/GMT+0 through Etc/GMT+12, Etc/GMT-0 through Etc/GMT-14, Etc/GMT0
  • Etc/Greenwich, Etc/UCT, Etc/UTC, Etc/Universal, Etc/Zulu
  • GMT, GMT+0, GMT-0, GMT0, Greenwich
  • UCT, Universal, Zulu

EST, HST, MST, Factory, and US/Pacific-New remain excluded, consistent with the existing comments in the file noting they are absent from java.time or removed from tzdata.

Stripe's timezone allowlist includes these timezone IDs, but they were absent from zone-index.properties, meaning Pinot would reject them as unrecognized timezone identifiers when used in queries.

Testing

The timezones in this file are supposed to be compatible with java.util.Timezone, java.time.ZoneId, and jodatime, but nothing actually ensured that. I could manually check, but it's nice to have real validation.

Adds a new TimeZoneKeyTest class that validates all timezones listed in zone-index.properties are recognized by three timezone libraries:

  • java.util.TimeZone
  • java.time.ZoneId
  • Joda-Time's DateTimeZone

The tests collect all unsupported timezones before failing, so a single test run surfaces every incompatible entry rather than stopping at the first failure.

Also includes basic sanity checks that the zone index file is non-empty and that the UTC key is present with key 0.

(I'm not sure why zone-index.properties has timezones like -13:52, as they're not compatible with java.util.TimeZone. For now, I've just skipped them in the java.util.Timezone test`.)

Appends 44 timezone entries to `pinot-common/src/main/resources/zone-index.properties`. The entries cover:

- `America/Coyhaique`
- `Etc/GMT`, `Etc/GMT+0` through `Etc/GMT+12`, `Etc/GMT-0` through `Etc/GMT-14`, `Etc/GMT0`
- `Etc/Greenwich`, `Etc/UCT`, `Etc/UTC`, `Etc/Universal`, `Etc/Zulu`
- `GMT`, `GMT+0`, `GMT-0`, `GMT0`, `Greenwich`
- `UCT`, `Universal`, `Zulu`

`EST`, `HST`, `MST`, `Factory`, and `US/Pacific-New` remain excluded, consistent with the existing comments in the file noting they are absent from `java.time` or removed from tzdata.

Adds a new `TimeZoneKeyTest` class that validates all timezones listed in `zone-index.properties` are recognized by three timezone libraries:
- `java.util.TimeZone`
- `java.time.ZoneId`
- Joda-Time's `DateTimeZone`

The tests collect all unsupported timezones before failing, so a single test run surfaces every incompatible entry rather than stopping at the first failure.

Also includes basic sanity checks that the zone index file is non-empty and that the UTC key is present with key 0.

Stripe's timezone allowlist includes these timezone IDs, which are supported by all three required Java timezone libraries (`java.util.TimeZone`, `java.time.ZoneId`, and Joda-Time). However, they were absent from `zone-index.properties`, meaning Pinot would reject them as unrecognized timezone identifiers when used in queries.

The timezones in this file are supposed to be compatible with `java.util.Timezone`, `java.time.ZoneId`, and `jodatime`, but nothing actually ensured that. I could manually check, but it's nice to have real validation.
@timothy-e
Copy link
Copy Markdown
Contributor Author

@Jackie-Jiang I saw you added some timezones a few months ago - I've added some more, and some tests to ensure they're valid timezones. Can you TAL when you have a chance?

Copy link
Copy Markdown
Contributor

@Jackie-Jiang Jackie-Jiang left a comment

Choose a reason for hiding this comment

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

This file is kept in sync with https://github.com/prestodb/presto/blob/master/presto-common/src/main/resources/com/facebook/presto/common/type/zone-index.properties. We don't want to add custom timezones into it.
Are these added timezones valid in joda?

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.45%. Comparing base (4ecb1d4) to head (2a53108).
⚠️ Report is 15 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #18636      +/-   ##
============================================
+ Coverage     56.79%   64.45%   +7.66%     
- Complexity        7     1282    +1275     
============================================
  Files          2567     3352     +785     
  Lines        149143   207171   +58028     
  Branches      24111    32348    +8237     
============================================
+ Hits          84707   133540   +48833     
- Misses        57241    62902    +5661     
- Partials       7195    10729    +3534     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-21 64.45% <ø> (+7.66%) ⬆️
temurin 64.45% <ø> (+7.66%) ⬆️
unittests 64.45% <ø> (+7.66%) ⬆️
unittests1 56.81% <ø> (+0.01%) ⬆️
unittests2 37.16% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

3 participants