aokolnychyi commented on code in PR #7637:
URL: https://github.com/apache/iceberg/pull/7637#discussion_r1201212347
##########
spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/source/SparkPositionDeltaWrite.java:
##########
@@ -567,43 +562,16 @@ public void close() throws IOException {
}
}
- private PartitioningWriter<InternalRow, DataWriteResult> newInsertWriter(
- Table table,
- SparkFileWriterFactory writerFactory,
- OutputFileFactory fileFactory,
- Context context) {
- long targetFileSize = context.targetDataFileSize();
-
- if (table.spec().isPartitioned() && context.fanoutWriterEnabled()) {
- return new FanoutDataWriter<>(writerFactory, fileFactory, table.io(),
targetFileSize);
- } else {
- return new ClusteredDataWriter<>(writerFactory, fileFactory,
table.io(), targetFileSize);
- }
- }
-
- private PartitioningWriter<InternalRow, DataWriteResult> newUpdateWriter(
- Table table,
- SparkFileWriterFactory writerFactory,
- OutputFileFactory fileFactory,
- Context context) {
- long targetFileSize = context.targetDataFileSize();
-
- if (table.spec().isPartitioned()) {
- // use a fanout writer for partitioned tables to write updates as they
may be out of order
- return new FanoutDataWriter<>(writerFactory, fileFactory, table.io(),
targetFileSize);
- } else {
- return new ClusteredDataWriter<>(writerFactory, fileFactory,
table.io(), targetFileSize);
- }
+ private PartitioningWriter<InternalRow, DataWriteResult> newDataWriter(
Review Comment:
We always add a local sort as it is required to write out position deletes.
That's why we always add a sort by partition columns if the table is
partitioned. Therefore, we should be able to always use a clustered writer.
--
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]