hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1624691 - /hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/ExprNodeConverter.java
Date Sat, 13 Sep 2014 00:58:09 GMT
Author: hashutosh
Date: Sat Sep 13 00:58:09 2014
New Revision: 1624691

URL: http://svn.apache.org/r1624691
Log:
HIVE-8087 : [CBO] Bug in constant conversion for Date type (Ashutosh Chauhan via John Pullokkaran)

Modified:
    hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/ExprNodeConverter.java

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/ExprNodeConverter.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/ExprNodeConverter.java?rev=1624691&r1=1624690&r2=1624691&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/ExprNodeConverter.java
(original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/translator/ExprNodeConverter.java
Sat Sep 13 00:58:09 2014
@@ -17,7 +17,9 @@
  */
 package org.apache.hadoop.hive.ql.optimizer.optiq.translator;
 
+import java.sql.Date;
 import java.util.ArrayList;
+import java.util.Calendar;
 import java.util.LinkedList;
 import java.util.List;
 
@@ -70,7 +72,7 @@ public class ExprNodeConverter extends R
   @Override
   public ExprNodeDesc visitCall(RexCall call) {
     ExprNodeGenericFuncDesc gfDesc = null;
-    
+
     if (!deep) {
       return null;
     }
@@ -130,7 +132,8 @@ public class ExprNodeConverter extends R
       return new ExprNodeConstantDesc(TypeInfoFactory.doubleTypeInfo,
           Double.valueOf(((Number) literal.getValue3()).doubleValue()));
     case DATE:
-      return new ExprNodeConstantDesc(TypeInfoFactory.dateTypeInfo, literal.getValue3());
+      return new ExprNodeConstantDesc(TypeInfoFactory.dateTypeInfo,
+        new Date(((Calendar)literal.getValue()).getTimeInMillis()));
     case TIMESTAMP:
       return new ExprNodeConstantDesc(TypeInfoFactory.timestampTypeInfo, literal.getValue3());
     case BINARY:



Mime
View raw message