You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2024/09/20 12:08:46 UTC

(doris) branch branch-2.1 updated: [bugfix](test)Set the enable_fallback_to_original_planner behavior for 2.1 (#40913)(#40989) (#41065)

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

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


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 1686650a56d [bugfix](test)Set the enable_fallback_to_original_planner behavior for 2.1 (#40913)(#40989) (#41065)
1686650a56d is described below

commit 1686650a56dadda2675f5c0997dbf2737aff583c
Author: wuwenchi <wu...@hotmail.com>
AuthorDate: Fri Sep 20 20:08:38 2024 +0800

    [bugfix](test)Set the enable_fallback_to_original_planner behavior for 2.1 (#40913)(#40989) (#41065)
    
    bp:  #40913 #40989
---
 .../iceberg/write/test_iceberg_create_table.groovy | 91 ++++++++++++----------
 1 file changed, 51 insertions(+), 40 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 d76c6a4b052..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,55 +22,66 @@ suite("test_iceberg_create_table", "p0,external,doris,external_docker,external_d
         return
     }
 
-    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[][] 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 """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"
-    );"""
+    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"
 
-    sql """ switch ${catalog_name} """
+        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"
+        );"""
 
-    String db1 = catalog_name + "_db1"
-    String tb1 = db1 + "_tb1"
-    String tb2 = db1 + "_tb2"
+        sql """ switch ${catalog_name} """
 
-    sql """ drop table if exists ${db1}.${tb1} """
-    sql """ drop table if exists ${db1}.${tb2} """
-    sql """ drop database if exists ${db1} """
+        String db1 = catalog_name + "_db1"
+        String tb1 = db1 + "_tb1"
+        String tb2 = db1 + "_tb2"
 
-    sql """ create database ${db1} """
+        sql """ drop table if exists ${db1}.${tb1} """
+        sql """ drop table if exists ${db1}.${tb2} """
+        sql """ drop database if exists ${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}"
-    }
+        sql """ create database ${db1} """
 
-    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 = 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 = 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 = hive """
+            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) """
+        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 """ drop table ${db1}.${tb1} """
-    sql """ drop table ${db1}.${tb2} """
-    sql """ drop database ${db1} """
+        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} """
+    } finally {
+        if (need_set_false) {
+            sql """ set enable_fallback_to_original_planner=true; """
+        }
+    }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org