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


##########
regression-test/data/external_table_p0/iceberg/write/test_iceberg_write_partition_types_null.out:
##########
@@ -0,0 +1,64 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !string_rows --
+1      alpha   bucket-a        alpha   a
+2      alphabet        bucket-b        alphabet        ab
+3              bucket-empty            empty
+4      中文      bucket-unicode  中文      unicode
+5      \N      bucket-null-identity    null-identity   null-string
+
+-- !string_null_filter --
+5
+
+-- !string_cross_spec_filter --
+1
+2
+5
+7
+
+-- !string_cross_spec_bucket_filter --
+1
+6
+
+-- !string_partition_specs --
+0      5
+1      2
+
+-- !numeric_rows --
+1      1       101     11.11   true    positive
+2      -1      -101    -11.11  false   negative
+3      0       0       0.00    \N      zero-null-bool
+4      \N      \N      \N      \N      all-null
+
+-- !numeric_null_filter --
+3
+4
+
+-- !numeric_partitions --
+0      4
+
+-- !numeric_physical_partitions --
+\N     \N      \N      \N      \N      \N      1
+0      4       0       7       0.00    \N      1
+0      4       100     1       11.10   true    1
+0      5       -200    4       -11.20  false   1
+
+-- !temporal_rows --
+1      1969-12-31      1969-12-31      1969-12-31      1969-12-31T23:59:59     
1969-12-31T23:59:59     1969-12-31T23:59:59     before-epoch
+2      1970-01-01      1970-01-01      1970-01-01      1970-01-01T00:00        
1970-01-01T00:00        1970-01-01T00:00        epoch
+3      2024-02-29      2024-02-29      2024-02-29      2024-02-29T12:34:56     
2024-02-29T12:34:56     2024-02-29T12:34:56     leap-day
+4      \N      \N      \N      \N      \N      \N      all-null
+
+-- !temporal_filters --
+1
+3
+4
+
+-- !temporal_partitions --
+0      4
+
+-- !temporal_physical_partitions --
+\N     \N      \N      \N      \N      \N      1
+0      0       0       7       1970-01-01      0       1

Review Comment:
   [P1] Keep this physical oracle aligned with Iceberg's temporal transform 
contract
   
   The `1969-12-31 23:59:59` input is recorded here as year/month/day/hour `0, 
0, 1970-01-01, 0`, but [Iceberg defines those 
transforms](https://iceberg.apache.org/spec/#partition-transforms) as 
epoch-relative, so the values must be `-1, -1, 1969-12-31, -1`. Because this 
`.out` file is the physical oracle, the suite currently passes only by blessing 
the writer's round-toward-zero behavior and would fail after a correct 
implementation. Please fix the temporal partition transformers with focused 
unit coverage and regenerate this row while retaining the bucket values, or 
isolate it as a known-bug case instead of marking the matrix coverage verified.



##########
regression-test/suites/external_table_p0/iceberg/write/test_iceberg_write_required_null_select_negative.groovy:
##########
@@ -0,0 +1,103 @@
+// 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_iceberg_write_required_null_select_negative",
+        "p0,external,iceberg,external_docker,external_docker_iceberg") {
+    String enabled = context.config.otherConfigs.get("enableIcebergTest")
+    if (enabled == null || !enabled.equalsIgnoreCase("true")) {
+        logger.info("disable iceberg test")
+        return
+    }
+
+    // This opt-in switch isolates a write that can publish an unreadable 
Iceberg data file.
+    String knownBugTestEnabled = 
context.config.otherConfigs.get("enableIcebergKnownBugTest")
+    if (knownBugTestEnabled == null || 
!knownBugTestEnabled.equalsIgnoreCase("true")) {
+        logger.info("skip isolated Iceberg known-bug regression")
+        return
+    }
+
+    String restPort = context.config.otherConfigs.get("iceberg_rest_uri_port")
+    String minioPort = context.config.otherConfigs.get("iceberg_minio_port")
+    String externalEnvIp = context.config.otherConfigs.get("externalEnvIp")
+    String catalogName = "test_iceberg_write_required_null_select_negative"
+    String dbName = "iceberg_write_required_null_select_negative_db"
+    String internalDb = 
"iceberg_write_required_null_select_negative_internal_db"
+
+    sql """drop database if exists internal.${internalDb} force"""
+    sql """create database internal.${internalDb}"""
+    sql """
+        create table internal.${internalDb}.nullable_source (
+            id int,
+            required_text string
+        )
+        duplicate key(id)
+        distributed by hash(id) buckets 3
+        properties ("replication_num" = "1")
+    """
+    sql """
+        insert into internal.${internalDb}.nullable_source values
+            (1, 'valid'),
+            (2, null)
+    """
+
+    sql """drop catalog if exists ${catalogName}"""
+    sql """
+        create catalog ${catalogName} properties (
+            "type" = "iceberg",
+            "iceberg.catalog.type" = "rest",
+            "uri" = "http://${externalEnvIp}:${restPort}";,
+            "s3.access_key" = "admin",
+            "s3.secret_key" = "password",
+            "s3.endpoint" = "http://${externalEnvIp}:${minioPort}";,
+            "s3.region" = "us-east-1"
+        )
+    """
+    sql """switch ${catalogName}"""
+    sql """drop database if exists ${dbName} force"""
+    sql """create database ${dbName}"""
+    sql """use ${dbName}"""
+
+    sql """
+        create table required_select (
+            id int not null,
+            required_text string not null
+        )
+        partition by list (bucket(8, id)) ()
+        properties ("format-version" = "2")
+    """
+
+    long snapshotsBefore = (sql """select count(*) from 
required_select\$snapshots""")[0][0] as long
+    long filesBefore = (sql """select count(*) from 
required_select\$files""")[0][0] as long
+    long rowsBefore = (sql """select count(*) from required_select""")[0][0] 
as long
+
+    // W07-S02: The metadata and row baselines distinguish an early rejection
+    // from a late failure that has already published a snapshot or data file.
+    test {
+        sql """
+            insert into required_select
+            select id, required_text
+            from internal.${internalDb}.nullable_source
+        """
+        exception "null"

Review Comment:
   [P1] Match the required-column diagnostic rather than the word `null`
   
   `TestAction` implements `exception` as a raw `msg.contains(...)` check, and 
this statement's own identifiers include `nullable_source` and several other 
`null` substrings. An unrelated analyzer/catalog error such as a missing-source 
error can therefore satisfy this oracle before the required-field writer path 
runs; the new snapshot/file/row baselines still pass because no write began. 
The VALUES sibling has the same `exception "null"` matcher. Please use `check` 
(or a distinctive contiguous diagnostic) to require the intended 
required-field/nullability error and the `required_text` column in both suites.



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