Copilot commented on code in PR #62610:
URL: https://github.com/apache/doris/pull/62610#discussion_r3114625304


##########
regression-test/suites/external_table_p0/hive/test_hive_use_meta_cache_false.groovy:
##########
@@ -172,6 +172,12 @@ suite("test_hive_use_meta_cache_false", "p0,external") {
             }
             // test_use_meta_cache(false)
         } finally {
+            try_hive_docker "drop database if exists 
test_use_meta_cache_db_true force"
+            try_hive_docker "drop database if exists 
test_use_meta_cache_db_hive_true cascade"
+            try_hive_docker "drop database if exists 
test_use_meta_cache_db_false force"

Review Comment:
   `try_hive_docker` executes Hive SQL, but `DROP DATABASE ... force` is not 
valid in Hive. As a result the finally cleanup may not actually remove 
`test_use_meta_cache_db_true/false`, which can contaminate subsequent suites in 
the same Docker Hive. Use Hive-supported syntax (e.g. `drop database if exists 
... cascade`) for these cleanup statements.
   



##########
regression-test/suites/external_table_p0/hive/test_hive_use_meta_cache_true.groovy:
##########
@@ -151,6 +151,12 @@ suite("test_hive_use_meta_cache_true", "p0,external") {
             }
             test_use_meta_cache(true)
         } finally {
+            try_hive_docker "drop database if exists 
test_use_meta_cache_db_true force"
+            try_hive_docker "drop database if exists 
test_use_meta_cache_db_hive_true cascade"
+            try_hive_docker "drop database if exists 
test_use_meta_cache_db_false force"

Review Comment:
   `try_hive_docker` runs Hive SQL, but `DROP DATABASE ... force` is not valid 
Hive syntax (Hive uses `CASCADE`/`RESTRICT`). This cleanup will fail (even if 
swallowed) and may leave databases behind, defeating the suite 
state-restoration goal. Replace `force` with `cascade` (and/or explicitly drop 
created tables) for the Hive-side cleanup.
   



##########
regression-test/suites/external_table_p0/hive/ddl/test_hive_truncate_table.groovy:
##########
@@ -98,8 +99,11 @@ suite("test_hive_truncate_table", "p0,external") {
         checkNereidsExecute("truncate table ${table_name}")
         order_qt_truncate_09 """ select * from ${table_name}; """
 
-        sql """drop table ${table_name};"""
-        sql """drop database ${database_name};"""
-        sql """drop catalog ${catalog_name};"""
+            sql """drop table ${table_name};"""
+            sql """drop database ${database_name};"""
+            sql """drop catalog ${catalog_name};"""
+        } finally {

Review Comment:
   The new `finally` block only drops the catalog. If the test fails before the 
explicit `drop table`/`drop database` calls in the `try`, the Hive-side 
database (`hive_truncate`) and tables can be left behind and affect subsequent 
runs even though the catalog is removed. Consider extending the `finally` 
cleanup to also `try_sql`/`try_hive_docker` drop the created database (and any 
tables) so the Docker Hive state is reliably restored on failure.
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to