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/22 14:22:07 UTC

[PR] [#8241] improvement(trino-connector): Support SQL UPDATE/DELETE/MERGE with Hive/Iceberg [gravitino]

hqbhoho opened a new pull request, #8258:
URL: https://github.com/apache/gravitino/pull/8258

   ### What changes were proposed in this pull request?
   
   Support SQL UPDATE/DELETE/MERGE with Hive/Iceberg
   
   ### Why are the changes needed?
   
   Fix: #8241 8241
   
   ### 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] [#8241] improvement(trino-connector): Support SQL UPDATE/DELETE/MERGE with Hive/Iceberg [gravitino]

Posted by "diqiu50 (via GitHub)" <gi...@apache.org>.
diqiu50 commented on code in PR #8258:
URL: https://github.com/apache/gravitino/pull/8258#discussion_r2318357356


##########
integration-test-common/docker-script/init/hive/init.sql:
##########
@@ -0,0 +1,30 @@
+CREATE DATABASE gt_hive_test_acid;
+SET hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
+SET hive.support.concurrency=true;
+CREATE TABLE gt_hive_test_acid.test_update
+(
+    id INT,
+    name STRING,
+    salary INT
+)
+CLUSTERED BY (id) INTO 4 BUCKETS
+STORED AS ORC
+TBLPROPERTIES ('transactional'='true');
+CREATE TABLE gt_hive_test_acid.test_delete
+(
+    id INT,
+    name STRING,
+    salary INT
+)
+CLUSTERED BY (id) INTO 4 BUCKETS
+STORED AS ORC
+TBLPROPERTIES ('transactional'='true');
+CREATE TABLE gt_hive_test_acid.test_merge
+(
+    id INT,
+    name STRING,
+    salary INT
+)
+CLUSTERED BY (id) INTO 4 BUCKETS
+STORED AS ORC
+TBLPROPERTIES ('transactional'='true');

Review Comment:
   Why is the table created here instead of within the test script?



-- 
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] [#8241] improvement(trino-connector): Support SQL UPDATE/DELETE/MERGE with Hive/Iceberg [gravitino]

Posted by "hqbhoho (via GitHub)" <gi...@apache.org>.
hqbhoho commented on code in PR #8258:
URL: https://github.com/apache/gravitino/pull/8258#discussion_r2318427796


##########
integration-test-common/docker-script/init/hive/init.sql:
##########
@@ -0,0 +1,30 @@
+CREATE DATABASE gt_hive_test_acid;
+SET hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
+SET hive.support.concurrency=true;
+CREATE TABLE gt_hive_test_acid.test_update
+(
+    id INT,
+    name STRING,
+    salary INT
+)
+CLUSTERED BY (id) INTO 4 BUCKETS
+STORED AS ORC
+TBLPROPERTIES ('transactional'='true');
+CREATE TABLE gt_hive_test_acid.test_delete
+(
+    id INT,
+    name STRING,
+    salary INT
+)
+CLUSTERED BY (id) INTO 4 BUCKETS
+STORED AS ORC
+TBLPROPERTIES ('transactional'='true');
+CREATE TABLE gt_hive_test_acid.test_merge
+(
+    id INT,
+    name STRING,
+    salary INT
+)
+CLUSTERED BY (id) INTO 4 BUCKETS
+STORED AS ORC
+TBLPROPERTIES ('transactional'='true');

Review Comment:
   Currently, it can't create a hive acid table like this: 
   ```sql
   CREATE TABLE tb01 (
       n_nationkey bigint,
       n_name varchar,
       n_regionkey bigint,
       n_comment varchar,
       part_key varchar
   ) WITH (bucket_count = 4, bucketed_by = ARRAY['n_regionkey'], transactional = 'true', format = 'ORC');
   
   Expect:
   CREATE TABLE
   Actual:
   Query 20250903_094457_00270_ajycf failed: Catalog 'gt_hive' table property 'transactional' does not exist.
   ```
   
   Considering that ACID tables in Hive are not widely used, I feel it's unnecessary to support their creation in Gravitino for now.
   



-- 
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] [#8241] improvement(trino-connector): Support SQL UPDATE/DELETE/MERGE with Hive/Iceberg [gravitino]

Posted by "hqbhoho (via GitHub)" <gi...@apache.org>.
hqbhoho commented on code in PR #8258:
URL: https://github.com/apache/gravitino/pull/8258#discussion_r2318439508


##########
integration-test-common/docker-script/init/hive/init.sh:
##########
@@ -19,4 +19,14 @@
 IP=$(hostname -I | awk '{print $1}')
 sed -i "s|<value>hdfs://__REPLACE__HOST_NAME:9000|<value>hdfs://${IP}:9000|g" ${HIVE_TMP_CONF_DIR}/hive-site.xml
 
-/bin/bash /usr/local/sbin/start.sh
+/bin/bash /usr/local/sbin/start.sh &
+

Review Comment:
   The main purpose here is to perform the execution to create the relevant tables which define in `init.sql`.
   ​​Run `/bin/bash /usr/local/sbin/start.sh` will block.
   `/usr/local/sbin/start.sh` define end with:
   ```shell
   # start hive
   echo "Starting Hive..."
   ${HIVE_HOME}/bin/schematool -initSchema -dbType mysql
   ${HIVE_HOME}/bin/hive --service hiveserver2 > /dev/null 2>&1 &
   ${HIVE_HOME}/bin/hive --service metastore > /dev/null 2>&1 &
   
   echo "Hive started successfully."
   
   # persist the container
   tail -f /dev/null
   ```
   



-- 
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] [#8241] improvement(trino-connector): Support SQL UPDATE/DELETE/MERGE with Hive/Iceberg [gravitino]

Posted by "diqiu50 (via GitHub)" <gi...@apache.org>.
diqiu50 commented on code in PR #8258:
URL: https://github.com/apache/gravitino/pull/8258#discussion_r2318364889


##########
integration-test-common/docker-script/init/hive/init.sh:
##########
@@ -19,4 +19,14 @@
 IP=$(hostname -I | awk '{print $1}')
 sed -i "s|<value>hdfs://__REPLACE__HOST_NAME:9000|<value>hdfs://${IP}:9000|g" ${HIVE_TMP_CONF_DIR}/hive-site.xml
 
-/bin/bash /usr/local/sbin/start.sh
+/bin/bash /usr/local/sbin/start.sh &
+

Review Comment:
   Does it not work in `docker-comple.yaml `
   ```
       healthcheck:
         test: ["CMD", "/tmp/check-status.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] [#8241] improvement(trino-connector): Support SQL UPDATE/DELETE/MERGE with Hive/Iceberg [gravitino]

Posted by "hqbhoho (via GitHub)" <gi...@apache.org>.
hqbhoho commented on code in PR #8258:
URL: https://github.com/apache/gravitino/pull/8258#discussion_r2318427796


##########
integration-test-common/docker-script/init/hive/init.sql:
##########
@@ -0,0 +1,30 @@
+CREATE DATABASE gt_hive_test_acid;
+SET hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager;
+SET hive.support.concurrency=true;
+CREATE TABLE gt_hive_test_acid.test_update
+(
+    id INT,
+    name STRING,
+    salary INT
+)
+CLUSTERED BY (id) INTO 4 BUCKETS
+STORED AS ORC
+TBLPROPERTIES ('transactional'='true');
+CREATE TABLE gt_hive_test_acid.test_delete
+(
+    id INT,
+    name STRING,
+    salary INT
+)
+CLUSTERED BY (id) INTO 4 BUCKETS
+STORED AS ORC
+TBLPROPERTIES ('transactional'='true');
+CREATE TABLE gt_hive_test_acid.test_merge
+(
+    id INT,
+    name STRING,
+    salary INT
+)
+CLUSTERED BY (id) INTO 4 BUCKETS
+STORED AS ORC
+TBLPROPERTIES ('transactional'='true');

Review Comment:
   Currently, it can't create a hive ACID table like this: 
   ```sql
   CREATE TABLE tb01 (
       n_nationkey bigint,
       n_name varchar,
       n_regionkey bigint,
       n_comment varchar,
       part_key varchar
   ) WITH (bucket_count = 4, bucketed_by = ARRAY['n_regionkey'], transactional = 'true', format = 'ORC');
   
   Expect:
   CREATE TABLE
   Actual:
   Query 20250903_094457_00270_ajycf failed: Catalog 'gt_hive' table property 'transactional' does not exist.
   ```
   
   Considering that ACID tables in Hive are not widely used, I feel it's unnecessary to support their creation in Gravitino for now.
   



-- 
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] [#8241] improvement(trino-connector): Support SQL UPDATE/DELETE/MERGE with Hive/Iceberg [gravitino]

Posted by "hqbhoho (via GitHub)" <gi...@apache.org>.
hqbhoho commented on PR #8258:
URL: https://github.com/apache/gravitino/pull/8258#issuecomment-3244602458

   @diqiu50 @yuqi1129  PTAL, thanks!


-- 
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