/** * Sets a new root relational expression, as the translation process * backs its way further up the tree. * * @param root New root relational expression * @param leaf Whether the relational expression is a leaf, that is, * derived from an atomic relational expression such as a table * name in the from clause, or the projection on top of a * select-sub-query. In particular, relational expressions * derived from JOIN operators are not leaves, but set * expressions are. */ public void setRoot(RelNode root, boolean leaf) { setRoot( Collections.singletonList(root), root, root instanceof LogicalJoin); if (leaf) { leaves.add(root); } this.columnMonotonicities.clear(); }
/** * Sets a new root relational expression, as the translation process * backs its way further up the tree. * * @param root New root relational expression * @param leaf Whether the relational expression is a leaf, that is, * derived from an atomic relational expression such as a table * name in the from clause, or the projection on top of a * select-sub-query. In particular, relational expressions * derived from JOIN operators are not leaves, but set * expressions are. */ public void setRoot(RelNode root, boolean leaf) { setRoot( Collections.singletonList(root), root, root instanceof LogicalJoin); if (leaf) { leaves.add(root); } this.columnMonotonicities.clear(); }
/** * Sets a new root relational expression, as the translation process * backs its way further up the tree. * * @param root New root relational expression * @param leaf Whether the relational expression is a leaf, that is, * derived from an atomic relational expression such as a table * name in the from clause, or the projection on top of a * select-sub-query. In particular, relational expressions * derived from JOIN operators are not leaves, but set * expressions are. */ public void setRoot(RelNode root, boolean leaf) { setRoot( Collections.singletonList(root), root, root instanceof LogicalJoin); if (leaf) { leaves.add(root); } this.columnMonotonicities.clear(); }
bb.setRoot(r, false);
bb.setRoot(r, false);
tableRel = LogicalTableScan.create(cluster, table); bb.setRoot(tableRel, true); if (usedDataset[0]) { bb.setDataset(datasetName);
bb.setRoot(r, false);
tableRel = LogicalTableScan.create(cluster, table); bb.setRoot(tableRel, true); if (usedDataset[0]) { bb.setDataset(datasetName);
bb.setRoot(r, false);
tableRel = LogicalTableScan.create(cluster, table); bb.setRoot(tableRel, true); if (usedDataset[0]) { bb.setDataset(datasetName);
private RexNode convertJoinCondition(Blackboard bb, SqlValidatorNamespace leftNamespace, SqlValidatorNamespace rightNamespace, SqlNode condition, JoinConditionType conditionType, RelNode leftRel, RelNode rightRel) { if (condition == null) { return rexBuilder.makeLiteral(true); } bb.setRoot(ImmutableList.of(leftRel, rightRel)); replaceSubQueries(bb, condition, RelOptUtil.Logic.UNKNOWN_AS_FALSE); switch (conditionType) { case ON: bb.setRoot(ImmutableList.of(leftRel, rightRel)); return bb.convertExpression(condition); case USING: final SqlNodeList list = (SqlNodeList) condition; final List<String> nameList = new ArrayList<>(); for (SqlNode columnName : list) { final SqlIdentifier id = (SqlIdentifier) columnName; String name = id.getSimple(); nameList.add(name); } return convertUsing(leftNamespace, rightNamespace, nameList); default: throw Util.unexpected(conditionType); } }
private RexNode convertJoinCondition(Blackboard bb, SqlValidatorNamespace leftNamespace, SqlValidatorNamespace rightNamespace, SqlNode condition, JoinConditionType conditionType, RelNode leftRel, RelNode rightRel) { if (condition == null) { return rexBuilder.makeLiteral(true); } bb.setRoot(ImmutableList.of(leftRel, rightRel)); replaceSubQueries(bb, condition, RelOptUtil.Logic.UNKNOWN_AS_FALSE); switch (conditionType) { case ON: bb.setRoot(ImmutableList.of(leftRel, rightRel)); return bb.convertExpression(condition); case USING: final SqlNodeList list = (SqlNodeList) condition; final List<String> nameList = new ArrayList<>(); for (SqlNode columnName : list) { final SqlIdentifier id = (SqlIdentifier) columnName; String name = id.getSimple(); nameList.add(name); } return convertUsing(leftNamespace, rightNamespace, nameList); default: throw Util.unexpected(conditionType); } }
private RexNode convertJoinCondition(Blackboard bb, SqlValidatorNamespace leftNamespace, SqlValidatorNamespace rightNamespace, SqlNode condition, JoinConditionType conditionType, RelNode leftRel, RelNode rightRel) { if (condition == null) { return rexBuilder.makeLiteral(true); } bb.setRoot(ImmutableList.of(leftRel, rightRel)); replaceSubQueries(bb, condition, RelOptUtil.Logic.UNKNOWN_AS_FALSE); switch (conditionType) { case ON: bb.setRoot(ImmutableList.of(leftRel, rightRel)); return bb.convertExpression(condition); case USING: final SqlNodeList list = (SqlNodeList) condition; final List<String> nameList = new ArrayList<>(); for (SqlNode columnName : list) { final SqlIdentifier id = (SqlIdentifier) columnName; String name = id.getSimple(); nameList.add(name); } return convertUsing(leftNamespace, rightNamespace, nameList); default: throw Util.unexpected(conditionType); } }
private RexNode convertJoinCondition(Blackboard bb, SqlValidatorNamespace leftNamespace, SqlValidatorNamespace rightNamespace, SqlNode condition, JoinConditionType conditionType, RelNode leftRel, RelNode rightRel) { if (condition == null) { return rexBuilder.makeLiteral(true); } bb.setRoot(ImmutableList.of(leftRel, rightRel)); replaceSubQueries(bb, condition, RelOptUtil.Logic.UNKNOWN_AS_FALSE); switch (conditionType) { case ON: bb.setRoot(ImmutableList.of(leftRel, rightRel)); return bb.convertExpression(condition); case USING: final SqlNodeList list = (SqlNodeList) condition; final List<String> nameList = new ArrayList<>(); for (SqlNode columnName : list) { final SqlIdentifier id = (SqlIdentifier) columnName; String name = id.getSimple(); nameList.add(name); } return convertUsing(leftNamespace, rightNamespace, nameList); default: throw Util.unexpected(conditionType); } }
tableRel = LogicalTableScan.create(cluster, table); bb.setRoot(tableRel, true); if (usedDataset[0]) { bb.setDataset(datasetName);
/** * Sets a new root relational expression, as the translation process * backs its way further up the tree. * * @param root New root relational expression * @param leaf Whether the relational expression is a leaf, that is, * derived from an atomic relational expression such as a table * name in the from clause, or the projection on top of a * select-sub-query. In particular, relational expressions * derived from JOIN operators are not leaves, but set * expressions are. */ public void setRoot(RelNode root, boolean leaf) { setRoot( Collections.singletonList(root), root, root instanceof LogicalJoin); if (leaf) { leaves.add(root); } this.columnMonotonicities.clear(); }
void setRoot(List<RelNode> inputs) { setRoot(inputs, null, false); }
void setRoot(List<RelNode> inputs) { setRoot(inputs, null, false); }
void setRoot(List<RelNode> inputs) { setRoot(inputs, null, false); }
void setRoot(List<RelNode> inputs) { setRoot(inputs, null, false); }