carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jack...@apache.org
Subject [09/50] [abbrv] carbondata git commit: [CARBONDATA-1846] Incorrect output on presto CLI while executing IN operator with multiple load
Date Sun, 07 Jan 2018 03:05:17 GMT
[CARBONDATA-1846] Incorrect output on presto CLI while executing IN operator with multiple
load

Problem: problem is that in operator on timestamp is not working correctly because timestamp
was getting multiplied by 1000 twice when we are creating inexpression

This closes #1649


Project: http://git-wip-us.apache.org/repos/asf/carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/carbondata/commit/b1206012
Tree: http://git-wip-us.apache.org/repos/asf/carbondata/tree/b1206012
Diff: http://git-wip-us.apache.org/repos/asf/carbondata/diff/b1206012

Branch: refs/heads/carbonstore
Commit: b1206012fecd5dfd22a51275de0889518c7ad1cf
Parents: 86524df
Author: anubhav100 <anubhav.tarar@knoldus.in>
Authored: Wed Dec 13 11:02:55 2017 +0530
Committer: chenliang613 <chenliang613@huawei.com>
Committed: Wed Dec 27 22:16:32 2017 +0800

----------------------------------------------------------------------
 .../java/org/apache/carbondata/presto/PrestoFilterUtil.java  | 2 +-
 .../presto/integrationtest/PrestoAllDataTypeTest.scala       | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/b1206012/integration/presto/src/main/java/org/apache/carbondata/presto/PrestoFilterUtil.java
----------------------------------------------------------------------
diff --git a/integration/presto/src/main/java/org/apache/carbondata/presto/PrestoFilterUtil.java
b/integration/presto/src/main/java/org/apache/carbondata/presto/PrestoFilterUtil.java
index a69013f..6f9b0f3 100644
--- a/integration/presto/src/main/java/org/apache/carbondata/presto/PrestoFilterUtil.java
+++ b/integration/presto/src/main/java/org/apache/carbondata/presto/PrestoFilterUtil.java
@@ -175,7 +175,7 @@ public class PrestoFilterUtil {
       } else if (singleValues.size() > 1) {
         ListExpression candidates = null;
         List<Expression> exs = singleValues.stream()
-            .map((a) -> new LiteralExpression(ConvertDataByType(a, type), coltype))
+            .map((a) -> new LiteralExpression(a, coltype))
             .collect(Collectors.toList());
         candidates = new ListExpression(exs);
         filters.add(new InExpression(colExpression, candidates));

http://git-wip-us.apache.org/repos/asf/carbondata/blob/b1206012/integration/presto/src/test/scala/org/apache/carbondata/presto/integrationtest/PrestoAllDataTypeTest.scala
----------------------------------------------------------------------
diff --git a/integration/presto/src/test/scala/org/apache/carbondata/presto/integrationtest/PrestoAllDataTypeTest.scala
b/integration/presto/src/test/scala/org/apache/carbondata/presto/integrationtest/PrestoAllDataTypeTest.scala
index dc0472d..153ca5e 100644
--- a/integration/presto/src/test/scala/org/apache/carbondata/presto/integrationtest/PrestoAllDataTypeTest.scala
+++ b/integration/presto/src/test/scala/org/apache/carbondata/presto/integrationtest/PrestoAllDataTypeTest.scala
@@ -427,4 +427,12 @@ class PrestoAllDataTypeTest extends FunSuiteLike with BeforeAndAfterAll
{
     val expectedResult: List[Map[String, Any]] = List(Map("RESULT" -> "jatin"))
     assert(actualResult.equals(expectedResult))
   }
+
+  test("test timestamp datatype using cast and in operator") {
+    val actualResult: List[Map[String, Any]] = PrestoServer
+      .executeQuery("SELECT ID AS RESULT FROM TESTDB.TESTTABLE WHERE DOB in (cast('2016-04-14
" +
+                    "15:00:09' as timestamp),cast('2015-10-07' as timestamp),cast('2015-10-07
01:00:03' as timestamp))")
+    val expectedResult: List[Map[String, Any]] = List(Map("RESULT" -> "2"))
+    assert(actualResult.toString() equals expectedResult.toString())
+  }
 }
\ No newline at end of file


Mime
View raw message