aokolnychyi commented on code in PR #7703:
URL: https://github.com/apache/iceberg/pull/7703#discussion_r1205990117
##########
spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/source/SparkPositionDeltaWrite.java:
##########
@@ -389,10 +391,44 @@ protected Map<Integer, StructProjection>
buildPartitionProjections(
return partitionProjections;
}
+
+ // use the fanout writer only if enabled and the input is unordered
+ protected PartitioningWriter<InternalRow, DataWriteResult> newDataWriter(
+ Table table, SparkFileWriterFactory writers, OutputFileFactory files,
Context context) {
+
+ FileIO io = table.io();
+ boolean fanoutEnabled = context.fanoutWriterEnabled();
+ boolean inputOrdered = context.inputOrdered();
+ long targetFileSize = context.targetDataFileSize();
+
+ if (fanoutEnabled && !inputOrdered) {
+ return new FanoutDataWriter<>(writers, files, io, targetFileSize);
Review Comment:
No need to use the fanout writer if input is ordered. The local sort always
include partition columns.
--
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]