anuragmantri commented on code in PR #15150:
URL: https://github.com/apache/iceberg/pull/15150#discussion_r2984952074
##########
spark/v4.1/spark/src/main/java/org/apache/iceberg/spark/SparkWriteConf.java:
##########
@@ -171,6 +172,26 @@ public int outputSpecId() {
return outputSpecId;
}
+ public int outputSortOrderId(SparkWriteRequirements writeRequirements) {
+ String explicitId =
Review Comment:
Nit: Can we do this in one statement just like outputSpecId() above?
```
Integer explicitId = confParser.intConf()
.option(SparkWriteOptions.OUTPUT_SORT_ORDER_ID)
.parseOptional();
if (explicitId != null) {
// Precondition
```
##########
core/src/main/java/org/apache/iceberg/SerializableTable.java:
##########
@@ -80,6 +82,9 @@ protected SerializableTable(Table table) {
Map<Integer, PartitionSpec> specs = table.specs();
specs.forEach((specId, spec) -> specAsJsonMap.put(specId,
PartitionSpecParser.toJson(spec)));
this.sortOrderAsJson = SortOrderParser.toJson(table.sortOrder());
+ this.sortOrderAsJsonMap = Maps.newHashMap();
Review Comment:
Nit: Maybe use immutable map to prevent modification?
```
ImmutableMap.Builder<Integer, String> builder = ImmutableMap.builder();
table.sortOrders().forEach((id, order) -> builder.put(id,
SortOrderParser.toJson(order)));
this.sortOrderAsJsonMap = builder.build();
```
--
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]