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


##########
regression-test/suites/external_table_p0/iceberg/test_iceberg_struct_schema_evolution.groovy:
##########
@@ -95,6 +95,28 @@ suite("test_iceberg_struct_schema_evolution", "p0,external") 
{
     // Test 8: DISTINCT query on struct fields
     qt_struct_distinct """SELECT DISTINCT element_at(a_struct, 'renamed'), 
element_at(a_struct, 'added'), element_at(a_struct, 'keep') FROM ${table_name} 
ORDER BY 1, 2, 3"""
 
+    // Reproduce Spark Iceberg struct child type evolution: old files keep 
col.a as INT while
+    // current Iceberg schema exposes it as BIGINT. Reading col.a must cast 
the materialized struct
+    // child without assuming the declared nullable file type matches the 
actual column nullability.
+    def type_evolution_table_name = "test_struct_child_type_evolution"
+    spark_iceberg_multi """
+        DROP TABLE IF EXISTS demo.test_db.${type_evolution_table_name};
+        CREATE TABLE demo.test_db.${type_evolution_table_name} (
+            id INT,
+            col STRUCT<a: INT, b: INT, c: INT>
+        ) USING iceberg
+        TBLPROPERTIES ('write.format.default' = 'parquet');
+        INSERT INTO demo.test_db.${type_evolution_table_name}
+            SELECT 1, named_struct('a', 10, 'b', 20, 'c', 30);
+        ALTER TABLE demo.test_db.${type_evolution_table_name} ALTER COLUMN 
col.a TYPE BIGINT;
+    """
+    sql """REFRESH CATALOG ${catalog_name}"""
+    sql """

Review Comment:
   This should be a `qt_`/`order_qt_` assertion instead of plain `sql`. As 
written, the new case only checks that the query completes; `Suite.sql` just 
returns the result rows, and there is no new block in 
`test_iceberg_struct_schema_evolution.out`. That means a regression that 
returns the wrong `col.a`, `col.b`, or `col.c` values after nested pruning 
would still pass. Please make this query an expected-output check, for example 
with the generated single row `10\t20\t30`, so the test covers the cast result 
rather than only the no-crash path.



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