drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aditya Kishore (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-3621) Wrong results when Drill on Hbase query contains rowkey "or" or "IN"
Date Thu, 13 Aug 2015 14:57:45 GMT

    [ https://issues.apache.org/jira/browse/DRILL-3621?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14695327#comment-14695327
] 

Aditya Kishore commented on DRILL-3621:
---------------------------------------

Could you please add another row {{"b4\x00"}} to the dataset 

{noformat}
c3528cd9a6be55284cdd3a1fc9786d27810ddd47
 .../test/java/org/apache/drill/hbase/HBaseRecordReaderTest.java  | 6 +++---
 .../java/org/apache/drill/hbase/TestHBaseFilterPushDown.java     | 4 ++--
 .../java/org/apache/drill/hbase/TestHBaseProjectPushDown.java    | 6 +++---
 .../src/test/java/org/apache/drill/hbase/TestTableGenerator.java | 9 +++++++++
 4 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/contrib/storage-hbase/src/test/java/org/apache/drill/hbase/HBaseRecordReaderTest.java
b/contrib/storage-hbase/src/test/java/org/apache/drill/hbase/HBaseRecordReaderTest.java
index 60db266..79db8b6 100644
--- a/contrib/storage-hbase/src/test/java/org/apache/drill/hbase/HBaseRecordReaderTest.java
+++ b/contrib/storage-hbase/src/test/java/org/apache/drill/hbase/HBaseRecordReaderTest.java
@@ -24,19 +24,19 @@ public class HBaseRecordReaderTest extends BaseHBaseTest {
   @Test
   public void testLocalDistributed() throws Exception {
     String planName = "/hbase/hbase_scan_screen_physical.json";
-    runHBasePhysicalVerifyCount(planName, HBaseTestsSuite.TEST_TABLE_1, 6);
+    runHBasePhysicalVerifyCount(planName, HBaseTestsSuite.TEST_TABLE_1, 7);
   }
 
   @Test
   public void testLocalDistributedColumnSelect() throws Exception {
     String planName = "/hbase/hbase_scan_screen_physical_column_select.json";
-    runHBasePhysicalVerifyCount(planName, HBaseTestsSuite.TEST_TABLE_1, 2);
+    runHBasePhysicalVerifyCount(planName, HBaseTestsSuite.TEST_TABLE_1, 3);
   }
 
   @Test
   public void testLocalDistributedFamilySelect() throws Exception {
     String planName = "/hbase/hbase_scan_screen_physical_family_select.json";
-    runHBasePhysicalVerifyCount(planName, HBaseTestsSuite.TEST_TABLE_1, 3);
+    runHBasePhysicalVerifyCount(planName, HBaseTestsSuite.TEST_TABLE_1, 4);
   }
 
 }
diff --git a/contrib/storage-hbase/src/test/java/org/apache/drill/hbase/TestHBaseFilterPushDown.java
b/contrib/storage-hbase/src/test/java/org/apache/drill/hbase/TestHBaseFilterPushDown.java
index 27ffb4b..00de0ba 100644
--- a/contrib/storage-hbase/src/test/java/org/apache/drill/hbase/TestHBaseFilterPushDown.java
+++ b/contrib/storage-hbase/src/test/java/org/apache/drill/hbase/TestHBaseFilterPushDown.java
@@ -122,7 +122,7 @@ public class TestHBaseFilterPushDown extends BaseHBaseTest {
         + "WHERE\n"
         + "  row_key > 'b4'";
 
-    runHBaseSQLVerifyCount(sql, 2);
+    runHBaseSQLVerifyCount(sql, 3);
 
     final String[] expectedPlan = {".*startRow=b4\\\\x00.*stopRow=,.*"};
     final String[] excludedPlan ={};
@@ -228,7 +228,7 @@ public class TestHBaseFilterPushDown extends BaseHBaseTest {
         + "WHERE\n"
         + "  convert_from(row_key, 'UTF8') > 'b4'";
 
-    runHBaseSQLVerifyCount(sql, 2);
+    runHBaseSQLVerifyCount(sql, 3);
 
     final String[] expectedPlan = {".*startRow=b4\\\\x00, stopRow=,.*"};
     final String[] excludedPlan ={};
diff --git a/contrib/storage-hbase/src/test/java/org/apache/drill/hbase/TestHBaseProjectPushDown.java
b/contrib/storage-hbase/src/test/java/org/apache/drill/hbase/TestHBaseProjectPushDown.java
index 6efe905..b27b2a0 100644
--- a/contrib/storage-hbase/src/test/java/org/apache/drill/hbase/TestHBaseProjectPushDown.java
+++ b/contrib/storage-hbase/src/test/java/org/apache/drill/hbase/TestHBaseProjectPushDown.java
@@ -28,7 +28,7 @@ public class TestHBaseProjectPushDown extends BaseHBaseTest {
         + "row_key\n"
         + "FROM\n"
         + "  hbase.`[TABLE_NAME]` tableName"
-        , 6);
+        , 7);
   }
 
   @Test
@@ -48,7 +48,7 @@ public class TestHBaseProjectPushDown extends BaseHBaseTest {
         + "row_key, t.f.c1*31 as `t.f.c1*31`, t.f.c2 as `t.f.c2`, 5 as `5`, 'abc' as `'abc'`\n"
         + "FROM\n"
         + "  hbase.`[TABLE_NAME]` t"
-        , 6);
+        , 7);
   }
 
   @Test
