Make sure RcFileWriter closer registers all streams
We have seen in production where writeRowGroup() throws an exception
that causes output streams fail to close.
@@ -192,12 +192,12 @@ public class RcFileWriter
throws IOException
{
try (Closer closer = Closer.create()) {
- writeRowGroup();
closer.register(output);
closer.register(keySectionOutput::destroy);
for (ColumnEncoder columnEncoder : columnEncoders) {
closer.register(columnEncoder::destroy);
}
+ writeRowGroup();
}
}
