You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by jc...@apache.org on 2019/10/14 17:50:46 UTC
[hive] branch master updated: HIVE-22331: unix_timestamp without
argument returns timestamp in millisecond instead of second (Naresh P R,
reviewed Jesus Camacho Rodriguez)
This is an automated email from the ASF dual-hosted git repository.
jcamacho 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 9044fee HIVE-22331: unix_timestamp without argument returns timestamp in millisecond instead of second (Naresh P R, reviewed Jesus Camacho Rodriguez)
9044fee is described below
commit 9044fee0b452faa2b4e1ae739463f296131d0811
Author: Naresh P R <pr...@gmail.com>
AuthorDate: Mon Oct 14 10:49:50 2019 -0700
HIVE-22331: unix_timestamp without argument returns timestamp in millisecond instead of second (Naresh P R, reviewed Jesus Camacho Rodriguez)
---
.../org/apache/hadoop/hive/ql/udf/generic/GenericUDFUnixTimeStamp.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFUnixTimeStamp.java b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFUnixTimeStamp.java
index 4bab23a..cfcac5c 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFUnixTimeStamp.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFUnixTimeStamp.java
@@ -43,7 +43,7 @@ public class GenericUDFUnixTimeStamp extends GenericUDFToUnixTimeStamp {
} else {
if (currentInstant == null) {
currentInstant = new LongWritable(0);
- currentInstant.set(SessionState.get().getQueryCurrentTimestamp().toEpochMilli());
+ currentInstant.set(SessionState.get().getQueryCurrentTimestamp().getEpochSecond());
String msg = "unix_timestamp(void) is deprecated. Use current_timestamp instead.";
SessionState.getConsole().printInfo(msg, false);
}