rdblue commented on a change in pull request #1213:
URL: https://github.com/apache/iceberg/pull/1213#discussion_r463346866
##########
File path: spark2/src/main/java/org/apache/iceberg/spark/source/Writer.java
##########
@@ -250,32 +259,39 @@ 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 {
+ this.close();
+
return new TaskCommit(complete());
}
}
- private static class Partitioned24Writer extends PartitionedWriter
implements DataWriter<InternalRow> {
+ private static class Partitioned24Writer extends SparkPartitionedWriter
implements DataWriter<InternalRow> {
+
Partitioned24Writer(PartitionSpec spec, FileFormat format,
SparkAppenderFactory appenderFactory,
- OutputFileFactory fileFactory, FileIO fileIo,
long targetFileSize, Schema writeSchema) {
- super(spec, format, appenderFactory, fileFactory, fileIo,
targetFileSize, writeSchema);
+ OutputFileFactory fileFactory, FileIO fileIo, long
targetFileSize,
+ Schema schema, StructType sparkSchema) {
+ super(spec, format, appenderFactory, fileFactory, fileIo,
targetFileSize, schema, sparkSchema);
}
@Override
public WriterCommitMessage commit() throws IOException {
+ this.close();
Review comment:
No need to use the prefix `this` for close calls, is there?
----------------------------------------------------------------
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]