rdblue commented on a change in pull request #1213:
URL: https://github.com/apache/iceberg/pull/1213#discussion_r460583813
##########
File path: spark2/src/main/java/org/apache/iceberg/spark/source/Writer.java
##########
@@ -250,33 +253,42 @@ public String toString() {
if (spec.fields().isEmpty()) {
return new Unpartitioned24Writer(spec, format, appenderFactory,
fileFactory, io.value(), targetFileSize);
} else {
- return new Partitioned24Writer(
- spec, format, appenderFactory, fileFactory, io.value(),
targetFileSize, writeSchema);
+ return new Partitioned24Writer(spec, format, appenderFactory,
fileFactory, io.value(),
+ targetFileSize, writeSchema, dsSchema);
}
}
}
- private static class Unpartitioned24Writer extends UnpartitionedWriter
implements DataWriter<InternalRow> {
+ private static class Unpartitioned24Writer extends
UnpartitionedWriter<InternalRow>
+ implements DataWriter<InternalRow> {
Unpartitioned24Writer(PartitionSpec spec, FileFormat format,
SparkAppenderFactory appenderFactory,
OutputFileFactory fileFactory, FileIO fileIo, long
targetFileSize) {
super(spec, format, appenderFactory, fileFactory, fileIo,
targetFileSize);
}
@Override
public WriterCommitMessage commit() throws IOException {
- return new TaskCommit(complete());
+ this.close();
+
+ List<DataFile> dataFiles = complete();
+ return new TaskCommit(new TaskResult(dataFiles));
Review comment:
If `complete` doesn't produce `TaskResult`, then I'm not sure that we
need it at all anymore. Could we just construct `TaskCommit` directly?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]