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

ASF GitHub Bot commented on DRILL-5429:
---------------------------------------

Github user gparai commented on a diff in the pull request:

    https://github.com/apache/drill/pull/817#discussion_r112072391
  
    --- Diff: 
contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/mapr/db/MapRDBPushFilterIntoScan.java
 ---
    @@ -137,11 +137,13 @@ protected void 
doPushFilterIntoJsonGroupScan(RelOptRuleCall call,
           return; //no filter pushdown ==> No transformation.
         }
     
    +    // Pass tableStats from old groupScan so we do not go and fetch stats 
(an expensive operation) again from MapR DB client.
         final JsonTableGroupScan newGroupsScan = new 
JsonTableGroupScan(groupScan.getUserName(),
                                                                         
groupScan.getStoragePlugin(),
                                                                         
groupScan.getFormatPlugin(),
                                                                         
newScanSpec,
    -                                                                    
groupScan.getColumns());
    +                                                                    
groupScan.getColumns(),
    +                                                                    
groupScan.getTableStats());
    --- End diff --
    
    We should try to use `clone()` here. All we are doing is copying stuff from 
one groupscan to another. `JsonTableGroupScan` already has a clone which clones 
everything except columns.
    
    `@Override 
    public GroupScan clone(List<SchemaPath> columns) 
    { JsonTableGroupScan newScan = new JsonTableGroupScan(this); 
    newScan.columns = columns; return newScan; }`
    We can create another which would clone everything except scanSpec. This 
can be used to pass in the `newScanSpec` generated here. Doing this would also 
clone the `regionsToScan` saving the call to `init()`.


> Cache tableStats per query for MapR DB JSON Tables
> --------------------------------------------------
>
>                 Key: DRILL-5429
>                 URL: https://issues.apache.org/jira/browse/DRILL-5429
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization, Storage - MapRDB
>    Affects Versions: 1.10.0
>            Reporter: Padma Penumarthy
>            Assignee: Padma Penumarthy
>             Fix For: 1.11.0
>
>
> For MapR DB JSON Tables, cache (per query) and reuse tableStats. Getting 
> tableStats is an expensive operation. Saving it and reusing it helps reduce 
> query latency. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to