aokolnychyi commented on code in PR #8621:
URL: https://github.com/apache/iceberg/pull/8621#discussion_r1334890950
##########
spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/source/SparkWrite.java:
##########
@@ -126,7 +126,7 @@ abstract class SparkWrite implements Write,
RequiresDistributionAndOrdering {
this.writeSchema = writeSchema;
this.dsSchema = dsSchema;
this.extraSnapshotMetadata = writeConf.extraSnapshotMetadata();
- this.partitionedFanoutEnabled = writeConf.fanoutWriterEnabled();
+ this.partitionedFanoutEnabled = writeConf.fanoutWriterEnabled() &&
!writeRequirements.hasOrdering();
Review Comment:
This is similar to what we did for merge-on-read writes.
```
boolean fanoutEnabled = context.fanoutWriterEnabled();
boolean inputOrdered = context.inputOrdered();
long targetFileSize = context.targetDataFileSize();
if (table.spec().isPartitioned() && fanoutEnabled && !inputOrdered) {
return new FanoutDataWriter<>(writers, files, io, targetFileSize);
} else {
return new ClusteredDataWriter<>(writers, files, io, targetFileSize);
}
```
--
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]