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

Krystal commented on DRILL-1403:
--------------------------------

git.commit.id.abbrev=5c220e3

I ran the following query and looks like the filter is not being pushed down:

0: jdbc:drill:schema=hbase> explain plan for select cast(student.onecf.name as 
varchar(30)) from student where row_key < '30' and row_key > '10';
+------------+------------+
|    text    |    json    |
+------------+------------+
| 00-00    Screen
00-01      Project(EXPR$0=[CAST($1):VARCHAR(30) CHARACTER SET "ISO-8859-1" 
COLLATE "ISO-8859-1$en_US$primary"])
00-02        SelectionVectorRemover
00-03          Filter(condition=[AND(<($0, '30'), >($0, '10'))])
00-04            Project(row_key=[$0], ITEM=[ITEM($1, 'name')])
00-05              Scan(groupscan=[HBaseGroupScan [HBaseScanSpec=HBaseScanSpec 
[tableName=student, startRow=null, stopRow=null, filter=null], 
columns=[SchemaPath [`row_key`], SchemaPath [`onecf`.`name`]]]])
 | {
  "head" : {
    "version" : 1,
    "generator" : {
      "type" : "ExplainHandler",
      "info" : ""
    },
    "type" : "APACHE_DRILL_PHYSICAL",
    "options" : [ ],
    "queue" : 0,
    "resultMode" : "EXEC"
  },
  "graph" : [ {
    "pop" : "hbase-scan",
    "@id" : 5,
    "hbaseScanSpec" : {
      "tableName" : "student",
      "startRow" : "",
      "stopRow" : "",
      "serializedFilter" : null
    },
    "storage" : {
      "type" : "hbase",
      "config" : {
        "hbase.zookeeper.quorum" : "10.10.100.113,10.10.100.114,10.10.100.115",
        "hbase.zookeeper.property.clientPort" : "5181"
      },

If I use a "*" in the select instead of specifying a column, then the filter 
got pushed down.  For example,

0: jdbc:drill:schema=hbase> explain plan for select * from student where 
row_key < '30' and row_key > '10';
+------------+------------+
|    text    |    json    |
+------------+------------+
| 00-00    Screen
00-01      Project(row_key=[$0], fivecf=[$1], fourcf=[$2], onecf=[$3], 
threecf=[$4], twocf=[$5])
00-02        Scan(groupscan=[HBaseGroupScan [HBaseScanSpec=HBaseScanSpec 
[tableName=student, startRow=10\x00, stopRow=30, filter=FilterList AND (2/2): 
[RowFilter (LESS, 30), RowFilter (GREATER, 10)]], columns=[SchemaPath [`*`]]]])
 | {
  "head" : {
    "version" : 1,
    "generator" : {
      "type" : "ExplainHandler",
      "info" : ""
    },
    "type" : "APACHE_DRILL_PHYSICAL",
    "options" : [ ],
    "queue" : 0,
    "resultMode" : "EXEC"
  },
  "graph" : [ {
    "pop" : "hbase-scan",
    "@id" : 2,
    "hbaseScanSpec" : {
      "tableName" : "student",
      "startRow" : "MTAA",
      "stopRow" : "MzA=",
      "serializedFilter" : 
"DgApb3JnLmFwYWNoZS5oYWRvb3AuaGJhc2UuZmlsdGVyLkZpbHRlckxpc3QAAAAAAg4yAARMRVNTNi8CMzAOMgAHR1JFQVRFUjYvAjEw"
    },


> HBase predicate pushdown filters are not getting applied
> --------------------------------------------------------
>
>                 Key: DRILL-1403
>                 URL: https://issues.apache.org/jira/browse/DRILL-1403
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Functions - Drill
>            Reporter: B Anil Kumar
>            Assignee: Aditya Kishore
>              Labels: patch
>             Fix For: 0.6.0
>
>         Attachments: 0001-DRILL-1403.patch, 
> DRILL-1403-HBase-predicate-pushdown-filters-are-not-.patch
>
>
> It seems, due to latest changes HBase predicate pushdown is not getting 
> applied.
> In below snippet, "le.accept(this, null)" returning null.
> {noformat}
>   public HBaseScanSpec parseTree() {
>     HBaseScanSpec parsedSpec = le.accept(this, null);
>     if (parsedSpec != null) {
>       parsedSpec = mergeScanSpecs("booleanAnd", 
> this.groupScan.getHBaseScanSpec(), parsedSpec);
>       /*
>        * If RowFilter is THE filter attached to the scan specification,
>        * remove it since its effect is also achieved through startRow and 
> stopRow.
>        */
>       if (parsedSpec.filter instanceof RowFilter) {
>         parsedSpec.filter = null;
>       }
>     }
>     return parsedSpec;
>   }
> {noformat}



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

Reply via email to