Fix native memory leak in RCFile writer
When closing RcFileWriters, exception may appear. We need to make sure
all compressors are returned even exception occurs.
@@ -188,13 +188,17 @@ public class RcFileWriter
public void close()
throws IOException
{
+ try {
writeRowGroup();
output.close();
+ }
+ finally {
keySectionOutput.destroy();
for (ColumnEncoder columnEncoder : columnEncoders) {
columnEncoder.destroy();
}
}
+ }
private void recordValidation(Consumer<RcFileWriteValidationBuilder> task)
{
