bharos commented on code in PR #12327:
URL: https://github.com/apache/iceberg/pull/12327#discussion_r1962465950
##########
spark/v3.5/spark-extensions/src/test/java/org/apache/iceberg/spark/extensions/TestAddFilesProcedure.java:
##########
@@ -607,6 +607,40 @@ public void
addFilteredPartitionsToPartitionedWithNullValueFilteringOnDept() {
sql("SELECT id, name, dept, subdept FROM %s ORDER BY id", tableName));
}
+ @TestTemplate
+ public void addFileTableInvalidPartitionSpecVersion() {
+ createPartitionedFileTable("parquet");
+ createIcebergTable(
+ "id Integer, name String, dept String, subdept String", "PARTITIONED
BY (id, dept)");
+
+ assertThatThrownBy(
+ () ->
+ sql(
+ "CALL %s.system.add_files('%s', '`parquet`.`%s`',
map('id', 1), true, 1, 1)",
+ catalogName, tableName, fileTableDir.getAbsolutePath()))
+ .isInstanceOf(IllegalArgumentException.class)
+ .hasMessage("Invalid partition spec version: 1");
+ }
+
+ @TestTemplate
+ public void addFileTableWithPartitionSpecVersion() {
+ createPartitionedFileTable("parquet");
+ createIcebergTable(
+ "id Integer, name String, dept String, subdept String", "PARTITIONED
BY (id)");
+ sql("ALTER TABLE %s ADD PARTITION FIELD dept", tableName);
+
+ List<Object[]> result =
+ sql(
+ "CALL %s.system.add_files(table => '%s', source_table =>
'`parquet`.`%s`', partition_spec_version => 0)",
+ catalogName, tableName, fileTableDir.getAbsolutePath());
Review Comment:
N/A with latest change
--
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]