Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CALCITE-6282] Avatica ignores time precision when returning TIME results #241

Merged
merged 1 commit into from
Mar 29, 2024

Conversation

mihaibudiu
Copy link
Contributor


TimeFromNumberAccessor(Getter getter, Calendar localCalendar) {
TimeFromNumberAccessor(Getter getter, Calendar localCalendar, int precision) {
super(getter, 0);
Copy link

Choose a reason for hiding this comment

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

I have a question, should the 2 in Time(2) be scale or precision?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will rename it to "scale"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess I have to leave it as precision, since both the columnMetadataFields which originate this value call it precision, and the helper functions that manipulate this field also call it precision (as you point out in your other comment). It would be too confusing to use different names for this value in different parts of the codebase.

I propose we file a new issue if we want to modify the field name to scale, to make sure that we cover all the software layers involved. In the meantime it would be great to merge this PR because it fixes a genuine bug.

@@ -1220,7 +1227,7 @@ static class TimestampAccessor extends ObjectAccessor {
}
final long unix =
DateTimeUtils.sqlTimestampToUnixTimestamp(timestamp, localCalendar);
return timestampAsString(unix, null);
return timestampAsString(unix, null, this.precision);
Copy link

Choose a reason for hiding this comment

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

For cast(TIME '12:42:25.34' as TIME(2)) case, whether to consider
DateTimeUtils.unixTimeToSqlTime corresponding changes

@mihaibudiu
Copy link
Contributor Author

So what's the plan about merging this PR? Do I have to make somehow the CI work?

@F21
Copy link
Member

F21 commented Mar 20, 2024

I would suggest we temporary comment out the tests in Calcite and renable them when it's upgraded to Avatica 1.25.0. See Julian's suggestion: https://lists.apache.org/thread/b7kb393yvj10rbmsxv4bh076bk2ncx58

…ults

Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
@mihaibudiu mihaibudiu merged commit 8c36e01 into apache:main Mar 29, 2024
11 checks passed
@mihaibudiu mihaibudiu deleted the issue6282 branch March 29, 2024 17:56
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.

4 participants