pvary commented on a change in pull request #2819:
URL: https://github.com/apache/hive/pull/2819#discussion_r757717860



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/hooks/HiveProtoLoggingHook.java
##########
@@ -314,6 +314,7 @@ private void writeEvent(HiveHookEventProtoPartialBuilder 
builder) {
         try {
           if (eventPerFile) {
             if (!maybeRolloverWriterForDay()) {
+              IOUtils.closeQuietly(writer);

Review comment:
       Why not just call `maybeRolloverWriterForDay()`. That method makes sure 
that the writer is open and ready?
   Same way as for the normal case.
   Like:
   ```
   maybeRolloverWriterForDay();
   LOG.debug("Event per file enabled. New proto event file: {}", 
writer.getPath());
   writer.writeProto(event);
   IOUtils.closeQuietly(writer);
   writer = null;
   ```
   




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to