wsjz commented on code in PR #33153:
URL: https://github.com/apache/doris/pull/33153#discussion_r1554731124
##########
regression-test/suites/external_table_p0/hive/ddl/test_hive_ddl_and_ctas.groovy:
##########
@@ -217,75 +216,372 @@ suite("test_hive_ddl_and_ctas",
"p0,external,hive,external_docker,external_docke
(11, 'value_for_pt1', 'value_for_pt2'),
(22, 'value_for_pt11', 'value_for_pt22');
"""
+ }
+ def destroySrcDDLForCTAS = { String catalog_name ->
sql """ switch `${catalog_name}` """
- // 1. external to external un-partitioned table
- sql """ CREATE TABLE hive_ctas1 ENGINE=hive AS SELECT col1 FROM
unpart_ctas_src;
- """
+ sql """ DROP TABLE IF EXISTS `test_ctas`.part_ctas_src """
+ sql """ DROP TABLE IF EXISTS `test_ctas`.unpart_ctas_src """
+ sql """ drop database if exists `test_ctas` """;
+ sql """ DROP TABLE IF EXISTS
internal.test_ctas_olap.part_ctas_olap_src """
+ sql """ DROP TABLE IF EXISTS
internal.test_ctas_olap.unpart_ctas_olap_src """
+ sql """ switch internal """;
+ sql """ drop database if exists test_ctas_olap """;
+ }
- sql """ INSERT INTO hive_ctas1 SELECT col1 FROM unpart_ctas_src
WHERE col1 > 1;
- """
+ def test_ctas_tbl = { String file_format, String catalog_name ->
+ generateSrcDDLForCTAS(file_format, catalog_name)
+ try {
+ sql """ switch `${catalog_name}` """
+ // 1. external to external un-partitioned table
+ sql """ CREATE TABLE hive_ctas1 ENGINE=hive AS SELECT col1
FROM unpart_ctas_src;
+ """
- order_qt_ctas_01 """ SELECT * FROM hive_ctas1 """
- sql """ DROP TABLE hive_ctas1 """
+ sql """ INSERT INTO hive_ctas1 SELECT col1 FROM
unpart_ctas_src WHERE col1 > 1;
+ """
+ sql """ INSERT OVERWRITE TABLE hive_ctas1 SELECT col1 FROM
unpart_ctas_src WHERE col1 > 1;
+ """
- // 2. external to external partitioned table
- sql """ CREATE TABLE hive_ctas2 ENGINE=hive AS SELECT col1,pt1,pt2
FROM part_ctas_src WHERE col1>0;
+ order_qt_ctas_01 """ SELECT * FROM hive_ctas1 """
+ sql """ DROP TABLE hive_ctas1 """
+
+ // 2. external to external partitioned table
+ sql """ CREATE TABLE hive_ctas2 ENGINE=hive AS SELECT
col1,pt1,pt2 FROM part_ctas_src WHERE col1>0;
Review Comment:
see test_ctas_ex.hive_ctas2
--
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]