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

[#5341] fix (trino-connector): Adjust the default precision of the time and timestamp types for different catalogs #5368

Merged
merged 2 commits into from
Oct 31, 2024

Conversation

diqiu50
Copy link
Contributor

@diqiu50 diqiu50 commented Oct 30, 2024

What changes were proposed in this pull request?

Adjust the default precision of the time and timestamp types for different catalogs. keep the same precision as the original connector

Why are the changes needed?

Fix: #5341

Does this PR introduce any user-facing change?

No

How was this patch tested?

Update IT

@diqiu50 diqiu50 requested a review from mchades October 30, 2024 07:21
return TimestampType.TIMESTAMP_MICROS;
}
} else if (Name.TIME == type.name()) {
return TimeType.TIME_MICROS;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the Time type in Trino has micro seconds 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.

Yes,the default time precision in PG is micro seconds

Comment on lines 40 to 44
if (timestampType.hasTimeZone()) {
unsupportedType = true;
} else if (Type.Name.TIME == type.name()) {
unsupportedType = true;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If (timestampType.hasTimeZone() || Type.Name.TIME == type.name()) {
throw new TrinoException(
GravitinoErrorCode.GRAVITINO_UNSUPPORTED_GRAVITINO_DATATYPE,
"Unsupported gravitino datatype: " + type);
}

@yuqi1129 yuqi1129 added the branch-0.7 Automatically cherry-pick commit to branch-0.7 label Oct 31, 2024
@jerryshao jerryshao merged commit a053032 into apache:main Oct 31, 2024
23 checks passed
github-actions bot pushed a commit that referenced this pull request Oct 31, 2024
…me and timestamp types for different catalogs (#5368)

### What changes were proposed in this pull request?

Adjust the default precision of the time and timestamp types for
different catalogs. keep the same precision as the original connector

### Why are the changes needed?

Fix: #5341

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

Update IT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch-0.7 Automatically cherry-pick commit to branch-0.7
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug report] Trino: postgres catalog: INSERT INTO TIMESTAMP WITH TIME ZONE datatype failed
3 participants