@Override public void onMatch(RelOptRuleCall call) { final ScanPrel scan = (ScanPrel) call.rel(1); final FilterPrel filter = (FilterPrel) call.rel(0); final RexNode condition = filter.getCondition(); HBaseGroupScan groupScan = (HBaseGroupScan)scan.getGroupScan(); if (groupScan.isFilterPushedDown()) { /* * The rule can get triggered again due to the transformed "scan => filter" sequence * created by the earlier execution of this rule when we could not do a complete * conversion of Optiq Filter's condition to HBase Filter. In such cases, we rely upon * this flag to not do a re-processing of the rule on the already transformed call. */ return; } doPushFilterToScan(call, filter, null, scan, groupScan, condition); }
@Override public void onMatch(RelOptRuleCall call) { final FilterPrel filter = call.rel(0); final ScanPrel scan = call.rel(1); final RexNode condition = filter.getCondition(); if (scan.getGroupScan() instanceof BinaryTableGroupScan) { BinaryTableGroupScan groupScan = (BinaryTableGroupScan)scan.getGroupScan(); doPushFilterIntoBinaryGroupScan(call, filter, null, scan, groupScan, condition); } else { assert(scan.getGroupScan() instanceof JsonTableGroupScan); JsonTableGroupScan groupScan = (JsonTableGroupScan)scan.getGroupScan(); doPushFilterIntoJsonGroupScan(call, filter, null, scan, groupScan, condition); } }
@Override public void onMatch(RelOptRuleCall call) { final ScanPrel scan = (ScanPrel) call.rel(2); final ProjectPrel project = (ProjectPrel) call.rel(1); final FilterPrel filter = (FilterPrel) call.rel(0); HBaseGroupScan groupScan = (HBaseGroupScan)scan.getGroupScan(); if (groupScan.isFilterPushedDown()) { /* * The rule can get triggered again due to the transformed "scan => filter" sequence * created by the earlier execution of this rule when we could not do a complete * conversion of Optiq Filter's condition to HBase Filter. In such cases, we rely upon * this flag to not do a re-processing of the rule on the already transformed call. */ return; } // convert the filter to one that references the child of the project final RexNode condition = RelOptUtil.pushPastProject(filter.getCondition(), project); doPushFilterToScan(call, filter, project, scan, groupScan, condition); }
@Override public void onMatch(RelOptRuleCall call) { final FilterPrel filter = call.rel(0); final ProjectPrel project = call.rel(1); final ScanPrel scan = call.rel(2); // convert the filter to one that references the child of the project final RexNode condition = RelOptUtil.pushPastProject(filter.getCondition(), project); if (scan.getGroupScan() instanceof BinaryTableGroupScan) { BinaryTableGroupScan groupScan = (BinaryTableGroupScan)scan.getGroupScan(); doPushFilterIntoBinaryGroupScan(call, filter, project, scan, groupScan, condition); } else { assert(scan.getGroupScan() instanceof JsonTableGroupScan); JsonTableGroupScan groupScan = (JsonTableGroupScan)scan.getGroupScan(); doPushFilterIntoJsonGroupScan(call, filter, project, scan, groupScan, condition); } }
@Override public void onMatch(RelOptRuleCall call) { final ScanPrel scan = call.rel(1); final FilterPrel filter = call.rel(0); final RexNode condition = filter.getCondition(); LogicalExpression conditionExp = DrillOptiq.toDrill(new DrillParseContext(PrelUtil.getPlannerSettings(call.getPlanner())), scan, condition); KafkaGroupScan groupScan = (KafkaGroupScan) scan.getGroupScan(); logger.info("Partitions ScanSpec before pushdown: " + groupScan.getPartitionScanSpecList()); KafkaPartitionScanSpecBuilder builder = new KafkaPartitionScanSpecBuilder(groupScan, conditionExp); List<KafkaPartitionScanSpec> newScanSpec = null; newScanSpec = builder.parseTree(); builder.close(); //Close consumer //No pushdown if(newScanSpec == null) { return; } logger.info("Partitions ScanSpec after pushdown: " + newScanSpec); GroupScan newGroupScan = groupScan.cloneWithNewSpec(newScanSpec); final ScanPrel newScanPrel = new ScanPrel(scan.getCluster(), filter.getTraitSet(), newGroupScan, scan.getRowType(), scan.getTable()); call.transformTo(filter.copy(filter.getTraitSet(), ImmutableList.of(newScanPrel))); }
public RexNode getFilterCondition() { return filter.getCondition(); }
@Override public void onMatch(RelOptRuleCall call) { final ScanPrel scan = (ScanPrel) call.rel(1); final FilterPrel filter = (FilterPrel) call.rel(0); final RexNode condition = filter.getCondition(); HBaseGroupScan groupScan = (HBaseGroupScan)scan.getGroupScan(); if (groupScan.isFilterPushedDown()) { /* * The rule can get triggered again due to the transformed "scan => filter" sequence * created by the earlier execution of this rule when we could not do a complete * conversion of Optiq Filter's condition to HBase Filter. In such cases, we rely upon * this flag to not do a re-processing of the rule on the already transformed call. */ return; } doPushFilterToScan(call, filter, null, scan, groupScan, condition); }
@Override public void onMatch(RelOptRuleCall call) { final FilterPrel filter = call.rel(0); final ScanPrel scan = call.rel(1); final RexNode condition = filter.getCondition(); if (scan.getGroupScan() instanceof BinaryTableGroupScan) { BinaryTableGroupScan groupScan = (BinaryTableGroupScan)scan.getGroupScan(); doPushFilterIntoBinaryGroupScan(call, filter, null, scan, groupScan, condition); } else { assert(scan.getGroupScan() instanceof JsonTableGroupScan); JsonTableGroupScan groupScan = (JsonTableGroupScan)scan.getGroupScan(); doPushFilterIntoJsonGroupScan(call, filter, null, scan, groupScan, condition); } }
@Override public void onMatch(RelOptRuleCall call) { final ScanPrel scan = (ScanPrel) call.rel(2); final ProjectPrel project = (ProjectPrel) call.rel(1); final FilterPrel filter = (FilterPrel) call.rel(0); HBaseGroupScan groupScan = (HBaseGroupScan)scan.getGroupScan(); if (groupScan.isFilterPushedDown()) { /* * The rule can get triggered again due to the transformed "scan => filter" sequence * created by the earlier execution of this rule when we could not do a complete * conversion of Optiq Filter's condition to HBase Filter. In such cases, we rely upon * this flag to not do a re-processing of the rule on the already transformed call. */ return; } // convert the filter to one that references the child of the project final RexNode condition = RelOptUtil.pushPastProject(filter.getCondition(), project); doPushFilterToScan(call, filter, project, scan, groupScan, condition); }
@Override public void onMatch(RelOptRuleCall call) { final FilterPrel filter = call.rel(0); final ProjectPrel project = call.rel(1); final ScanPrel scan = call.rel(2); // convert the filter to one that references the child of the project final RexNode condition = RelOptUtil.pushPastProject(filter.getCondition(), project); if (scan.getGroupScan() instanceof BinaryTableGroupScan) { BinaryTableGroupScan groupScan = (BinaryTableGroupScan)scan.getGroupScan(); doPushFilterIntoBinaryGroupScan(call, filter, project, scan, groupScan, condition); } else { assert(scan.getGroupScan() instanceof JsonTableGroupScan); JsonTableGroupScan groupScan = (JsonTableGroupScan)scan.getGroupScan(); doPushFilterIntoJsonGroupScan(call, filter, project, scan, groupScan, condition); } }
condition = filter.getCondition(); } else { condition = RelOptUtil.pushPastProject(filter.getCondition(), project);
protected void doMatch(RelOptRuleCall call, ScanPrel scan, ProjectPrel project, FilterPrel filter) { final RexNode condition = filter.getCondition();