HIVE-11814: Emit query time in lineage info (Jimmy, reviewed by Ashutosh)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/07ca8120 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/07ca8120 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/07ca8120 Branch: refs/heads/spark Commit: 07ca81202c9b0138d562fa863cbd60073789bf12 Parents: cabd481 Author: Jimmy Xiang <jxi...@cloudera.com> Authored: Mon Sep 14 09:25:04 2015 -0700 Committer: Jimmy Xiang <jxi...@cloudera.com> Committed: Tue Sep 15 09:14:38 2015 -0700 ---------------------------------------------------------------------- ql/src/java/org/apache/hadoop/hive/ql/hooks/LineageLogger.java | 2 ++ 1 file changed, 2 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/07ca8120/ql/src/java/org/apache/hadoop/hive/ql/hooks/LineageLogger.java ---------------------------------------------------------------------- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/hooks/LineageLogger.java b/ql/src/java/org/apache/hadoop/hive/ql/hooks/LineageLogger.java index 3c6ce94..f615d81 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/hooks/LineageLogger.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/hooks/LineageLogger.java @@ -149,8 +149,10 @@ public class LineageLogger implements ExecuteWithHookContext { // so that the test golden output file is fixed. long queryTime = plan.getQueryStartTime().longValue(); if (queryTime == 0) queryTime = System.currentTimeMillis(); + long duration = System.currentTimeMillis() - queryTime; writer.name("user").value(hookContext.getUgi().getUserName()); writer.name("timestamp").value(queryTime/1000); + writer.name("duration").value(duration); writer.name("jobIds"); writer.beginArray(); List<TaskRunner> tasks = hookContext.getCompleteTaskList();