@@ -58,7 +58,7 @@ public class TestHBaseProjectPushDown extends BaseHBaseTest {
         + "row_key, f, f2\n"
         + "FROM\n"
         + "  hbase.`[TABLE_NAME]` tableName"
-        , 6);
+        , 7);
   }
 
 }
diff --git a/contrib/storage-hbase/src/test/java/org/apache/drill/hbase/TestTableGenerator.java
b/contrib/storage-hbase/src/test/java/org/apache/drill/hbase/TestTableGenerator.java
index 097947c..2010fce 100644
--- a/contrib/storage-hbase/src/test/java/org/apache/drill/hbase/TestTableGenerator.java
+++ b/contrib/storage-hbase/src/test/java/org/apache/drill/hbase/TestTableGenerator.java
@@ -81,6 +81,15 @@ public class TestTableGenerator {
     p.add("f".getBytes(), "c9".getBytes(), "6".getBytes());
     table.put(p);
 
+    p = new Put(new byte[]{'b', '4', 0});
+    p.add("f".getBytes(), "c1".getBytes(), "1".getBytes());
+    p.add("f2".getBytes(), "c2".getBytes(), "2".getBytes());
+    p.add("f".getBytes(), "c3".getBytes(), "3".getBytes());
+    p.add("f2".getBytes(), "c4".getBytes(), "4".getBytes());
+    p.add("f".getBytes(), "c5".getBytes(), "5".getBytes());
+    p.add("f2".getBytes(), "c6".getBytes(), "6".getBytes());
+    table.put(p);
+    
     p = new Put("b4".getBytes());
     p.add("f".getBytes(), "c1".getBytes(), "1".getBytes());
     p.add("f2".getBytes(), "c2".getBytes(), "2".getBytes());
{noformat}


> Wrong results when Drill on Hbase query contains rowkey "or" or "IN"
> --------------------------------------------------------------------
>
>                 Key: DRILL-3621
>                 URL: https://issues.apache.org/jira/browse/DRILL-3621
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>    Affects Versions: 1.1.0
>            Reporter: Hao Zhu
>            Assignee: Jinfeng Ni
>            Priority: Critical
>             Fix For: 1.2.0
>
>         Attachments: 0001-DRILL-3621-Fix-incorrect-result-if-HBase-filter-cont.patch
>
>
> If Drill on Hbase query contains row_key "in" or "or", it produces wrong results.
> For example:
> 1. Create a hbase table
> {code}
> create 'testrowkey','cf'
> put 'testrowkey','DUMMY1','cf:c','value1'
> put 'testrowkey','DUMMY2','cf:c','value2'
> put 'testrowkey','DUMMY3','cf:c','value3'
> put 'testrowkey','DUMMY4','cf:c','value4'
> put 'testrowkey','DUMMY5','cf:c','value5'
> put 'testrowkey','DUMMY6','cf:c','value6'
> put 'testrowkey','DUMMY7','cf:c','value7'
> put 'testrowkey','DUMMY8','cf:c','value8'
> put 'testrowkey','DUMMY9','cf:c','value9'
> put 'testrowkey','DUMMY10','cf:c','value10'
> {code}
> 2. Drill queries:
> {code}
> 0: jdbc:drill:zk=h2.poc.com:5181,h3.poc.com:5> SELECT CONVERT_FROM(ROW_KEY,'UTF8')
RK FROM hbase.testrowkey T WHERE ROW_KEY = 'DUMMY10';
> +----------+
> |    RK    |
> +----------+
> | DUMMY10  |
> +----------+
> 1 row selected (1.186 seconds)
> 0: jdbc:drill:zk=h2.poc.com:5181,h3.poc.com:5> SELECT CONVERT_FROM(ROW_KEY,'UTF8')
RK FROM hbase.testrowkey T WHERE ROW_KEY = 'DUMMY1';
> +---------+
> |   RK    |
> +---------+
> | DUMMY1  |
> +---------+
> 1 row selected (0.691 seconds)
> 0: jdbc:drill:zk=h2.poc.com:5181,h3.poc.com:5> SELECT CONVERT_FROM(ROW_KEY,'UTF8')
RK FROM hbase.testrowkey T WHERE ROW_KEY IN ('DUMMY1' , 'DUMMY10');
> +---------+
> |   RK    |
> +---------+
> | DUMMY1  |
> +---------+
> 1 row selected (0.71 seconds)
> 0: jdbc:drill:zk=h2.poc.com:5181,h3.poc.com:5> SELECT CONVERT_FROM(ROW_KEY,'UTF8')
RK FROM hbase.testrowkey T WHERE ROW_KEY ='DUMMY1' OR ROW_KEY = 'DUMMY10';
> +---------+
> |   RK    |
> +---------+
> | DUMMY1  |
> +---------+
> 1 row selected (0.693 seconds)
> {code}
> From explain plan, filter is pushed down to hbase scan layer.
> {code}
> 0: jdbc:drill:zk=h2.poc.com:5181,h3.poc.com:5> explain plan for SELECT CONVERT_FROM(ROW_KEY,'UTF8')
RK FROM hbase.testrowkey T WHERE ROW_KEY IN ('DUMMY1' , 'DUMMY10');
> +------+------+
> | text | json |
> +------+------+
> | 00-00    Screen
> 00-01      Project(RK=[CONVERT_FROMUTF8($0)])
> 00-02        Scan(groupscan=[HBaseGroupScan [HBaseScanSpec=HBaseScanSpec [tableName=testrowkey,
startRow=DUMMY1, stopRow=DUMMY10, filter=null], columns=[`row_key`]]])
>  |
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message