for (int i=0; i<inputs.size(); i++) { ImmutableSet.Builder<Integer> projsFromInputJoinKeysInChildSchema = ImmutableSet.builder(); InputReferencedVisitor irvLeft = new InputReferencedVisitor(); irvLeft.apply(joinExprs.get(i)); projsFromInputJoinKeysInChildSchema.addAll(irvLeft.inputPosReferenced); projsJoinKeysInChildSchema.add(projsFromInputJoinKeysInChildSchema.build());
cluster.getTypeFactory().builder(); final RelOptUtil.InputReferencedVisitor visitor = new RelOptUtil.InputReferencedVisitor(); final List<Integer> positions = new ArrayList<>(); final List<RelDataType> innerTypes = new ArrayList<>();
for (int i=0; i<inputs.size(); i++) { ImmutableSet.Builder<Integer> projsFromInputJoinKeysInChildSchema = ImmutableSet.builder(); InputReferencedVisitor irvLeft = new InputReferencedVisitor(); irvLeft.apply(joinKeyExprs.get(i)); projsFromInputJoinKeysInChildSchema.addAll(irvLeft.inputPosReferenced); projsJoinKeysInChildSchema.add(projsFromInputJoinKeysInChildSchema.build());
private static Pair<List<RexNode>, List<RexNode>> splitProjects(final RexBuilder rexBuilder, final RelNode input, List<RexNode> nodes) { final RelOptUtil.InputReferencedVisitor visitor = new RelOptUtil.InputReferencedVisitor(); for (RexNode node : nodes) { node.accept(visitor);
private static Pair<List<RexNode>, List<RexNode>> splitProjects(final RexBuilder rexBuilder, final RelNode input, List<RexNode> nodes) { final RelOptUtil.InputReferencedVisitor visitor = new RelOptUtil.InputReferencedVisitor(); for (RexNode node : nodes) { node.accept(visitor);
final RelOptUtil.InputReferencedVisitor visitor = new RelOptUtil.InputReferencedVisitor(); conj.accept(visitor); if (visitor.inputPosReferenced.contains(timestampFieldIdx)) {
/** * Given a list of conditions that contain Druid valid operations and * a list that contains those that contain any non-supported operation, * it outputs a triple with three different categories: * 1-l) condition filters on the timestamp column, * 2-m) condition filters that can be pushed to Druid, * 3-r) condition filters that cannot be pushed to Druid. */ private static Triple<List<RexNode>, List<RexNode>, List<RexNode>> splitFilters( final RexBuilder rexBuilder, final DruidQuery input, final List<RexNode> validPreds, final List<RexNode> nonValidPreds, final int timestampFieldIdx) { final List<RexNode> timeRangeNodes = new ArrayList<>(); final List<RexNode> pushableNodes = new ArrayList<>(); final List<RexNode> nonPushableNodes = new ArrayList<>(nonValidPreds); // Number of columns with the dimensions and timestamp for (RexNode conj : validPreds) { final RelOptUtil.InputReferencedVisitor visitor = new RelOptUtil.InputReferencedVisitor(); conj.accept(visitor); if (visitor.inputPosReferenced.contains(timestampFieldIdx) && visitor.inputPosReferenced.size() == 1) { timeRangeNodes.add(conj); } else { pushableNodes.add(conj); } } return ImmutableTriple.of(timeRangeNodes, pushableNodes, nonPushableNodes); } }
private Double getMaxNDV(RexCall call) { double tmpNDV; double maxNDV = 1.0; InputReferencedVisitor irv; for (RexNode op : call.getOperands()) { if (op instanceof RexInputRef) { tmpNDV = HiveRelMdDistinctRowCount.getDistinctRowCount(this.childRel, ((RexInputRef) op).getIndex()); if (tmpNDV > maxNDV) maxNDV = tmpNDV; } else { irv = new InputReferencedVisitor(); irv.apply(op); for (Integer childProjIndx : irv.inputPosReferenced) { tmpNDV = HiveRelMdDistinctRowCount.getDistinctRowCount(this.childRel, childProjIndx); if (tmpNDV > maxNDV) maxNDV = tmpNDV; } } } return maxNDV; }
for (int i=0; i<inputs.size(); i++) { ImmutableSet.Builder<Integer> projsFromInputJoinKeysInChildSchema = ImmutableSet.builder(); InputReferencedVisitor irvLeft = new InputReferencedVisitor(); irvLeft.apply(joinExprs.get(i)); projsFromInputJoinKeysInChildSchema.addAll(irvLeft.inputPosReferenced); projsJoinKeysInChildSchema.add(projsFromInputJoinKeysInChildSchema.build());
private Double getMaxNDV(RexCall call) { double tmpNDV; double maxNDV = 1.0; InputReferencedVisitor irv; RelMetadataQuery mq = RelMetadataQuery.instance(); for (RexNode op : call.getOperands()) { if (op instanceof RexInputRef) { tmpNDV = HiveRelMdDistinctRowCount.getDistinctRowCount(this.childRel, mq, ((RexInputRef) op).getIndex()); if (tmpNDV > maxNDV) maxNDV = tmpNDV; } else { irv = new InputReferencedVisitor(); irv.apply(op); for (Integer childProjIndx : irv.inputPosReferenced) { tmpNDV = HiveRelMdDistinctRowCount.getDistinctRowCount(this.childRel, mq, childProjIndx); if (tmpNDV > maxNDV) maxNDV = tmpNDV; } } } return maxNDV; }
private Double getMaxNDV(RexCall call) { double tmpNDV; double maxNDV = 1.0; InputReferencedVisitor irv; for (RexNode op : call.getOperands()) { if (op instanceof RexInputRef) { tmpNDV = HiveRelMdDistinctRowCount.getDistinctRowCount(this.childRel, mq, ((RexInputRef) op).getIndex()); if (tmpNDV > maxNDV) { maxNDV = tmpNDV; } } else { irv = new InputReferencedVisitor(); irv.apply(op); for (Integer childProjIndx : irv.inputPosReferenced) { tmpNDV = HiveRelMdDistinctRowCount.getDistinctRowCount(this.childRel, mq, childProjIndx); if (tmpNDV > maxNDV) { maxNDV = tmpNDV; } } } } return maxNDV; }