Skip to content

Fix date column in tpcds connector#12194

Merged
arhimondr merged 1 commit intotrinodb:masterfrom
arhimondr:fix-tpcds-date-column
May 3, 2022
Merged

Fix date column in tpcds connector#12194
arhimondr merged 1 commit intotrinodb:masterfrom
arhimondr:fix-tpcds-date-column

Conversation

@arhimondr
Copy link
Copy Markdown
Contributor

Description

Number of days since epoch could be incorrect when Trino is run not in
the UTC time zone as new LocalDate(...) returns a local date
corresponding to the number of milliseconds since epoch in UTC.

Is this change a fix, improvement, new feature, refactoring, or other?

Fix

Is this a change to the core query engine, a connector, client library, or the SPI interfaces? (be specific)

TPC-DS connector

How would you describe this change to a non-technical end user or system administrator?

TPC-DS connector tables contain incorrect values in date columns when Trino is run in a timezone other than UTC

Related issues, pull requests, and links

-

Documentation

(x) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.

Release notes

(x) No release notes entries required.
( ) Release notes entries required with the following suggested text:

# Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Apr 29, 2022
@arhimondr arhimondr requested a review from losipiuk April 29, 2022 15:59
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

cc: @findepi

Copy link
Copy Markdown
Member

@findepi findepi left a comment

Choose a reason for hiding this comment

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

Nice find, worth testing?

cc @sopel39 @przemekak @raunaqmorarka as benchmark datasets may need to be re-generated (or inspected for correctness).

@arhimondr arhimondr force-pushed the fix-tpcds-date-column branch from b94128f to 1a9d194 Compare May 3, 2022 00:14
@arhimondr
Copy link
Copy Markdown
Contributor Author

@findepi Added a test. Could you please take a look?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

was this test failing without the fix? Worth a comment (and maybe rename) to explain what exactly are we testing here.

Copy link
Copy Markdown
Contributor Author

@arhimondr arhimondr May 3, 2022

Choose a reason for hiding this comment

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

I does fail without the fix. The tests are run in America/Bahia_Banderas time zone (-6). Before the change the value returned used to be 1900-01-01 while the correct value is 1900-01-02 (verified by manually checking the value TPC-DS generator returns as a string)

Will add a comment.

Number of days since epoch could be incorrect when Trino is run not in
the UTC time zone as `new LocalDate(...)` returns a local date
corresponding to the number of milliseconds since epoch in UTC.
@arhimondr arhimondr force-pushed the fix-tpcds-date-column branch from 1a9d194 to 4f1abf0 Compare May 3, 2022 16:04
@arhimondr arhimondr merged commit a5369e8 into trinodb:master May 3, 2022
@arhimondr arhimondr deleted the fix-tpcds-date-column branch May 3, 2022 20:39
@github-actions github-actions bot added this to the 380 milestone May 3, 2022
arhimondr added a commit to trinodb/trino-verifier-queries that referenced this pull request Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants