-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Use RemoteTableName in JdbcOutputTableHandle #23090
Conversation
42d1791
to
36d463b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you describe the motivation in a PR description?
plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/JdbcOutputTableHandle.java
Show resolved
Hide resolved
8c85542
to
72ffecf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/BaseJdbcClient.java
Show resolved
Hide resolved
plugin/trino-base-jdbc/src/main/java/io/trino/plugin/jdbc/CachingJdbcClient.java
Outdated
Show resolved
Hide resolved
@@ -67,24 +63,54 @@ public JdbcOutputTableHandle( | |||
this.pageSinkIdColumnName = requireNonNull(pageSinkIdColumnName, "pageSinkIdColumnName is null"); | |||
} | |||
|
|||
public JdbcOutputTableHandle( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non deprecated constructor should be first. And one constructor should call the other to avoid the copy-paste code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chenjian2664 The 2nd comment about copy-paste isn't addressed. Is it intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ebyhr I missed this part, not intentional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This constructor still has @JsonCreator
& @JsonProperty
annotations and a new constructor doesn't have those annotations. That's weird for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean we may let the new added one to call the exists constructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the constructor remain solely, shifting JSON annotations to new one?
Unsure how other repositories depend on this constructor.
Or We may need to keep the catalogName
, schemaName
, tableName
fields and add the new constructor based on the exists one.
what do you think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RemoteTableName
is already JSON serializable so why do we need new deprecated constructor for just JSON serialization purposes?
This is about using a named abstraction where possible. When doing a review of #23034 where the triple ( |
bc08f65
to
b6715ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit body is too long. Please warp at 72 characters: https://github.com/trinodb/trino/blob/master/.github/DEVELOPMENT.md#commits-and-pull-requests
plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/PhoenixMergeSink.java
Outdated
Show resolved
Hide resolved
@@ -67,24 +63,54 @@ public JdbcOutputTableHandle( | |||
this.pageSinkIdColumnName = requireNonNull(pageSinkIdColumnName, "pageSinkIdColumnName is null"); | |||
} | |||
|
|||
public JdbcOutputTableHandle( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chenjian2664 The 2nd comment about copy-paste isn't addressed. Is it intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good except for comments.
2e60945
to
f08b198
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good % comment about JSON annotations in JdbcOutputTableHandle
Yeah, I think it would be nice to remove it in this situation. |
Use RemoteTableName, which wraps `catalogName` and `schemaName` in `Optional` to handle their potential absence more explicitly
f08b198
to
5f60fea
Compare
CI is red |
Error: Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.15.0:npm (package (webapp)) on project trino-web-ui: Failed to run task: 'npm run package' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1] �It's unrelated to changes? |
Restarted |
Description
The
catalogName
andschemaName
members are annotated with nullable, but it's easy to miss the info when use getter. Instead, useRemoteTableName
, which encapsulates thecatalogName
andschemaName
withinOptional
wrapper.Additional context and related issues
Release notes
(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: