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

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

commit 54cc744981d83b7d7a37443a94b0b2d6650284f0
Author: yongkang.zhong <[email protected]>
AuthorDate: Tue Feb 28 12:10:24 2023 +0800

    [test](test_multi_partition) add multi partition by datetime test (#17068)
    
    add multi partition by datetime test , This feature was created by 
@catpineapple
---
 be/src/olap/rowset/beta_rowset_reader.cpp          |   2 +-
 .../main/java/org/apache/doris/qe/Coordinator.java |   1 +
 .../multi_partition/test_multi_partition.groovy    | 104 ++++++++++++++++++++-
 3 files changed, 105 insertions(+), 2 deletions(-)

diff --git a/be/src/olap/rowset/beta_rowset_reader.cpp 
b/be/src/olap/rowset/beta_rowset_reader.cpp
index df90d9ee03..3b52b110b1 100644
--- a/be/src/olap/rowset/beta_rowset_reader.cpp
+++ b/be/src/olap/rowset/beta_rowset_reader.cpp
@@ -76,7 +76,7 @@ Status 
BetaRowsetReader::get_segment_iterators(RowsetReaderContext* read_context
                 _rowset->end_version(), 
_read_options.delete_condition_predicates.get(),
                 &_read_options.del_predicates_for_zone_map);
         // if del cond is not empty, schema may be different in multiple rowset
-        _can_reuse_schema = _read_options.col_id_to_del_predicates.empty();
+        _can_reuse_schema = _read_options.del_predicates_for_zone_map.empty();
     }
     // In vertical compaction, every column group need new schema
     if (read_context->is_vertical_compaction) {
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java 
b/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java
index 0542b96c70..31a392e3bf 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java
@@ -135,6 +135,7 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
+import java.util.stream.Collectors;
 
 public class Coordinator {
     private static final Logger LOG = LogManager.getLogger(Coordinator.class);
diff --git 
a/regression-test/suites/partition_p0/multi_partition/test_multi_partition.groovy
 
b/regression-test/suites/partition_p0/multi_partition/test_multi_partition.groovy
index 3f775143de..2717f372d6 100644
--- 
a/regression-test/suites/partition_p0/multi_partition/test_multi_partition.groovy
+++ 
b/regression-test/suites/partition_p0/multi_partition/test_multi_partition.groovy
@@ -219,4 +219,106 @@ suite("test_multi_partition") {
     logger.info("${result2}")
     assertEquals(result2.size(), 48)
     sql "drop table multi_par5"
-}
+
+
+    sql "drop table if exists multi_par6"
+    sql """
+        CREATE TABLE IF NOT EXISTS multi_par6 (
+            k1 tinyint NOT NULL,
+            k2 smallint NOT NULL,
+            k3 int NOT NULL,
+            k4 bigint NOT NULL,
+            k5 decimal(9, 3) NOT NULL,
+            k6 char(5) NOT NULL,
+            k10 date NOT NULL,
+            k11 datetime NOT NULL,
+            k12 datev2 NOT NULL,
+            k13 datetimev2 NOT NULL,
+            k14 datetimev2(3) NOT NULL,
+            k15 datetimev2(6) NOT NULL,
+            k7 varchar(20) NOT NULL,
+            k8 double max NOT NULL,
+            k9 float sum NOT NULL )
+        AGGREGATE KEY(k1,k2,k3,k4,k5,k6,k10,k11,k12,k13,k14,k15,k7)
+        PARTITION BY RANGE(k11) (
+            FROM ("2022-11-02 00:00:00") TO ("2022-12-02 00:00:00") INTERVAL 1 
DAY
+            )
+        DISTRIBUTED BY HASH(k1) BUCKETS 5 properties("replication_num" = "1")
+        """
+    result1  = sql "show tables like 'multi_par6'"
+    logger.info("${result1}")
+    assertEquals(result1.size(), 1)
+    result2  = sql "show partitions from multi_par6"
+    logger.info("${result2}")
+    assertEquals(result2.size(), 30)
+    sql "drop table multi_par6"
+
+
+    sql "drop table if exists multi_par7"
+    sql """
+        CREATE TABLE IF NOT EXISTS multi_par7 (
+            k1 tinyint NOT NULL,
+            k2 smallint NOT NULL,
+            k3 int NOT NULL,
+            k4 bigint NOT NULL,
+            k5 decimal(9, 3) NOT NULL,
+            k6 char(5) NOT NULL,
+            k10 date NOT NULL,
+            k11 datetime NOT NULL,
+            k12 datev2 NOT NULL,
+            k13 datetimev2 NOT NULL,
+            k14 datetimev2(3) NOT NULL,
+            k15 datetimev2(6) NOT NULL,
+            k7 varchar(20) NOT NULL,
+            k8 double max NOT NULL,
+            k9 float sum NOT NULL )
+        AGGREGATE KEY(k1,k2,k3,k4,k5,k6,k10,k11,k12,k13,k14,k15,k7)
+        PARTITION BY RANGE(k13) (
+            FROM ("2022-11-02 00:00:00") TO ("2022-12-02 00:00:00") INTERVAL 1 
DAY
+            )
+        DISTRIBUTED BY HASH(k1) BUCKETS 5 properties("replication_num" = "1")
+        """
+    result1  = sql "show tables like 'multi_par7'"
+    logger.info("${result1}")
+    assertEquals(result1.size(), 1)
+    result2  = sql "show partitions from multi_par7"
+    logger.info("${result2}")
+    assertEquals(result2.size(), 30)
+    sql "drop table multi_par7"
+
+
+
+
+    sql "drop table if exists multi_par8"
+    sql """
+        CREATE TABLE IF NOT EXISTS multi_par8 (
+            k1 tinyint NOT NULL,
+            k2 smallint NOT NULL,
+            k3 int NOT NULL,
+            k4 bigint NOT NULL,
+            k5 decimal(9, 3) NOT NULL,
+            k6 char(5) NOT NULL,
+            k10 date NOT NULL,
+            k11 datetime NOT NULL,
+            k12 datev2 NOT NULL,
+            k13 datetimev2 NOT NULL,
+            k14 datetimev2(3) NOT NULL,
+            k15 datetimev2(6) NOT NULL,
+            k7 varchar(20) NOT NULL,
+            k8 double max NOT NULL,
+            k9 float sum NOT NULL )
+        AGGREGATE KEY(k1,k2,k3,k4,k5,k6,k10,k11,k12,k13,k14,k15,k7)
+        PARTITION BY RANGE(k10) (
+            FROM ("2022-11-02") TO ("2022-12-03") INTERVAL 2 DAY
+            )
+        DISTRIBUTED BY HASH(k1) BUCKETS 5 properties("replication_num" = "1")
+        """
+    result1  = sql "show tables like 'multi_par8'"
+    logger.info("${result1}")
+    assertEquals(result1.size(), 1)
+    result2  = sql "show partitions from multi_par8"
+    logger.info("${result2}")
+    assertEquals(result2.size(), 16)
+    sql "drop table multi_par8"
+
+}
\ No newline at end of file


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

Reply via email to