This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 61dc2580349 [bugfix](testcase) Set the 
enable_fallback_to_original_planner behavior (#40989)
61dc2580349 is described below

commit 61dc25803498ceba62af60e4fe89cef4a9c886a3
Author: wuwenchi <[email protected]>
AuthorDate: Fri Sep 20 16:22:41 2024 +0800

    [bugfix](testcase) Set the enable_fallback_to_original_planner behavior 
(#40989)
    
    ## Proposed changes
    
    In the latest master code, `enable_fallback_to_original_planner` no
    longer exists, so the return value needs to be processed.
    
    followup #40913
---
 .../iceberg/write/test_iceberg_create_table.groovy | 97 ++++++++++++----------
 1 file changed, 51 insertions(+), 46 deletions(-)

diff --git 
a/regression-test/suites/external_table_p0/iceberg/write/test_iceberg_create_table.groovy
 
b/regression-test/suites/external_table_p0/iceberg/write/test_iceberg_create_table.groovy
index d144af1f71b..22364b8bc96 100644
--- 
a/regression-test/suites/external_table_p0/iceberg/write/test_iceberg_create_table.groovy
+++ 
b/regression-test/suites/external_table_p0/iceberg/write/test_iceberg_create_table.groovy
@@ -22,61 +22,66 @@ suite("test_iceberg_create_table", 
"p0,external,doris,external_docker,external_d
         return
     }
 
-    String[][] ret = sql """ show variables like 
'enable_fallback_to_original_planner' """
-    String origin_fallback = ret[0][1]
+    String[][] ret = sql"""show variables like 
'enable_fallback_to_original_planner';"""
+    boolean need_set_false = ret.size() == 1 && ret[0][1] == "true"
+    if (need_set_false) {
+        sql """ set enable_fallback_to_original_planner=false; """
+    }
 
-    sql """ set enable_fallback_to_original_planner=false; """
+    try {
+        String rest_port = 
context.config.otherConfigs.get("iceberg_rest_uri_port")
+        String minio_port = 
context.config.otherConfigs.get("iceberg_minio_port")
+        String externalEnvIp = context.config.otherConfigs.get("externalEnvIp")
+        String catalog_name = "test_iceberg_create_table"
 
-    String rest_port = context.config.otherConfigs.get("iceberg_rest_uri_port")
-    String minio_port = context.config.otherConfigs.get("iceberg_minio_port")
-    String externalEnvIp = context.config.otherConfigs.get("externalEnvIp")
-    String catalog_name = "test_iceberg_create_table"
+        sql """drop catalog if exists ${catalog_name}"""
+        sql """
+        CREATE CATALOG ${catalog_name} PROPERTIES (
+            'type'='iceberg',
+            'iceberg.catalog.type'='rest',
+            'uri' = 'http://${externalEnvIp}:${rest_port}',
+            "s3.access_key" = "admin",
+            "s3.secret_key" = "password",
+            "s3.endpoint" = "http://${externalEnvIp}:${minio_port}";,
+            "s3.region" = "us-east-1"
+        );"""
 
-    sql """drop catalog if exists ${catalog_name}"""
-    sql """
-    CREATE CATALOG ${catalog_name} PROPERTIES (
-        'type'='iceberg',
-        'iceberg.catalog.type'='rest',
-        'uri' = 'http://${externalEnvIp}:${rest_port}',
-        "s3.access_key" = "admin",
-        "s3.secret_key" = "password",
-        "s3.endpoint" = "http://${externalEnvIp}:${minio_port}";,
-        "s3.region" = "us-east-1"
-    );"""
+        sql """ switch ${catalog_name} """
 
-    sql """ switch ${catalog_name} """
+        String db1 = catalog_name + "_db1"
+        String tb1 = db1 + "_tb1"
+        String tb2 = db1 + "_tb2"
 
-    String db1 = catalog_name + "_db1"
-    String tb1 = db1 + "_tb1"
-    String tb2 = db1 + "_tb2"
+        sql """ drop table if exists ${db1}.${tb1} """
+        sql """ drop table if exists ${db1}.${tb2} """
+        sql """ drop database if exists ${db1} """
 
-    sql """ drop table if exists ${db1}.${tb1} """
-    sql """ drop table if exists ${db1}.${tb2} """
-    sql """ drop database if exists ${db1} """
+        sql """ create database ${db1} """
 
-    sql """ create database ${db1} """
+        test {
+            sql """ create table ${db1}.${tb1} (id int) engine = olap """
+            exception "Cannot create olap table out of internal catalog. Make 
sure 'engine' type is specified when use the catalog: ${catalog_name}"
+        }
 
-    test {
-        sql """ create table ${db1}.${tb1} (id int) engine = olap """
-        exception "Cannot create olap table out of internal catalog. Make sure 
'engine' type is specified when use the catalog: ${catalog_name}"
-    }
+        test {
+            sql """ create table ${db1}.${tb1} (id int) engine = hive """
+            exception "java.sql.SQLException: errCode = 2, detailMessage = 
Iceberg type catalog can only use `iceberg` engine."
+        }
 
-    test {
-        sql """ create table ${db1}.${tb1} (id int) engine = hive """
-        exception "java.sql.SQLException: errCode = 2, detailMessage = Iceberg 
type catalog can only use `iceberg` engine."
-    }
+        test {
+            sql """ create table ${db1}.${tb1} (id int) engine = jdbc """
+            exception "java.sql.SQLException: errCode = 2, detailMessage = 
Iceberg type catalog can only use `iceberg` engine."
+        }
 
-    test {
-        sql """ create table ${db1}.${tb1} (id int) engine = jdbc """
-        exception "java.sql.SQLException: errCode = 2, detailMessage = Iceberg 
type catalog can only use `iceberg` engine."
-    }
+        sql """ create table ${db1}.${tb1} (id int) engine = iceberg """
+        sql """ create table ${db1}.${tb2} (id int) """
 
-    sql """ create table ${db1}.${tb1} (id int) engine = iceberg """
-    sql """ create table ${db1}.${tb2} (id int) """
-
-    sql """ drop table ${db1}.${tb1} """
-    sql """ drop table ${db1}.${tb2} """
-    sql """ drop database ${db1} """
-
-    sql """ set enable_fallback_to_original_planner=${origin_fallback}; """
+        sql """ drop table ${db1}.${tb1} """
+        sql """ drop table ${db1}.${tb2} """
+        sql """ drop database ${db1} """
+    } finally {
+        if (need_set_false) {
+            sql """ set enable_fallback_to_original_planner=true; """
+        }
+    }
 }


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

Reply via email to