huaxingao commented on code in PR #13907: URL: https://github.com/apache/iceberg/pull/13907#discussion_r2298643947
########## spark/v4.0/spark/src/test/java/org/apache/iceberg/spark/sql/TestStoragePartitionedJoins.java: ########## @@ -133,7 +133,44 @@ public void removeTables() { sql("DROP TABLE IF EXISTS %s", tableName(OTHER_TABLE_NAME)); } - // TODO: add tests for truncate transforms once SPARK-40295 is released + // TODO: Truncate is not supported by SPJ yet (even after SPARK-40295). + // Add tests for full support once SPARK-50593 is resolved. + @TestTemplate + public void testJoinsWithIncompatibleTruncateSpecs() { + + sql( + "CREATE TABLE %s (id BIGINT, int_col INT, dep STRING) " + + "USING iceberg " + + "PARTITIONED BY (truncate(4, dep)) " + + "TBLPROPERTIES (%s)", + tableName, tablePropsAsString(TABLE_PROPERTIES)); + + sql("INSERT INTO %s VALUES (1L, 100, 'software')", tableName); + sql("INSERT INTO %s VALUES (2L, 200, 'software')", tableName); + sql("INSERT INTO %s VALUES (3L, 300, 'software')", tableName); + + sql( + "CREATE TABLE %s (id BIGINT, int_col INT, dep STRING) " + + "USING iceberg " + + "PARTITIONED BY (truncate(4, dep)) " + + "TBLPROPERTIES (%s)", + tableName(OTHER_TABLE_NAME), tablePropsAsString(TABLE_PROPERTIES)); + + sql("INSERT INTO %s VALUES (1L, 100, 'software')", tableName(OTHER_TABLE_NAME)); + sql("INSERT INTO %s VALUES (2L, 200, 'software')", tableName(OTHER_TABLE_NAME)); + sql("INSERT INTO %s VALUES (3L, 300, 'software')", tableName(OTHER_TABLE_NAME)); + + assertPartitioningAwarePlan( + 3, /* expected num of shuffles with SPJ */ Review Comment: Shall we add a comment ``` // TODO(SPARK-50593): Once truncate transforms are leveraged by SPJ, expected shuffles with SPJ should drop to 1. Update expectedNumShufflesWithSPJ accordingly. ``` -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org