本文整理汇总了Java中net.hydromatic.optiq.rules.java.EnumerableConvention类的典型用法代码示例。如果您正苦于以下问题:Java EnumerableConvention类的具体用法?Java EnumerableConvention怎么用?Java EnumerableConvention使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EnumerableConvention类属于net.hydromatic.optiq.rules.java包,在下文中一共展示了EnumerableConvention类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convert
import net.hydromatic.optiq.rules.java.EnumerableConvention; //导入依赖的package包/类
@Override
public RelNode convert(RelNode rel) {
if (rel instanceof AggregateRel) {
final AggregateRel agg = (AggregateRel) rel;
final RelTraitSet traitSet = agg.getTraitSet().replace(
EnumerableConvention.INSTANCE);
try {
return new GroupBy(rel.getCluster(), traitSet, convert(
agg.getChild(), traitSet), agg.getGroupSet(),
agg.getAggCallList(), accumuloAccessor);
} catch (InvalidRelException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
} else
return new EnumerableRelation(rel.getCluster(), rel.getTraitSet()
.replace(getOutConvention()), rel);
}
示例2: convert
import net.hydromatic.optiq.rules.java.EnumerableConvention; //导入依赖的package包/类
@Override
public RelNode convert(RelNode rel) {
final SortRel sort = (SortRel) rel;
// do not handle other rules
if (sort.offset == null && sort.fetch == null) {
return sort;
}
final RelTraitSet traits = sort.getTraitSet().plus(EnumerableConvention.INSTANCE);
RelNode input = sort.getChild();
if (!sort.getCollation().getFieldCollations().isEmpty()) {
input = sort.copy(sort.getTraitSet().replace(RelCollationImpl.EMPTY), input, RelCollationImpl.EMPTY, null, null);
}
final RelNode convertedInput = convert(input, input.getTraitSet().plus(EnumerableConvention.INSTANCE));
return new EnumerableSort(sort.getCluster(), traits, convertedInput, sort.fetch, sort.offset, accumuloAccessor);
}
示例3: toRel
import net.hydromatic.optiq.rules.java.EnumerableConvention; //导入依赖的package包/类
public RelNode toRel(
RelOptTable.ToRelContext context,
RelOptTable relOptTable) {
return new JavaRules.EnumerableTableAccessRel(
context.getCluster(),
context.getCluster().traitSetOf(EnumerableConvention.INSTANCE),
relOptTable,
getElementType());
}
示例4: toRel
import net.hydromatic.optiq.rules.java.EnumerableConvention; //导入依赖的package包/类
public RelNode toRel(
RelOptTable.ToRelContext context,
RelOptTable relOptTable) {
return new JavaRules.EnumerableTableAccessRel(
context.getCluster(),
context.getCluster().traitSetOf(EnumerableConvention.INSTANCE),
relOptTable,
(Class) getElementType());
}
示例5: implement
import net.hydromatic.optiq.rules.java.EnumerableConvention; //导入依赖的package包/类
@Override
public Result implement(EnumerableRelImplementor implementor, Prefer pref) {
// keep it for having clause
RexBuilder rexBuilder = getCluster().getRexBuilder();
RelDataType inputRowType = getChild().getRowType();
RexProgramBuilder programBuilder = new RexProgramBuilder(inputRowType, rexBuilder);
programBuilder.addIdentity();
programBuilder.addCondition(this.condition);
RexProgram program = programBuilder.getProgram();
EnumerableCalcRel enumCalcRel = new EnumerableCalcRel(getCluster(), getCluster().traitSetOf(EnumerableConvention.INSTANCE), getChild(), this.rowType, program, ImmutableList.<RelCollation> of());
return enumCalcRel.implement(implementor, pref);
}
示例6: implement
import net.hydromatic.optiq.rules.java.EnumerableConvention; //导入依赖的package包/类
@Override
public Result implement(EnumerableRelImplementor implementor, Prefer pref) {
OLAPRel childRel = (OLAPRel) getChild();
childRel.replaceTraitSet(EnumerableConvention.INSTANCE);
EnumerableLimitRel enumLimit = new EnumerableLimitRel(getCluster(), getCluster().traitSetOf(EnumerableConvention.INSTANCE), getChild(), localOffset, localFetch);
Result res = enumLimit.implement(implementor, pref);
childRel.replaceTraitSet(CONVENTION);
return res;
}
示例7: implement
import net.hydromatic.optiq.rules.java.EnumerableConvention; //导入依赖的package包/类
@Override
public Result implement(EnumerableRelImplementor implementor, Prefer pref) {
EnumerableAggregateRel enumAggRel;
try {
enumAggRel = new EnumerableAggregateRel(getCluster(), getCluster().traitSetOf(EnumerableConvention.INSTANCE), getChild(), this.groupSet, rewriteAggCalls);
} catch (InvalidRelException e) {
throw new IllegalStateException("Can't create EnumerableAggregateRel!", e);
}
return enumAggRel.implement(implementor, pref);
}
示例8: GroupByRule
import net.hydromatic.optiq.rules.java.EnumerableConvention; //导入依赖的package包/类
public GroupByRule(DataTable<?> resultTable) {
// when see an aggregate who has a child operand
// super(resultTable,some(AggregateRel.class, Convention.NONE,
// any(RelNode.class)));
super(AggregateRel.class, Convention.NONE,
EnumerableConvention.INSTANCE, "EnumerableAggregateRulsdfse");
this.accumuloAccessor = resultTable;
}
示例9: toRel
import net.hydromatic.optiq.rules.java.EnumerableConvention; //导入依赖的package包/类
public RelNode toRel(RelOptTable.ToRelContext context, RelOptTable relOptTable) {
return new JavaRules.EnumerableTableAccessRel(context.getCluster(),
context.getCluster().traitSetOf(EnumerableConvention.INSTANCE),
relOptTable, (Class) getElementType());
}
示例10: OLAPToEnumerableConverterRule
import net.hydromatic.optiq.rules.java.EnumerableConvention; //导入依赖的package包/类
public OLAPToEnumerableConverterRule() {
super(RelNode.class, OLAPRel.CONVENTION, EnumerableConvention.INSTANCE, "OLAPToEnumerableConverterRule");
}
示例11: FieldPacker
import net.hydromatic.optiq.rules.java.EnumerableConvention; //导入依赖的package包/类
public FieldPacker(TableScanner scanner) {
super(CalcRel.class, Convention.NONE, EnumerableConvention.INSTANCE, "FieldPacker");
this.scanner = scanner;
}
示例12: convert
import net.hydromatic.optiq.rules.java.EnumerableConvention; //导入依赖的package包/类
public RelNode convert(RelNode rel) {
final CalcRel calc = (CalcRel) rel;
final RexProgram program = calc.getProgram();
RelDataType rowType = program.getOutputRowType();
scanner.setFields(rowType.getFieldNames());
if (RexMultisetUtil.containsMultiset(program) || program.containsAggs()) {
return null;
}
return new FieldPackerRelation(rel.getCluster(), rel.getTraitSet().replace(EnumerableConvention.INSTANCE), convert(calc.getChild(), calc.getChild()
.getTraitSet().replace(EnumerableConvention.INSTANCE)), program, ProjectRelBase.Flags.Boxed);
}
示例13: implement
import net.hydromatic.optiq.rules.java.EnumerableConvention; //导入依赖的package包/类
@Override
public Result implement(EnumerableRelImplementor implementor, Prefer pref) {
OLAPRel childRel = (OLAPRel) getChild();
childRel.replaceTraitSet(EnumerableConvention.INSTANCE);
EnumerableSortRel enumSort = new EnumerableSortRel(getCluster(), getCluster().traitSetOf(EnumerableConvention.INSTANCE, collation), getChild(), collation, offset, fetch);
Result res = enumSort.implement(implementor, pref);
childRel.replaceTraitSet(OLAPRel.CONVENTION);
return res;
}
示例14: EnumerableExpression
import net.hydromatic.optiq.rules.java.EnumerableConvention; //导入依赖的package包/类
private EnumerableExpression() {
super(RelNode.class, CosmosRelNode.CONVENTION, EnumerableConvention.INSTANCE, "EnumerableRule");
}