You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "hqbhoho (via GitHub)" <gi...@apache.org> on 2025/08/19 15:01:23 UTC
[PR] [#6403] improvement(trino-connector): Support SQL UPDATE with jdbc catalog [gravitino]
hqbhoho opened a new pull request, #8188:
URL: https://github.com/apache/gravitino/pull/8188
### What changes were proposed in this pull request?
Support SQL UPDATE with MySQL/PostgreSQL
### Why are the changes needed?
Fix: #6403
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
local tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6403] improvement(trino-connector): Support SQL UPDATE/DELETE with jdbc catalog [gravitino]
Posted by "hqbhoho (via GitHub)" <gi...@apache.org>.
hqbhoho commented on code in PR #8188:
URL: https://github.com/apache/gravitino/pull/8188#discussion_r2302715831
##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/hive/HiveMetadataAdapter.java:
##########
@@ -249,4 +251,14 @@ public ConnectorTableMetadata getTableMetadata(GravitinoTable gravitinoTable) {
properties,
Optional.ofNullable(gravitinoTable.getComment()));
}
+
+ /**
+ * Get the column handle name that will generate row IDs for the merge operation.
+ *
+ * @return the column handle name for row IDs
+ */
+ @Override
+ public String getMergeRowIdColumnHandleName() {
+ return MERGE_ROW_ID;
Review Comment:
Retrieve it from the internal connector is diffcult because it is generated and not exist in table schmea. In origin connector like jdbc define like this ,
```
@Override
public ColumnHandle getMergeRowIdColumnHandle(ConnectorSession session, ConnectorTableHandle tableHandle)
{
verify(!isTableHandleForProcedure(tableHandle), "Not a table reference: %s", tableHandle);
// The column is used for row-level merge, which is not supported, but it's required during analysis anyway.
return new JdbcColumnHandle(
MERGE_ROW_ID,
new JdbcTypeHandle(Types.BIGINT, Optional.of("bigint"), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()),
BIGINT);
}
```
Currently, I use the column name is same with origin connector.
I'm not sure if having two different names (GrivitinoColumn/internal connector column handle) for the same column would cause problems . I will check later.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6403] improvement(trino-connector): Support SQL UPDATE/DELETE with jdbc catalog [gravitino]
Posted by "hqbhoho (via GitHub)" <gi...@apache.org>.
hqbhoho commented on code in PR #8188:
URL: https://github.com/apache/gravitino/pull/8188#discussion_r2299578191
##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/hive/HiveMetadataAdapter.java:
##########
@@ -249,4 +251,14 @@ public ConnectorTableMetadata getTableMetadata(GravitinoTable gravitinoTable) {
properties,
Optional.ofNullable(gravitinoTable.getComment()));
}
+
+ /**
+ * Get the column handle name that will generate row IDs for the merge operation.
+ *
+ * @return the column handle name for row IDs
+ */
+ @Override
+ public String getMergeRowIdColumnHandleName() {
+ return MERGE_ROW_ID;
Review Comment:
In this PR, it is not need implement for Hive and Iceberg.
However, in a subsequent PR(#8258), we will support UPDATE/DELETE/MERGE operations for Hive and Iceberg.
So I implemented these two methods here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6403] improvement(trino-connector): Support SQL UPDATE/DELETE with jdbc catalog [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on PR #8188:
URL: https://github.com/apache/gravitino/pull/8188#issuecomment-3208827850
This is a nice feature. Thank you for your contribution, and we will take the time to review it promptly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6403] improvement(trino-connector): Support SQL UPDATE/DELETE with jdbc catalog [gravitino]
Posted by "hqbhoho (via GitHub)" <gi...@apache.org>.
hqbhoho commented on code in PR #8188:
URL: https://github.com/apache/gravitino/pull/8188#discussion_r2303616467
##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/hive/HiveMetadataAdapter.java:
##########
@@ -249,4 +251,14 @@ public ConnectorTableMetadata getTableMetadata(GravitinoTable gravitinoTable) {
properties,
Optional.ofNullable(gravitinoTable.getComment()));
}
+
+ /**
+ * Get the column handle name that will generate row IDs for the merge operation.
+ *
+ * @return the column handle name for row IDs
+ */
+ @Override
+ public String getMergeRowIdColumnHandleName() {
+ return MERGE_ROW_ID;
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6403] improvement(trino-connector): Support SQL UPDATE/DELETE with jdbc catalog [gravitino]
Posted by "hqbhoho (via GitHub)" <gi...@apache.org>.
hqbhoho commented on PR #8188:
URL: https://github.com/apache/gravitino/pull/8188#issuecomment-3201315967
Support SQL UPDATE/DELETE with Iceberg/Hive depend on `MERGE` syntax. I will try in another PR later.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6403] improvement(trino-connector): Support SQL UPDATE/DELETE with jdbc catalog [gravitino]
Posted by "diqiu50 (via GitHub)" <gi...@apache.org>.
diqiu50 commented on PR #8188:
URL: https://github.com/apache/gravitino/pull/8188#issuecomment-3243581548
> > Maybe we can add a configuration `trino-worker-num` (default 0) to facilitate deploying a distributed environment for testing purposes. If `trino-worker-num` = 0, it will use the current implementation which use a single node that functions as both a coordinator and worker. It will not change default CI behavior.
> > ```
> > bash trino-connector/integration-test/trino-test-tools/trino_test.sh --test_set=jdbc-mysql --trino-worker-num=3
> > ```
>
> @diqiu50 Are there any other issues in this PR that need to be modified? Add support `trino-worker-num` in another PR, what do you think?
That's OK
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6403] improvement(trino-connector): Support SQL UPDATE/DELETE with jdbc catalog [gravitino]
Posted by "hqbhoho (via GitHub)" <gi...@apache.org>.
hqbhoho commented on code in PR #8188:
URL: https://github.com/apache/gravitino/pull/8188#discussion_r2302715831
##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/hive/HiveMetadataAdapter.java:
##########
@@ -249,4 +251,14 @@ public ConnectorTableMetadata getTableMetadata(GravitinoTable gravitinoTable) {
properties,
Optional.ofNullable(gravitinoTable.getComment()));
}
+
+ /**
+ * Get the column handle name that will generate row IDs for the merge operation.
+ *
+ * @return the column handle name for row IDs
+ */
+ @Override
+ public String getMergeRowIdColumnHandleName() {
+ return MERGE_ROW_ID;
Review Comment:
Retrieve it from the internal connector is diffcult. In origin connector like jdbc define like this ,
```
@Override
public ColumnHandle getMergeRowIdColumnHandle(ConnectorSession session, ConnectorTableHandle tableHandle)
{
verify(!isTableHandleForProcedure(tableHandle), "Not a table reference: %s", tableHandle);
// The column is used for row-level merge, which is not supported, but it's required during analysis anyway.
return new JdbcColumnHandle(
MERGE_ROW_ID,
new JdbcTypeHandle(Types.BIGINT, Optional.of("bigint"), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()),
BIGINT);
}
```
Currently, I use the column name is same with origin connector.
I'm not sure if having two different names (GrivitinoColumn/internal connector handle) for the same column would cause problems . I will check later.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6403] improvement(trino-connector): Support SQL UPDATE/DELETE with jdbc catalog [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao merged PR #8188:
URL: https://github.com/apache/gravitino/pull/8188
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6403] improvement(trino-connector): Support SQL UPDATE/DELETE with jdbc catalog [gravitino]
Posted by "diqiu50 (via GitHub)" <gi...@apache.org>.
diqiu50 commented on PR #8188:
URL: https://github.com/apache/gravitino/pull/8188#issuecomment-3232576120
> > Do we test that case in the distributed Trino environment?
>
> @diqiu50 Currently, only run the integration test. So we need add a distributed Trino environment to test? If necessary, I will have try.
>
> Add `DistributedQueryRunner` or update `docker-compose.yaml` to add worker-only node for test?
There is no need to make it that complicated. Just deploy a Trino cluster with more than two nodes and the Gravitino Trino connector, then perform a manual test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6403] improvement(trino-connector): Support SQL UPDATE/DELETE with jdbc catalog [gravitino]
Posted by "diqiu50 (via GitHub)" <gi...@apache.org>.
diqiu50 commented on code in PR #8188:
URL: https://github.com/apache/gravitino/pull/8188#discussion_r2298425167
##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/hive/HiveMetadataAdapter.java:
##########
@@ -249,4 +251,14 @@ public ConnectorTableMetadata getTableMetadata(GravitinoTable gravitinoTable) {
properties,
Optional.ofNullable(gravitinoTable.getComment()));
}
+
+ /**
+ * Get the column handle name that will generate row IDs for the merge operation.
+ *
+ * @return the column handle name for row IDs
+ */
+ @Override
+ public String getMergeRowIdColumnHandleName() {
+ return MERGE_ROW_ID;
Review Comment:
These methods are identical, so there is no need to implement them with overloading.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6403] improvement(trino-connector): Support SQL UPDATE/DELETE with jdbc catalog [gravitino]
Posted by "diqiu50 (via GitHub)" <gi...@apache.org>.
diqiu50 commented on PR #8188:
URL: https://github.com/apache/gravitino/pull/8188#issuecomment-3231658713
Do we test that case in the distribution Trino environment
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6403] improvement(trino-connector): Support SQL UPDATE/DELETE with jdbc catalog [gravitino]
Posted by "hqbhoho (via GitHub)" <gi...@apache.org>.
hqbhoho commented on code in PR #8188:
URL: https://github.com/apache/gravitino/pull/8188#discussion_r2299564919
##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/hive/HiveMetadataAdapter.java:
##########
@@ -249,4 +251,14 @@ public ConnectorTableMetadata getTableMetadata(GravitinoTable gravitinoTable) {
properties,
Optional.ofNullable(gravitinoTable.getComment()));
}
+
+ /**
+ * Get the column handle name that will generate row IDs for the merge operation.
+ *
+ * @return the column handle name for row IDs
+ */
+ @Override
+ public String getMergeRowIdColumnHandleName() {
+ return MERGE_ROW_ID;
Review Comment:
Different connector will have different `mergeRowIdColumnHandle` which not define in table schema. The name for mergeRowIdColumnHandle is also different.
Currently, the column handle name is `$row_id` in Hive/Iceberg and `$merge_row_id` in JDBC .
Even if the names are the same, I thibk they should be defined separately within their respective connectors.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6403] improvement(trino-connector): Support SQL UPDATE/DELETE with jdbc catalog [gravitino]
Posted by "hqbhoho (via GitHub)" <gi...@apache.org>.
hqbhoho commented on code in PR #8188:
URL: https://github.com/apache/gravitino/pull/8188#discussion_r2299564919
##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/hive/HiveMetadataAdapter.java:
##########
@@ -249,4 +251,14 @@ public ConnectorTableMetadata getTableMetadata(GravitinoTable gravitinoTable) {
properties,
Optional.ofNullable(gravitinoTable.getComment()));
}
+
+ /**
+ * Get the column handle name that will generate row IDs for the merge operation.
+ *
+ * @return the column handle name for row IDs
+ */
+ @Override
+ public String getMergeRowIdColumnHandleName() {
+ return MERGE_ROW_ID;
Review Comment:
Different connector will have different `mergeRowIdColumnHandle` which not define in table schema. The name for `mergeRowIdColumnHandle` is also different.
Currently, the column handle name is `$row_id` in Hive/Iceberg and `$merge_row_id` in JDBC .
Even if the names are the same, I thibk they should be defined separately within their respective connectors.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6403] improvement(trino-connector): Support SQL UPDATE/DELETE with jdbc catalog [gravitino]
Posted by "hqbhoho (via GitHub)" <gi...@apache.org>.
hqbhoho commented on code in PR #8188:
URL: https://github.com/apache/gravitino/pull/8188#discussion_r2302715831
##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/hive/HiveMetadataAdapter.java:
##########
@@ -249,4 +251,14 @@ public ConnectorTableMetadata getTableMetadata(GravitinoTable gravitinoTable) {
properties,
Optional.ofNullable(gravitinoTable.getComment()));
}
+
+ /**
+ * Get the column handle name that will generate row IDs for the merge operation.
+ *
+ * @return the column handle name for row IDs
+ */
+ @Override
+ public String getMergeRowIdColumnHandleName() {
+ return MERGE_ROW_ID;
Review Comment:
Retrieve it from the internal connector is diffcult because it is generated and not exist in table schmea. In origin connector like jdbc define like this ,
```
@Override
public ColumnHandle getMergeRowIdColumnHandle(ConnectorSession session, ConnectorTableHandle tableHandle)
{
verify(!isTableHandleForProcedure(tableHandle), "Not a table reference: %s", tableHandle);
// The column is used for row-level merge, which is not supported, but it's required during analysis anyway.
return new JdbcColumnHandle(
MERGE_ROW_ID,
new JdbcTypeHandle(Types.BIGINT, Optional.of("bigint"), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()),
BIGINT);
}
```
Currently, I use the column name is same with origin connector.
I'm not sure if having two different names (GrivitinoColumn/internal connector handle) for the same column would cause problems . I will check later.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6403] improvement(trino-connector): Support SQL UPDATE/DELETE with jdbc catalog [gravitino]
Posted by "hqbhoho (via GitHub)" <gi...@apache.org>.
hqbhoho commented on PR #8188:
URL: https://github.com/apache/gravitino/pull/8188#issuecomment-3235541483
> There is no need to make it that complicated. Just deploy a Trino cluster with more than two nodes and the Gravitino Trino connector, then perform a manual test.
@diqiu50 I want update docker-compose.yaml to add worker-only node for test, because it can reuse for users, maybe can add a config to decide whether use or not, what do you think?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6403] improvement(trino-connector): Support SQL UPDATE/DELETE with jdbc catalog [gravitino]
Posted by "hqbhoho (via GitHub)" <gi...@apache.org>.
hqbhoho commented on PR #8188:
URL: https://github.com/apache/gravitino/pull/8188#issuecomment-3241506267
> Maybe we can add a configuration `trino-worker-num` (default 0) to facilitate deploying a distributed environment for testing purposes. If `trino-worker-num` = 0, it will use the current implementation which use a single node that functions as both a coordinator and worker. It will not change default CI behavior.
>
> ```
> bash trino-connector/integration-test/trino-test-tools/trino_test.sh --test_set=jdbc-mysql --trino-worker-num=3
> ```
@diqiu50 Are there any other issues in this PR that need to be modified? Add support `trino-worker-num` in another PR, what do you think?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6403] improvement(trino-connector): Support SQL UPDATE/DELETE with jdbc catalog [gravitino]
Posted by "hqbhoho (via GitHub)" <gi...@apache.org>.
hqbhoho commented on code in PR #8188:
URL: https://github.com/apache/gravitino/pull/8188#discussion_r2299564919
##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/hive/HiveMetadataAdapter.java:
##########
@@ -249,4 +251,14 @@ public ConnectorTableMetadata getTableMetadata(GravitinoTable gravitinoTable) {
properties,
Optional.ofNullable(gravitinoTable.getComment()));
}
+
+ /**
+ * Get the column handle name that will generate row IDs for the merge operation.
+ *
+ * @return the column handle name for row IDs
+ */
+ @Override
+ public String getMergeRowIdColumnHandleName() {
+ return MERGE_ROW_ID;
Review Comment:
Different connector will have different `mergeRowIdColumnHandle` which not define in table schema. The name for `mergeRowIdColumnHandle` is also different.
Currently, the column handle name is `$row_id` in Hive/Iceberg and `$merge_row_id` in JDBC .
Even if the names are the same, I think they should be defined separately within their respective connectors.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6403] improvement(trino-connector): Support SQL UPDATE/DELETE with jdbc catalog [gravitino]
Posted by "hqbhoho (via GitHub)" <gi...@apache.org>.
hqbhoho commented on code in PR #8188:
URL: https://github.com/apache/gravitino/pull/8188#discussion_r2302715831
##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/hive/HiveMetadataAdapter.java:
##########
@@ -249,4 +251,14 @@ public ConnectorTableMetadata getTableMetadata(GravitinoTable gravitinoTable) {
properties,
Optional.ofNullable(gravitinoTable.getComment()));
}
+
+ /**
+ * Get the column handle name that will generate row IDs for the merge operation.
+ *
+ * @return the column handle name for row IDs
+ */
+ @Override
+ public String getMergeRowIdColumnHandleName() {
+ return MERGE_ROW_ID;
Review Comment:
Retrieve it from the internal connector is diffcult because it is generated and not exist in table schema. In origin connector like jdbc define like this ,
```
@Override
public ColumnHandle getMergeRowIdColumnHandle(ConnectorSession session, ConnectorTableHandle tableHandle)
{
verify(!isTableHandleForProcedure(tableHandle), "Not a table reference: %s", tableHandle);
// The column is used for row-level merge, which is not supported, but it's required during analysis anyway.
return new JdbcColumnHandle(
MERGE_ROW_ID,
new JdbcTypeHandle(Types.BIGINT, Optional.of("bigint"), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()),
BIGINT);
}
```
Currently, I use the column name is same with origin connector.
I'm not sure if having two different names (GrivitinoColumn/internal connector column handle) for the same column would cause problems . I will check later.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6403] improvement(trino-connector): Support SQL UPDATE/DELETE with jdbc catalog [gravitino]
Posted by "diqiu50 (via GitHub)" <gi...@apache.org>.
diqiu50 commented on code in PR #8188:
URL: https://github.com/apache/gravitino/pull/8188#discussion_r2302690815
##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/hive/HiveMetadataAdapter.java:
##########
@@ -249,4 +251,14 @@ public ConnectorTableMetadata getTableMetadata(GravitinoTable gravitinoTable) {
properties,
Optional.ofNullable(gravitinoTable.getComment()));
}
+
+ /**
+ * Get the column handle name that will generate row IDs for the merge operation.
+ *
+ * @return the column handle name for row IDs
+ */
+ @Override
+ public String getMergeRowIdColumnHandleName() {
+ return MERGE_ROW_ID;
Review Comment:
I think providing a common implementation is enough. Either retrieve it from the internal connector, or generate it uniformly according to our own rules.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6403] improvement(trino-connector): Support SQL UPDATE/DELETE with jdbc catalog [gravitino]
Posted by "hqbhoho (via GitHub)" <gi...@apache.org>.
hqbhoho commented on PR #8188:
URL: https://github.com/apache/gravitino/pull/8188#issuecomment-3236547783
Maybe we can add a configuration `trino-worker-num` (default 0) to facilitate deploying a distributed environment for testing purposes. If `trino-worker-num` = 0, it will use the current implementation which use a single node that functions as both a coordinator and worker.
```
bash trino-connector/integration-test/trino-test-tools/trino_test.sh --test_set=jdbc-mysql --trino-worker-num=3
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6403] improvement(trino-connector): Support SQL UPDATE/DELETE with jdbc catalog [gravitino]
Posted by "diqiu50 (via GitHub)" <gi...@apache.org>.
diqiu50 commented on PR #8188:
URL: https://github.com/apache/gravitino/pull/8188#issuecomment-3235943483
> > There is no need to make it that complicated. Just deploy a Trino cluster with more than two nodes and the Gravitino Trino connector, then perform a manual test.
>
> @diqiu50 I want update docker-compose.yaml to add worker-only node for test, because it can reuse for users, maybe can add a config to decide whether use or not, what do you think?
We do not prefer the default CI to run distributed environment tests.
We provide a command-line testing tool that can run tests in your customized environment.
```
gravitino/trino-connector/integration-test/trino-test-tools/trino_test.sh
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6403] improvement(trino-connector): Support SQL UPDATE/DELETE with jdbc catalog [gravitino]
Posted by "hqbhoho (via GitHub)" <gi...@apache.org>.
hqbhoho commented on PR #8188:
URL: https://github.com/apache/gravitino/pull/8188#issuecomment-3231701978
> Do we test that case in the distributed Trino environment?
@diqiu50 Currently, only run the integration test. So we need add a distributed Trino environment to test? If necessary, I will have try.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6403] improvement(trino-connector): Support SQL UPDATE/DELETE with jdbc catalog [gravitino]
Posted by "hqbhoho (via GitHub)" <gi...@apache.org>.
hqbhoho commented on PR #8188:
URL: https://github.com/apache/gravitino/pull/8188#issuecomment-3236461678
@diqiu50 In mysql local envirment, I add `trino-worker` in `/gravitino/integration-test-common/docker-script/docker-compose.yaml` and run `bash trino-connector/integration-test/trino-test-tools/trino_test.sh --test_set=jdbc-mysql`
```
trino-worker:
image: trinodb/trino:435
networks:
- trino-net
deploy:
replicas: 3
environment:
- HADOOP_USER_NAME=anonymous
- GRAVITINO_HOST_IP=host.docker.internal
- GRAVITINO_HOST_PORT=${GRAVITINO_SERVER_PORT:-8090}
- GRAVITINO_METALAKE_NAME=test
- HIVE_HOST_IP=hive
entrypoint: /bin/bash /tmp/trino/init-worker.sh
volumes:
- ./init/trino:/tmp/trino
- ../../trino-connector/trino-connector/build/libs:/usr/lib/trino/plugin/gravitino
extra_hosts:
- "host.docker.internal:host-gateway"
depends_on:
trino:
condition: service_healthy
```
result:
```
2025-08-29 17:53:47 INFO [main] TrinoQueryIT:384 - All testers have finished. Total:14, Pass: 14
mysql:jdbc-mysql/00000_create_table.sql, PASS, 33.213,
mysql:jdbc-mysql/00001_select_table.sql, PASS, 35.457,
mysql:jdbc-mysql/00002_alter_table.sql, PASS, 6.388,
mysql:jdbc-mysql/00003_use.sql, PASS, 3.097,
mysql:jdbc-mysql/00004_query_pushdown.sql, PASS, 65.273,
mysql:jdbc-mysql/00005_create_catalog.sql, PASS, 7.288,
mysql:jdbc-mysql/00006_datatype.sql, PASS, 16.817,
mysql:jdbc-mysql/00007_varchar.sql, PASS, 4.463,
mysql:jdbc-mysql/00008_alter_catalog.sql, PASS, 13.704,
mysql:jdbc-mysql/00009_datatype_mapping.sql, PASS, 4.720,
mysql:jdbc-mysql/00010_show_index.sql, PASS, 8.099,
mysql:jdbc-mysql/00011_column_properties.sql, PASS, 4.488,
mysql:jdbc-mysql/00012_update_table.sql, PASS, 5.988,
mysql:jdbc-mysql/00013_delete_table.sql, PASS, 7.753,
All testers have finished. Total:14, Pass: 14
mysql:jdbc-mysql/00000_create_table.sql, PASS, 33.213,
mysql:jdbc-mysql/00001_select_table.sql, PASS, 35.457,
mysql:jdbc-mysql/00002_alter_table.sql, PASS, 6.388,
mysql:jdbc-mysql/00003_use.sql, PASS, 3.097,
mysql:jdbc-mysql/00004_query_pushdown.sql, PASS, 65.273,
mysql:jdbc-mysql/00005_create_catalog.sql, PASS, 7.288,
mysql:jdbc-mysql/00006_datatype.sql, PASS, 16.817,
mysql:jdbc-mysql/00007_varchar.sql, PASS, 4.463,
mysql:jdbc-mysql/00008_alter_catalog.sql, PASS, 13.704,
mysql:jdbc-mysql/00009_datatype_mapping.sql, PASS, 4.720,
mysql:jdbc-mysql/00010_show_index.sql, PASS, 8.099,
mysql:jdbc-mysql/00011_column_properties.sql, PASS, 4.488,
mysql:jdbc-mysql/00012_update_table.sql, PASS, 5.988,
mysql:jdbc-mysql/00013_delete_table.sql, PASS, 7.753,
```
<img width="1274" height="933" alt="image" src="https://github.com/user-attachments/assets/7fc02e02-f6ee-4655-b7c5-8d84b3a7f54b" />
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#6403] improvement(trino-connector): Support SQL UPDATE/DELETE with jdbc catalog [gravitino]
Posted by "diqiu50 (via GitHub)" <gi...@apache.org>.
diqiu50 commented on code in PR #8188:
URL: https://github.com/apache/gravitino/pull/8188#discussion_r2302694443
##########
trino-connector/trino-connector/src/main/java/org/apache/gravitino/trino/connector/catalog/hive/HiveMetadataAdapter.java:
##########
@@ -249,4 +251,14 @@ public ConnectorTableMetadata getTableMetadata(GravitinoTable gravitinoTable) {
properties,
Optional.ofNullable(gravitinoTable.getComment()));
}
+
+ /**
+ * Get the column handle name that will generate row IDs for the merge operation.
+ *
+ * @return the column handle name for row IDs
+ */
+ @Override
+ public String getMergeRowIdColumnHandleName() {
+ return MERGE_ROW_ID;
Review Comment:
Does the name `$merge_row_id` have a special purpose?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org