Skip to content

Commit

Permalink
ParquetRecordWriterProvider - Add null check on underlying ParquetWriter
Browse files Browse the repository at this point in the history
Fixes edge case where it's possible that getDataSize() is called before
the first call to write().
  • Loading branch information
ChristopherWirt committed Sep 11, 2023
1 parent 96b5108 commit 0d6b87f
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public RecordWriter getRecordWriter(HdfsSinkConnectorConfig conf, String filenam
return new SizeAwareRecordWriter() {
@Override
public long getDataSize() {
if (writer == null) {
return 0;
}
return writer.getDataSize();
}

Expand Down

0 comments on commit 0d6b87f

Please sign in to comment.