singhpk234 commented on code in PR #13534:
URL: https://github.com/apache/iceberg/pull/13534#discussion_r2202926433
##########
spark/v3.4/spark/src/test/java/org/apache/iceberg/spark/sql/TestStoragePartitionedJoins.java:
##########
@@ -370,6 +370,54 @@ public void testJoinsWithCompatibleSpecEvolution() {
tableName(OTHER_TABLE_NAME));
}
+ @TestTemplate
+ public void testJoinsWhichReorderPartitionsViaSpecEvolution() {
+ sql(
+ "CREATE TABLE %s (id BIGINT, int_col INT, dep STRING)"
+ + "USING iceberg "
+ + "PARTITIONED BY (bucket(8, id), int_col, dep) "
+ + "TBLPROPERTIES (%s)",
+ tableName, tablePropsAsString(TABLE_PROPERTIES));
+
+ Table table = validationCatalog.loadTable(tableIdent);
+
+ // evolve the spec in the first table by reordering the final two
partition columns by first
+ // removing them and re-adding them
+ table.updateSpec().removeField("int_col").commit();
+ table.updateSpec().removeField("dep").commit();
+
+ table.updateSpec().addField("dep").commit();
+ table.updateSpec().addField("int_col").commit();
Review Comment:
[doubt] what would happen if the data was added in between these operations
i.e drop partition, insert data (without existing partitioning spec), add the
partition spec back
--
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]