HIVE-21250 : NPE in HiveProtoLoggingHook for eventPerFile mode. (Harish JP, reviewd...
authorAnishek Agarwal <anishek@gmail.com>
Wed, 13 Feb 2019 06:19:14 +0000 (11:49 +0530)
committerAnishek Agarwal <anishek@gmail.com>
Wed, 13 Feb 2019 06:19:14 +0000 (11:49 +0530)
ql/src/java/org/apache/hadoop/hive/ql/hooks/HiveProtoLoggingHook.java

index 3d51c07..ec00ab6 100644 (file)
@@ -305,10 +305,10 @@ public class HiveProtoLoggingHook implements ExecuteWithHookContext {
       for (int retryCount = 0; retryCount <= MAX_RETRIES; ++retryCount) {
         try {
           if (eventPerFile) {
-            LOG.debug("Event per file enabled. Closing proto event file: {}", writer.getPath());
             if (!maybeRolloverWriterForDay()) {
               writer = logger.getWriter(logFileName + "_" + ++logFileCount);
             }
+            LOG.debug("Event per file enabled. New proto event file: {}", writer.getPath());
             writer.writeProto(event);
             IOUtils.closeQuietly(writer);
             writer = null;