rdblue commented on a change in pull request #139: ORC support integration for
Spark 2.4.0
URL: https://github.com/apache/incubator-iceberg/pull/139#discussion_r280132683
##########
File path: orc/src/main/java/org/apache/iceberg/orc/OrcFileAppender.java
##########
@@ -108,12 +111,44 @@ public long length() {
@Override
public void close() throws IOException {
if (!isClosed) {
- this.isClosed = true;
- writer.close();
+ try {
+ if (batch.size > 0) {
+ writer.addRowBatch(batch);
+ batch.reset();
+ }
+ }
+ finally {
+ writer.close();
+ this.isClosed = true;
+ }
}
}
public TypeDescription getSchema() {
return orcSchema;
}
+
+ private static Writer newOrcWriter(OutputFile file,
+ ColumnIdMap columnIds,
+ OrcFile.WriterOptions options,
Map<String, byte[]> metadata) {
+ final Path locPath = new Path(file.location());
+ final Writer writer;
+
+ try {
+ writer = OrcFile.createWriter(locPath, options);
Review comment:
Is it possible to pass an output stream?
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]