本文整理汇总了Java中org.eigenbase.rel.RelNode类的典型用法代码示例。如果您正苦于以下问题:Java RelNode类的具体用法?Java RelNode怎么用?Java RelNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RelNode类属于org.eigenbase.rel包,在下文中一共展示了RelNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convert
import org.eigenbase.rel.RelNode; //导入依赖的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 org.eigenbase.rel.RelNode; //导入依赖的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 org.eigenbase.rel.RelNode; //导入依赖的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 org.eigenbase.rel.RelNode; //导入依赖的package包/类
public RelNode toRel(
RelOptTable.ToRelContext context,
RelOptTable relOptTable) {
return new JavaRules.EnumerableTableAccessRel(
context.getCluster(),
context.getCluster().traitSetOf(EnumerableConvention.INSTANCE),
relOptTable,
(Class) getElementType());
}
示例5: toRel
import org.eigenbase.rel.RelNode; //导入依赖的package包/类
public RelNode toRel(
RelOptTable.ToRelContext context,
RelOptTable relOptTable) {
// Request all fields.
final int fieldCount = relOptTable.getRowType().getFieldCount();
final int[] fields = CsvEnumerator.identityList(fieldCount);
return new CsvTableScan(context.getCluster(), relOptTable, this, fields);
}
示例6: OLAPProjectRel
import org.eigenbase.rel.RelNode; //导入依赖的package包/类
public OLAPProjectRel(RelOptCluster cluster, RelTraitSet traitSet, RelNode child, List<RexNode> exps, RelDataType rowType, int flags) {
super(cluster, traitSet, child, exps, rowType, flags);
Preconditions.checkArgument(getConvention() == OLAPRel.CONVENTION);
Preconditions.checkArgument(child.getConvention() == OLAPRel.CONVENTION);
this.rewriteProjects = exps;
this.hasJoin = false;
this.afterJoin = false;
this.rowType = getRowType();
}
示例7: OLAPLimitRel
import org.eigenbase.rel.RelNode; //导入依赖的package包/类
public OLAPLimitRel(RelOptCluster cluster, RelTraitSet traitSet, RelNode child, RexNode offset, RexNode fetch) {
super(cluster, traitSet, child);
Preconditions.checkArgument(getConvention() == CONVENTION);
Preconditions.checkArgument(getConvention() == child.getConvention());
this.localOffset = offset;
this.localFetch = fetch;
}
示例8: OLAPJoinRel
import org.eigenbase.rel.RelNode; //导入依赖的package包/类
public OLAPJoinRel(RelOptCluster cluster, RelTraitSet traits, RelNode left, RelNode right, //
RexNode condition, ImmutableIntList leftKeys, ImmutableIntList rightKeys, //
JoinRelType joinType, Set<String> variablesStopped) throws InvalidRelException {
super(cluster, traits, left, right, condition, leftKeys, rightKeys, joinType, variablesStopped);
Preconditions.checkArgument(getConvention() == OLAPRel.CONVENTION);
this.rowType = getRowType();
this.isTopJoin = false;
}
示例9: copy
import org.eigenbase.rel.RelNode; //导入依赖的package包/类
@Override
public EnumerableJoinRel copy(RelTraitSet traitSet, RexNode conditionExpr, RelNode left, RelNode right, //
JoinRelType joinType, boolean semiJoinDone) {
final JoinInfo joinInfo = JoinInfo.of(left, right, condition);
assert joinInfo.isEqui();
try {
return new OLAPJoinRel(getCluster(), traitSet, left, right, condition, joinInfo.leftKeys, joinInfo.rightKeys, joinType, variablesStopped);
} catch (InvalidRelException e) {
// Semantic error not possible. Must be a bug. Convert to
// internal error.
throw new AssertionError(e);
}
}
示例10: OLAPAggregateRel
import org.eigenbase.rel.RelNode; //导入依赖的package包/类
public OLAPAggregateRel(RelOptCluster cluster, RelTraitSet traits, RelNode child, BitSet groupSet, List<AggregateCall> aggCalls) throws InvalidRelException {
super(cluster, traits, child, groupSet, aggCalls);
Preconditions.checkArgument(getConvention() == OLAPRel.CONVENTION);
this.afterAggregate = false;
this.rewriteAggCalls = aggCalls;
this.rowType = getRowType();
}
示例11: copy
import org.eigenbase.rel.RelNode; //导入依赖的package包/类
@Override
public AggregateRelBase copy(RelTraitSet traitSet, RelNode input, BitSet groupSet, List<AggregateCall> aggCalls) {
try {
return new OLAPAggregateRel(getCluster(), traitSet, input, groupSet, aggCalls);
} catch (InvalidRelException e) {
throw new IllegalStateException("Can't create OLAPAggregateRel!", e);
}
}
示例12: visitChild
import org.eigenbase.rel.RelNode; //导入依赖的package包/类
public void visitChild(RelNode parent, RelNode child) {
if (parent instanceof OLAPRel) {
OLAPRel olapRel = (OLAPRel) parent;
this.parentContext = olapRel.getContext();
}
OLAPRel olapChild = (OLAPRel) child;
olapChild.implementRewrite(this);
}
示例13: convert
import org.eigenbase.rel.RelNode; //导入依赖的package包/类
@Override
public RelNode convert(RelNode rel) {
final SortRel sort = (SortRel) rel;
if (sort.offset != null || sort.fetch != null) {
return null;
}
final RelTraitSet traitSet = sort.getTraitSet().replace(OLAPRel.CONVENTION);
final RelNode input = sort.getChild();
return new OLAPSortRel(rel.getCluster(), traitSet, convert(input, input.getTraitSet().replace(OLAPRel.CONVENTION)), sort.getCollation(), sort.offset, sort.fetch);
}
示例14: onMatch
import org.eigenbase.rel.RelNode; //导入依赖的package包/类
@Override
public void onMatch(RelOptRuleCall call) {
final SortRel sort = call.rel(0);
if (sort.offset == null && sort.fetch == null) {
return;
}
final RelTraitSet traitSet = sort.getTraitSet().replace(OLAPRel.CONVENTION);
RelNode input = sort.getChild();
if (!sort.getCollation().getFieldCollations().isEmpty()) {
// Create a sort with the same sort key, but no offset or fetch.
input = sort.copy(sort.getTraitSet(), input, sort.getCollation(), null, null);
}
RelNode x = convert(input, input.getTraitSet().replace(OLAPRel.CONVENTION));
call.transformTo(new OLAPLimitRel(sort.getCluster(), traitSet, x, sort.offset, sort.fetch));
}
示例15: convert
import org.eigenbase.rel.RelNode; //导入依赖的package包/类
@Override
public RelNode convert(RelNode rel) {
AggregateRel agg = (AggregateRel) rel;
RelTraitSet traitSet = agg.getTraitSet().replace(OLAPRel.CONVENTION);
try {
return new OLAPAggregateRel(agg.getCluster(), traitSet, convert(agg.getChild(), traitSet), agg.getGroupSet(), agg.getAggCallList());
} catch (InvalidRelException e) {
throw new IllegalStateException("Can't create OLAPAggregateRel!", e);
}
}