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

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

commit b1795d44ecd0f2ceaac2a51699bc97de63ada977
Author: wuwenchi <wuwenchi...@hotmail.com>
AuthorDate: Mon May 27 10:44:12 2024 +0800

    [bugfix](hive)fix testcase for test_hive_write_different_path (#35209)
    
    Hive's test environment uses docker, so when using 127.0.0.1,
    BE will write the file to the docker of its own machine.
    But if FE and are not on the same machine,
    FE cannot read this file because it can only read docker on its own machine.
    Therefore, the address 127.0.0.1 cannot be used in the test environment.
---
 .../hive/write/test_hive_write_different_path.out  |  8 +--
 .../write/test_hive_write_different_path.groovy    | 61 ++++++++++++----------
 2 files changed, 36 insertions(+), 33 deletions(-)

diff --git 
a/regression-test/data/external_table_p0/hive/write/test_hive_write_different_path.out
 
b/regression-test/data/external_table_p0/hive/write/test_hive_write_different_path.out
index 626a46763ea..ae5adf28dc9 100644
--- 
a/regression-test/data/external_table_p0/hive/write/test_hive_write_different_path.out
+++ 
b/regression-test/data/external_table_p0/hive/write/test_hive_write_different_path.out
@@ -1,20 +1,20 @@
 -- This file is automatically generated. You should know what you did if you 
want to edit this
--- !q01 --
+-- !q001 --
 1      a       a       1
 2      b       a       1
 3      c       a       1
 
--- !q02 --
+-- !q002 --
 4      d       a       1
 5      e       a       1
 6      f       a       1
 
--- !q01 --
+-- !q001 --
 1      a       a       1
 2      b       a       1
 3      c       a       1
 
--- !q02 --
+-- !q002 --
 4      d       a       1
 5      e       a       1
 6      f       a       1
diff --git 
a/regression-test/suites/external_table_p0/hive/write/test_hive_write_different_path.groovy
 
b/regression-test/suites/external_table_p0/hive/write/test_hive_write_different_path.groovy
index 744e474539c..3384cb8b88d 100644
--- 
a/regression-test/suites/external_table_p0/hive/write/test_hive_write_different_path.groovy
+++ 
b/regression-test/suites/external_table_p0/hive/write/test_hive_write_different_path.groovy
@@ -28,13 +28,13 @@ suite("test_hive_write_different_path", 
"p0,external,hive,external_docker,extern
         setHivePrefix(hivePrefix)
         try {
             String hms_port = context.config.otherConfigs.get(hivePrefix + 
"HmsPort")
-            String hdfs_port = context.config.otherConfigs.get(hivePrefix + 
"HdfsPort")
+            String hdfs_port2 = 
context.config.otherConfigs.get("hive2HdfsPort")
+            String hdfs_port3 = 
context.config.otherConfigs.get("hive3HdfsPort")
             String externalEnvIp = 
context.config.otherConfigs.get("externalEnvIp")
 
             String catalog1 = 
"test_${hivePrefix}_write_insert_without_defaultfs"
-            String catalog2 = 
"test_${hivePrefix}_write_insert_with_external_ip"
-            String catalog3 = "test_${hivePrefix}_write_insert_with_local_ip"
-            String localEnvIp = "127.0.0.1"
+            String catalog2 = "test_${hivePrefix}_write_insert_with_hdfs2"
+            String catalog3 = "test_${hivePrefix}_write_insert_with_hdfs3"
 
             sql """drop catalog if exists ${catalog1}"""
             sql """drop catalog if exists ${catalog2}"""
@@ -45,51 +45,54 @@ suite("test_hive_write_different_path", 
"p0,external,hive,external_docker,extern
             );"""
 
             sql """ use ${catalog1}.write_test """
-            sql """ drop table if exists tb_with_external_ip """
-            sql """ drop table if exists tb_with_local_ip """
+            sql """ drop table if exists tb_with_hdfs2 """
+            sql """ drop table if exists tb_with_hdfs3 """
 
             sql """
-              CREATE TABLE `tb_with_external_ip`
+              CREATE TABLE `tb_with_hdfs2`
               (
-                `col_bigint_undef_signed` BIGINT NULL,   
-                `col_varchar_10__undef_signed` VARCHAR(10) NULL,   
-                `col_varchar_64__undef_signed` VARCHAR(64) NULL,   
+                `col_bigint_undef_signed` BIGINT NULL,
+                `col_varchar_10__undef_signed` VARCHAR(10) NULL,
+                `col_varchar_64__undef_signed` VARCHAR(64) NULL,
                 `pk` INT NULL ) properties (
-                'location' = 
'hdfs://${externalEnvIp}:${hdfs_port}/user/hive/warehouse/write_test.db/tb_with_external_ip/'
-              ); 
+                'location' = 
'hdfs://${externalEnvIp}:${hdfs_port2}/user/hive/warehouse/write_test.db/tb_with_hdfs2/'
+              );
             """
 
             sql """
-              CREATE TABLE `tb_with_local_ip`
+              CREATE TABLE `tb_with_hdfs3`
               (
-                `col_bigint_undef_signed` BIGINT NULL,   
-                `col_varchar_10__undef_signed` VARCHAR(10) NULL,   
-                `col_varchar_64__undef_signed` VARCHAR(64) NULL,   
+                `col_bigint_undef_signed` BIGINT NULL,
+                `col_varchar_10__undef_signed` VARCHAR(10) NULL,
+                `col_varchar_64__undef_signed` VARCHAR(64) NULL,
                 `pk` INT NULL ) properties (
-                'location' = 
'hdfs://${localEnvIp}:${hdfs_port}/user/hive/warehouse/write_test.db/tb_with_local_ip/'
-              ); 
+                'location' = 
'hdfs://${externalEnvIp}:${hdfs_port3}/user/hive/warehouse/write_test.db/tb_with_hdfs3/'
+              );
             """
-            
+
             sql """create catalog if not exists ${catalog2} properties (
                 'type'='hms',
                 'hive.metastore.uris' = 
'thrift://${externalEnvIp}:${hms_port}',
-                'fs.defaultFS' = 'hdfs://${externalEnvIp}:${hdfs_port}'
+                'fs.defaultFS' = 'hdfs://${externalEnvIp}:${hdfs_port2}'
             );"""
             sql """create catalog if not exists ${catalog3} properties (
                 'type'='hms',
                 'hive.metastore.uris' = 
'thrift://${externalEnvIp}:${hms_port}',
-                'fs.defaultFS' = 'hdfs://${localEnvIp}:${hdfs_port}'
+                'fs.defaultFS' = 'hdfs://${externalEnvIp}:${hdfs_port3}'
             );"""
 
-            sql """ insert into ${catalog1}.write_test.tb_with_external_ip 
values (1,'a','a',1) """
-            sql """ insert into ${catalog2}.write_test.tb_with_external_ip 
values (2,'b','a',1) """
-            sql """ insert into ${catalog3}.write_test.tb_with_external_ip 
values (3,'c','a',1) """
-            sql """ insert into ${catalog1}.write_test.tb_with_local_ip values 
(4,'d','a',1) """
-            sql """ insert into ${catalog2}.write_test.tb_with_local_ip values 
(5,'e','a',1) """
-            sql """ insert into ${catalog3}.write_test.tb_with_local_ip values 
(6,'f','a',1) """
+            sql """ insert into ${catalog1}.write_test.tb_with_hdfs2 values 
(1,'a','a',1) """
+            sql """ insert into ${catalog2}.write_test.tb_with_hdfs2 values 
(2,'b','a',1) """
+            sql """ insert into ${catalog3}.write_test.tb_with_hdfs2 values 
(3,'c','a',1) """
+            sql """ insert into ${catalog1}.write_test.tb_with_hdfs3 values 
(4,'d','a',1) """
+            sql """ insert into ${catalog2}.write_test.tb_with_hdfs3 values 
(5,'e','a',1) """
+            sql """ insert into ${catalog3}.write_test.tb_with_hdfs3 values 
(6,'f','a',1) """
+
+            order_qt_q001 """ select * from 
${catalog1}.write_test.tb_with_hdfs2 order by col_bigint_undef_signed """
+            order_qt_q002 """ select * from 
${catalog1}.write_test.tb_with_hdfs3 order by col_bigint_undef_signed """
 
-            qt_q01 """ select * from 
${catalog1}.write_test.tb_with_external_ip order by col_bigint_undef_signed """
-            qt_q02 """ select * from ${catalog1}.write_test.tb_with_local_ip 
order by col_bigint_undef_signed """
+            sql """drop table ${catalog1}.write_test.tb_with_hdfs2"""
+            sql """drop table ${catalog1}.write_test.tb_with_hdfs3"""
 
             sql """drop catalog if exists ${catalog1}"""
             sql """drop catalog if exists ${catalog2}"""


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

Reply via email to