RussellSpitzer commented on code in PR #15150:
URL: https://github.com/apache/iceberg/pull/15150#discussion_r2957404659
##########
spark/v4.1/spark/src/test/java/org/apache/iceberg/spark/TestSparkWriteConf.java:
##########
@@ -606,6 +607,42 @@ public void testDVWriteConf() {
assertThat(writeConf.deleteFileFormat()).isEqualTo(FileFormat.PUFFIN);
}
+ @TestTemplate
+ public void testSortOrderWriteConf() {
+ Table table = validationCatalog.loadTable(tableIdent);
+
+ table.replaceSortOrder().asc("id").commit();
+
+ SparkWriteConf writeConf =
+ new SparkWriteConf(
+ spark,
+ table,
+ new CaseInsensitiveStringMap(
+ ImmutableMap.of(SparkWriteOptions.OUTPUT_SORT_ORDER_ID, "1")));
+
+ assertThat(writeConf.outputSortOrderId(SparkWriteRequirements.EMPTY))
+ .isEqualTo(table.sortOrder().orderId());
+
+ SparkWriteConf writeConfForUnknownSortOrder =
Review Comment:
nit: could be another test since this is assertion on a different code path.
There isn't a lot of setup for this one since you just need to load a table so
I would probably keep it separated.
--
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]