This is an automated email from the ASF dual-hosted git repository.

ayushsaxena pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new be379bd4f8b HIVE-24286: Render date and time with progress of Hive on 
Tez (#4424). (okumin, reviewed by Ayush Saxena, Attila Turoczy)
be379bd4f8b is described below

commit be379bd4f8b40239afedc9b4490bade4b15cbc52
Author: okumin <[email protected]>
AuthorDate: Thu Jun 22 13:00:49 2023 +0900

    HIVE-24286: Render date and time with progress of Hive on Tez (#4424). 
(okumin, reviewed by Ayush Saxena, Attila Turoczy)
---
 .../hadoop/hive/ql/exec/tez/monitoring/RenderStrategy.java  | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git 
a/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/monitoring/RenderStrategy.java 
b/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/monitoring/RenderStrategy.java
index 6f7a4dda64f..c58e0c73c8c 100644
--- 
a/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/monitoring/RenderStrategy.java
+++ 
b/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/monitoring/RenderStrategy.java
@@ -17,6 +17,9 @@
  */
 package org.apache.hadoop.hive.ql.exec.tez.monitoring;
 
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.time.format.DateTimeFormatter;
 import org.apache.hadoop.hive.common.log.InPlaceUpdate;
 import org.apache.hadoop.hive.common.log.ProgressMonitor;
 import org.apache.hadoop.hive.conf.HiveConf;
@@ -145,8 +148,13 @@ class RenderStrategy {
    */
   static class LogToFileFunction extends BaseUpdateFunction {
     private static final Logger LOGGER = 
LoggerFactory.getLogger(LogToFileFunction.class);
-    private boolean hiveServer2InPlaceProgressEnabled =
+    private static final DateTimeFormatter REPORT_DATE_TIME_FORMATTER =
+        DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss,SSS");
+
+    private final boolean hiveServer2InPlaceProgressEnabled =
         
SessionState.get().getConf().getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_INPLACE_PROGRESS);
+    private final ZoneId localTimeZone = 
SessionState.get().getConf().getLocalTimeZone();
+
     LogToFileFunction(TezJobMonitor monitor) {
       super(monitor);
     }
@@ -161,7 +169,8 @@ class RenderStrategy {
       if (hiveServer2InPlaceProgressEnabled) {
         LOGGER.info(report);
       } else {
-        monitor.console.printInfo(report);
+        final String time = 
REPORT_DATE_TIME_FORMATTER.format(LocalDateTime.now(localTimeZone));
+        monitor.console.printInfo(time + "\t" + report);
       }
     }
   }

Reply via email to