Skip to content

Round TimeWithTimeZone when supportsParametricDateTime is false#14950

Merged
martint merged 3 commits intotrinodb:masterfrom
mdesmet:bug/sqltime-not-rounded
Nov 9, 2022
Merged

Round TimeWithTimeZone when supportsParametricDateTime is false#14950
martint merged 3 commits intotrinodb:masterfrom
mdesmet:bug/sqltime-not-rounded

Conversation

@mdesmet
Copy link
Copy Markdown
Contributor

@mdesmet mdesmet commented Nov 8, 2022

Description

When PARAMETRIC_DATETIME is not set, all temporal types should be rounded up to precision 3. However TimeWithTimeZone is not rounded.

Non-technical explanation

Release notes

( ) This is not user-visible or docs only and no release notes are required.
(x) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text:

# Section
* Round TimeWithTimeZone values when `PARAMETRIC_DATETIME` is not set

@cla-bot cla-bot bot added the cla-signed label Nov 8, 2022
Copy link
Copy Markdown
Member

@hashhar hashhar left a comment

Choose a reason for hiding this comment

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

FYI @findepi/@martint

Comment on lines 370 to 373
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.

good catch. I didn't notice this myself when I shared the link. 👍

@mdesmet mdesmet marked this pull request as ready for review November 8, 2022 17:30
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.

Use junit for new tests.

Comment on lines 26 to 38
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.

Don't convert to String before comparing. Compare directly against instances created with SqlTimeWithTimeZone.newInstance

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree in case of all other tests except here we don't apply any transformation, so we have to compare against another representation.

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.

Ah, yes, I meant to put the comment in the methods below. For this one, rename the test to testToString, as that's what's being tested here.

Also, this test is unrelated to the fix in this commit, so move it to a separate commit.

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.

Don't static import this method. The name is too ambiguous.

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.

This test is unrelated to the fix in this commit. Move it to a separate commit.

Comment on lines 26 to 38
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.

Ah, yes, I meant to put the comment in the methods below. For this one, rename the test to testToString, as that's what's being tested here.

Also, this test is unrelated to the fix in this commit, so move it to a separate commit.

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.

Rename to testToString

@mdesmet mdesmet force-pushed the bug/sqltime-not-rounded branch from a369a2d to f83ecc2 Compare November 8, 2022 21:17
@mdesmet mdesmet force-pushed the bug/sqltime-not-rounded branch from f83ecc2 to 4e42bd4 Compare November 8, 2022 21:34
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.

Unrelated change

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry for that, removed!

@mdesmet mdesmet force-pushed the bug/sqltime-not-rounded branch from 4e42bd4 to 6a28dfb Compare November 9, 2022 13:50
@martint martint merged commit 811e435 into trinodb:master Nov 9, 2022
@github-actions github-actions bot added this to the 403 milestone Nov 9, 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