Skip to content

Commit

Permalink
feat: minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
vibhatha committed Feb 1, 2024
1 parent d09533c commit 184d827
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ protected ArrowWriter(VectorSchemaRoot root, DictionaryProvider provider, Writab
this.compressionFactory = compressionFactory;
this.codecType = codecType;
this.compressionLevel = compressionLevel;
this.codec = getCodec();
this.codec = this.compressionLevel.isPresent() ?
this.compressionFactory.createCodec(this.codecType, this.compressionLevel.get()) :
this.compressionFactory.createCodec(this.codecType);
this.unloader = new VectorUnloader(root, /*includeNullCount*/ true, codec,
/*alignBuffers*/ true);

Expand Down Expand Up @@ -181,12 +183,6 @@ public long bytesWritten() {
return out.getCurrentPosition();
}

private CompressionCodec getCodec() {
return this.compressionLevel.isPresent() ?
this.compressionFactory.createCodec(this.codecType, this.compressionLevel.get()) :
this.compressionFactory.createCodec(this.codecType);
}

private void ensureStarted() throws IOException {
if (!started) {
started = true;
Expand Down

0 comments on commit 184d827

Please sign in to comment.