drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject drill git commit: DRILL-1867: Fix case-insensitive matching for subquery. Bump calcite version to r15. Code fix is in calcite
Date Wed, 31 Dec 2014 18:07:26 GMT
Repository: drill
Updated Branches:
  refs/heads/master 309e1bede -> 7498c2de5


DRILL-1867: Fix case-insensitive matching for subquery. Bump calcite version to r15. Code
fix is in calcite


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

Branch: refs/heads/master
Commit: 7498c2de53a9b967acf7d1edfb9f5df7e1c4bdc9
Parents: 309e1be
Author: Jinfeng Ni <jni@maprtech.com>
Authored: Mon Dec 29 15:28:45 2014 -0800
Committer: Jinfeng Ni <jni@maprtech.com>
Committed: Tue Dec 30 16:58:53 2014 -0800

----------------------------------------------------------------------
 .../org/apache/drill/TestExampleQueries.java    | 41 ++++++++++++++++++++
 pom.xml                                         |  2 +-
 2 files changed, 42 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/7498c2de/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java b/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java
index 430e624..41475fb 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/TestExampleQueries.java
@@ -431,4 +431,45 @@ public class TestExampleQueries extends BaseTestQuery{
     test("alter session set `planner.slice_target` = 1; " + query);
   }
 
+  @Test // DRILL-1867
+  public void testCaseInsensitiveSubQuery() throws Exception {
+    int actualRecordCount = 0, expectedRecordCount = 0;
+
+    // source is JSON
+    actualRecordCount = testSql("select EMPID from ( select employee_id as empid from cp.`employee.json`
limit 2)");
+    expectedRecordCount = 2;
+    assertEquals(String.format("Received unexepcted number of rows in output: expected=%d,
received=%s",
+        expectedRecordCount, actualRecordCount), expectedRecordCount, actualRecordCount);
+
+    actualRecordCount = testSql("select EMPLOYEE_ID from ( select employee_id from cp.`employee.json`
where Employee_id is not null limit 2)");
+    expectedRecordCount = 2;
+    assertEquals(String.format("Received unexepcted number of rows in output: expected=%d,
received=%s",
+        expectedRecordCount, actualRecordCount), expectedRecordCount, actualRecordCount);
+
+    actualRecordCount = testSql("select x.EMPLOYEE_ID from ( select employee_id from cp.`employee.json`
limit 2) X");
+    expectedRecordCount = 2;
+    assertEquals(String.format("Received unexepcted number of rows in output: expected=%d,
received=%s",
+        expectedRecordCount, actualRecordCount), expectedRecordCount, actualRecordCount);
+
+    // source is PARQUET
+    actualRecordCount = testSql("select NID from ( select n_nationkey as nid from cp.`tpch/nation.parquet`)
where NID = 3");
+    expectedRecordCount = 1;
+    assertEquals(String.format("Received unexepcted number of rows in output: expected=%d,
received=%s",
+        expectedRecordCount, actualRecordCount), expectedRecordCount, actualRecordCount);
+
+    actualRecordCount = testSql("select x.N_nationkey from ( select n_nationkey from cp.`tpch/nation.parquet`)
X where N_NATIONKEY = 3");
+    expectedRecordCount = 1;
+    assertEquals(String.format("Received unexepcted number of rows in output: expected=%d,
received=%s",
+        expectedRecordCount, actualRecordCount), expectedRecordCount, actualRecordCount);
+
+      // source is CSV
+    String root = FileUtils.getResourceAsFile("/store/text/data/regions.csv").toURI().toString();
+    String query = String.format("select rid, x.name from (select columns[0] as RID, columns[1]
as NAME from dfs_test.`%s`) X where X.rid = 2", root);
+    actualRecordCount = testSql(query);
+    expectedRecordCount = 1;
+    assertEquals(String.format("Received unexepcted number of rows in output: expected=%d,
received=%s",
+        expectedRecordCount, actualRecordCount), expectedRecordCount, actualRecordCount);
+
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/drill/blob/7498c2de/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 4e9fb62..f8cb47b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -920,7 +920,7 @@
           <dependency>
             <groupId>net.hydromatic</groupId>
             <artifactId>optiq-core</artifactId>
-            <version>0.9-drill-r14</version>
+            <version>0.9-drill-r15</version>
             <exclusions>
               <exclusion>
                 <groupId>org.jgrapht</groupId>


Mime
View raw message