本文整理汇总了Java中org.eigenbase.rel.RelNode类的典型用法代码示例。如果您正苦于以下问题:Java RelNode类的具体用法?Java RelNode怎么用?Java RelNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RelNode类属于org.eigenbase.rel包,在下文中一共展示了RelNode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:joshelser,项目名称:cosmos,代码行数:21,代码来源:GroupByRule.java
示例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);
}
开发者ID:joshelser,项目名称:cosmos,代码行数:22,代码来源:LimitRule.java
示例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());
}
开发者ID:OSBI,项目名称:optiq-solr,代码行数:10,代码来源:SolrTable.java
示例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());
}
开发者ID:apache,项目名称:incubator-optiq-csv,代码行数:10,代码来源:JsonTable.java
示例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);
}
开发者ID:apache,项目名称:incubator-optiq-csv,代码行数:9,代码来源:CsvSmartTable.java
示例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();
}
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:10,代码来源:OLAPProjectRel.java
示例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;
}
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:8,代码来源:OLAPLimitRel.java
示例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;
}
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:9,代码来源:OLAPJoinRel.java
示例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);
}
}
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:15,代码来源:OLAPJoinRel.java
示例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();
}
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:8,代码来源:OLAPAggregateRel.java
示例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);
}
}
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:9,代码来源:OLAPAggregateRel.java
示例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);
}
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:9,代码来源:OLAPRel.java
示例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);
}
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:11,代码来源:OLAPSortRule.java
示例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));
}
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:16,代码来源:OLAPLimitRule.java
示例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);
}
}
开发者ID:KylinOLAP,项目名称:Kylin,代码行数:11,代码来源:OLAPAggregateRule.java
示例16: convertToOperator
import org.eigenbase.rel.RelNode; //导入依赖的package包/类
public Operator convertToOperator(String sql) throws SqlParseException, ValidationException, RelConversionException {
LOG.info("Parsing "+sql);
SqlNode root = planner.parse(sql);
SqlNode validated = planner.validate(root);
RelNode rel = planner.convert(validated);
LOG.info("Conversion done");
// print out logical tree
PrintWriter p = new PrintWriter(System.out);
RelWriter pw = new RelWriterImpl(p, SqlExplainLevel.ALL_ATTRIBUTES, true);
rel.explain(pw);
RelNode convertedRelNode = planner.transform(0, planner.getEmptyTraitSet().plus(StratosphereRel.CONVENTION), rel);
LOG.info("Optimization done.");
planner.close();
planner.reset();
System.err.println("Optimizer "+ convertedRelNode);
convertedRelNode.explain(pw);
Operator stratoRoot = null;
Plan plan = null;
//if(convertedRelNode instanceof StratosphereSqlProjection) {
if(convertedRelNode instanceof StratosphereRel) {
StratosphereRel stratoRel = ((StratosphereRel) convertedRelNode);
stratoRoot = stratoRel.getStratosphereOperator();
LOG.info("Conversion to Stratosphere done");
return stratoRoot;
}
throw new RuntimeException("Fix me, its obvious");
}
开发者ID:rmetzger,项目名称:stratosphere-sql,代码行数:32,代码来源:Launcher.java
示例17: StratosphereSqlAggregation
import org.eigenbase.rel.RelNode; //导入依赖的package包/类
public StratosphereSqlAggregation(RelOptCluster cluster,
RelTraitSet traits, RelNode child, BitSet groupSet,
List<AggregateCall> aggCalls) {
super(cluster, traits, child, groupSet, aggCalls);
System.err.println("Child "+child+" Child rowtype "+child.getRowType());
Preconditions.checkArgument(getConvention() == CONVENTION);
}
开发者ID:rmetzger,项目名称:stratosphere-sql,代码行数:8,代码来源:StratosphereSqlAggregation.java
示例18: openSingleInputOperator
import org.eigenbase.rel.RelNode; //导入依赖的package包/类
public static Operator openSingleInputOperator(List<RelNode> optiqInput) {
Operator inputOp = null;
if(optiqInput.size() == 1) {
final RelNode optiqSingleInput = optiqInput.get(0);
final StratosphereRel stratoRel = toStratoRel(optiqSingleInput);
inputOp = stratoRel.getStratosphereOperator();
} else {
throw new StratosphereSQLException("Multiple inputs not supported at this time");
}
return inputOp;
}
开发者ID:rmetzger,项目名称:stratosphere-sql,代码行数:12,代码来源:StratosphereRelUtils.java
示例19: StratosphereSqlJoin
import org.eigenbase.rel.RelNode; //导入依赖的package包/类
public StratosphereSqlJoin(RelOptCluster cluster, RelTraitSet traits,
RelNode left, RelNode right, RexNode condition,
JoinRelType joinType, Set<String> variablesStopped) {
super(cluster, traits, left, right, condition, joinType, variablesStopped);
Preconditions.checkArgument(getConvention() == CONVENTION);
Preconditions.checkArgument(joinType == JoinRelType.INNER, "Only inner joins are supported at the moment");
}
开发者ID:rmetzger,项目名称:stratosphere-sql,代码行数:9,代码来源:StratosphereSqlJoin.java
示例20: copy
import org.eigenbase.rel.RelNode; //导入依赖的package包/类
@Override
public JoinRelBase copy(RelTraitSet traitSet, RexNode conditionExpr,
RelNode left, RelNode right, JoinRelType joinType) {
System.err.println("StratoJoin.copy()");
return new StratosphereSqlJoin(getCluster(), traitSet, left,
right, conditionExpr, joinType, getVariablesStopped());
}
开发者ID:rmetzger,项目名称:stratosphere-sql,代码行数:8,代码来源:StratosphereSqlJoin.java
注:本文中的org.eigenbase.rel.RelNode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论