varun-lakhyani commented on code in PR #15028:
URL: https://github.com/apache/iceberg/pull/15028#discussion_r2699546957
##########
spark/v4.1/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestMergeSchemaEvolution.java:
##########
@@ -185,6 +186,46 @@ public void testMergeWithSchemaEvolutionNestedStruct() {
sql("SELECT id, s FROM %s ORDER BY id", selectTarget()));
}
+ @TestTemplate
+ public void testMergeWithSchemaEvolutionNestedStructSourceHasFewerFields() {
+ assumeThat(branch).as("Schema evolution does not work for branches
currently").isNull();
+
+ createAndInitTable(
+ "id INT, s STRUCT<c1:INT,c2:STRING,c3:INT>",
+ "{ \"id\": 1, \"s\": { \"c1\": 100, \"c2\": \"aa\", \"c3\": 1000 } }\n"
+ + "{ \"id\": 2, \"s\": { \"c1\": 200, \"c2\": \"bb\", \"c3\": 2000
} }");
+
+ createOrReplaceView(
+ "source",
+ "id INT, s STRUCT<c1:INT,c2:STRING>",
+ "{ \"id\": 1, \"s\": { \"c1\": 10, \"c2\": \"a\" } }\n"
+ + "{ \"id\": 3, \"s\": { \"c1\": 30, \"c2\": \"c\" } }");
+
+ // Rows should have null for missing c3 nested field from source
+ ImmutableList<Object[]> expectedRows =
Review Comment:
https://github.com/apache/iceberg/blob/4f5768738e79487058fd65fba3faa19612a53391/spark/v4.1/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestMerge.java#L2914-L2946
I felt the same way but found lot of places where this was followed as one
referenced here.
Should I push the change with expected rows inside withSQLConf after MERGE
command?
--
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]