push(sort2.getInput()); final RelNode sort = sortFactory.createSort(build(), sort2.collation, offsetNode, fetchNode); push(sort); push(sort2.getInput()); final RelNode sort = sortFactory.createSort(build(), sort2.collation, offsetNode, fetchNode); push(sort); sortFactory.createSort(build(), RelCollations.of(fieldCollations), offsetNode, fetchNode); push(sort);
replaceTop(sort2.getInput()); final RelNode sort = sortFactory.createSort(peek(), sort2.collation, offsetNode, fetchNode); replaceTop(sort); if (sort2.offset == null && sort2.fetch == null) { final RelNode sort = sortFactory.createSort(sort2.getInput(), sort2.collation, offsetNode, fetchNode); replaceTop( sortFactory.createSort(peek(), RelCollations.of(fieldCollations), offsetNode, fetchNode); replaceTop(sort);
replaceTop(sort2.getInput()); final RelNode sort = sortFactory.createSort(peek(), sort2.collation, offsetNode, fetchNode); replaceTop(sort); if (sort2.offset == null && sort2.fetch == null) { final RelNode sort = sortFactory.createSort(sort2.getInput(), sort2.collation, offsetNode, fetchNode); replaceTop( sortFactory.createSort(peek(), RelCollations.of(fieldCollations), offsetNode, fetchNode); replaceTop(sort);
replaceTop(sort2.getInput()); final RelNode sort = sortFactory.createSort(peek(), sort2.collation, offsetNode, fetchNode); replaceTop(sort); if (sort2.offset == null && sort2.fetch == null) { final RelNode sort = sortFactory.createSort(sort2.getInput(), sort2.collation, offsetNode, fetchNode); replaceTop( sortFactory.createSort(peek(), RelCollations.of(fieldCollations), offsetNode, fetchNode); replaceTop(sort);
/** Creates a relational expression that reads from an input and throws * all of the rows away. */ @Override public RelBuilder empty() { final Frame frame = stack.pop(); final RelNode input; // If the rel that we are limiting the output of a rel, we should just add a limit 0 on top. // If the rel that we are limiting is a Filter replace it as well since Filter does not // change the row type. if (!(frame.rel instanceof Filter)) { input = frame.rel; } else { input = frame.rel.getInput(0); } final RelNode sort = sortFactory.createSort(input, RelCollations.EMPTY, frame.rel.getCluster().getRexBuilder().makeExactLiteral(BigDecimal.valueOf(0)), frame.rel.getCluster().getRexBuilder().makeExactLiteral(BigDecimal.valueOf(0))); push(sort); return this; }
push(sort2.getInput()); final RelNode sort = sortFactory.createSort(build(), sort2.collation, offsetNode, fetchNode); push(sort); push(sort2.getInput()); final RelNode sort = sortFactory.createSort(build(), sort2.collation, offsetNode, fetchNode); push(sort); sortFactory.createSort(build(), RelCollations.of(fieldCollations), offsetNode, fetchNode); push(sort);
/** * Empty relationship can be expressed in many different ways, e.g., * filter(cond=false), empty LogicalValues(), etc. Calcite default implementation * uses empty LogicalValues(); however, currently there is not an equivalent to * this expression in Hive. Thus, we use limit 0, since Hive already includes * optimizations that will do early pruning of the result tree when it is found, * e.g., GlobalLimitOptimizer. */ public HiveSubQRemoveRelBuilder empty() { final RelNode input = build(); final RelNode sort = HiveRelFactories.HIVE_SORT_FACTORY.createSort( input, RelCollations.of(), null, literal(0)); return this.push(sort); }
/** * Empty relationship can be expressed in many different ways, e.g., * filter(cond=false), empty LogicalValues(), etc. Calcite default implementation * uses empty LogicalValues(); however, currently there is not an equivalent to * this expression in Hive. Thus, we use limit 0, since Hive already includes * optimizations that will do early pruning of the result tree when it is found, * e.g., GlobalLimitOptimizer. */ @Override public RelBuilder empty() { final RelNode input = build(); final RelNode sort = HiveRelFactories.HIVE_SORT_FACTORY.createSort( input, RelCollations.of(), null, literal(0)); return this.push(sort); }
/** * Empty relationship can be expressed in many different ways, e.g., * filter(cond=false), empty LogicalValues(), etc. Calcite default implementation * uses empty LogicalValues(); however, currently there is not an equivalent to * this expression in Hive. Thus, we use limit 0, since Hive already includes * optimizations that will do early pruning of the result tree when it is found, * e.g., GlobalLimitOptimizer. */ @Override public RelBuilder empty() { final RelNode input = build(); final RelNode sort = HiveRelFactories.HIVE_SORT_FACTORY.createSort( input, RelCollations.of(), null, literal(0)); return this.push(sort); }
/** * Empty relationship can be expressed in many different ways, e.g., * filter(cond=false), empty LogicalValues(), etc. Calcite default implementation * uses empty LogicalValues(); however, currently there is not an equivalent to * this expression in Hive. Thus, we use limit 0, since Hive already includes * optimizations that will do early pruning of the result tree when it is found, * e.g., GlobalLimitOptimizer. */ public HiveSubQRemoveRelBuilder empty() { final RelNode input = build(); final RelNode sort = HiveRelFactories.HIVE_SORT_FACTORY.createSort( input, RelCollations.of(), null, literal(0)); return this.push(sort); }