rdblue commented on a change in pull request #227: ORC column map fix
URL: https://github.com/apache/incubator-iceberg/pull/227#discussion_r355232788
##########
File path: orc/src/main/java/org/apache/iceberg/orc/OrcFileAppender.java
##########
@@ -47,30 +46,29 @@
*/
class OrcFileAppender<D> implements FileAppender<D> {
private final int batchSize;
- private final TypeDescription orcSchema;
- private final ColumnIdMap columnIds = new ColumnIdMap();
- private final Path path;
+ private final Schema schema;
+ private final OutputFile file;
private final Writer writer;
private final VectorizedRowBatch batch;
private final OrcValueWriter<D> valueWriter;
private boolean isClosed = false;
private final Configuration conf;
- private static final String COLUMN_NUMBERS_ATTRIBUTE = "iceberg.column.ids";
-
- OrcFileAppender(TypeDescription schema, OutputFile file,
+ OrcFileAppender(Schema schema, OutputFile file,
Function<TypeDescription, OrcValueWriter<?>>
createWriterFunc,
Configuration conf, Map<String, byte[]> metadata,
int batchSize) {
this.conf = conf;
- orcSchema = schema;
- path = new Path(file.location());
+ this.file = file;
this.batchSize = batchSize;
+ this.schema = schema;
+
+ TypeDescription orcSchema = ORCSchemaUtil.convert(this.schema);
batch = orcSchema.createRowBatch(this.batchSize);
OrcFile.WriterOptions options = OrcFile.writerOptions(conf);
options.setSchema(orcSchema);
- writer = newOrcWriter(file, columnIds, options, metadata);
+ writer = newOrcWriter(file, options, metadata);
Review comment:
Nit: setting instance fields should be done using `this.` to be clear.
----------------------------------------------------------------
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]