github-actions[bot] commented on code in PR #68801:
URL: https://github.com/apache/doris/pull/68801#discussion_r4226491028


##########
fe/fe-connector/fe-connector-iceberg/src/test/java/org/apache/doris/connector/iceberg/IcebergConnectorMetadataMvccTest.java:
##########
@@ -445,6 +445,31 @@ public void 
resolveTimestampDatetimeStringResolvesSnapshot() {
         Assertions.assertEquals(f.schemaIdS2, snap.get().getSchemaId());
     }
 
+    @Test
+    public void resolveTimestampDatetimeStringKeepsFractionalSeconds() {
+        Fixture f = fixture();
+        // Snapshots committed within the same second are told apart only by 
the fraction, which a client
+        // gets from e.g. date_format(committed_at, '%Y-%m-%d %H:%i:%s.%f'). 
S2's exact commit millis, written
+        // with 3 or 6 fractional digits, resolves to S2; one millisecond 
earlier no longer reaches S2 (it is
+        // S1 or nothing, depending on when S1 committed). A parser that 
rejects the fraction throws, and one
+        // that truncates it to the second lands before S2 unless S2 happened 
to commit on a whole second.
+        java.time.ZonedDateTime commit = 
java.time.Instant.ofEpochMilli(f.tsS2).atZone(java.time.ZoneOffset.UTC);

Review Comment:
   [P2] Make the fractional integration case deterministic. The fixture records 
S2's wall-clock commit time, which can end in `.000`. On that run, a regression 
that strips fractional seconds in this `resolveTimeTravel` path still resolves 
both exact-S2 strings to S2, while the one-millisecond-before assertion still 
excludes it. Please use a fixture with a guaranteed nonzero millisecond 
fraction so the new end-to-end check always detects truncation.



##########
regression-test/suites/mtmv_p0/test_base_table_add_partition_mtmv.groovy:
##########
@@ -0,0 +1,70 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("test_base_table_add_partition_mtmv", "mtmv") {
+    sql """drop materialized view if exists 
test_base_table_add_partition_mtmv_mv"""
+    sql """drop table if exists test_base_table_add_partition_mtmv_table"""
+
+    sql """
+        CREATE TABLE test_base_table_add_partition_mtmv_table (
+            k1 int,
+            k2 int
+        )
+        PARTITION BY LIST(`k1`)
+        (
+            PARTITION `p1` VALUES IN ('1'),
+            PARTITION `p2` VALUES IN ('2')
+        )
+        DISTRIBUTED BY HASH(k1) BUCKETS 2
+        PROPERTIES (
+            "replication_num" = "1"
+        );
+        """
+    sql """insert into test_base_table_add_partition_mtmv_table values(1,1);"""
+
+    sql """
+        CREATE MATERIALIZED VIEW test_base_table_add_partition_mtmv_mv
+        BUILD DEFERRED REFRESH AUTO ON MANUAL
+        partition by(k1)
+        DISTRIBUTED BY RANDOM BUCKETS 2
+        PROPERTIES ('replication_num' = '1')
+        AS
+        SELECT * FROM test_base_table_add_partition_mtmv_table;
+        """
+    sql """REFRESH MATERIALIZED VIEW test_base_table_add_partition_mtmv_mv 
AUTO"""
+    waitingMTMVTaskFinishedByMvName("test_base_table_add_partition_mtmv_mv")
+    order_qt_baseline "select * from test_base_table_add_partition_mtmv_mv"
+
+    // A new base partition makes the refresh add the matching MV partition, 
which has no snapshot yet.
+    // Only that partition may be refreshed: reading it as a lost refresh 
baseline would rebuild every
+    // partition of the MV, including the partitions that are already in sync.
+    sql """alter table test_base_table_add_partition_mtmv_table add partition 
p3 values in ('3');"""
+    sql """insert into test_base_table_add_partition_mtmv_table values(3,3);"""
+    sql """REFRESH MATERIALIZED VIEW test_base_table_add_partition_mtmv_mv 
AUTO"""
+    waitingMTMVTaskFinishedByMvName("test_base_table_add_partition_mtmv_mv")
+    order_qt_need_refresh_partitions """select NeedRefreshPartitions from 
tasks('type'='mv')
+            where MvName='test_base_table_add_partition_mtmv_mv' order by 
CreateTime desc limit 1"""

Review Comment:
   [P2] Scope the task result queries to this suite's database. 
`tasks('type'='mv')` returns SHOW-visible tasks from every database, but these 
probes filter only `MvName`; a later task for a same-named MV in another 
database can win `ORDER BY CreateTime DESC` after the wait helper has confirmed 
this suite's task. Add `MvDatabaseName = '${context.dbName}'` to each probe so 
the expected partition and mode results describe this MV.



-- 
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]

Reply via email to