本文整理汇总了Java中org.apache.calcite.adapter.enumerable.EnumerableRel类的典型用法代码示例。如果您正苦于以下问题:Java EnumerableRel类的具体用法?Java EnumerableRel怎么用?Java EnumerableRel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EnumerableRel类属于org.apache.calcite.adapter.enumerable包,在下文中一共展示了EnumerableRel类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: CalcitePreparingStmt
import org.apache.calcite.adapter.enumerable.EnumerableRel; //导入依赖的package包/类
public CalcitePreparingStmt(CalcitePrepareImpl prepare,
Context context,
CatalogReader catalogReader,
RelDataTypeFactory typeFactory,
CalciteSchema schema,
EnumerableRel.Prefer prefer,
RelOptPlanner planner,
Convention resultConvention,
SqlRexConvertletTable convertletTable) {
super(context, catalogReader, resultConvention);
this.prepare = prepare;
this.schema = schema;
this.prefer = prefer;
this.planner = planner;
this.typeFactory = typeFactory;
this.convertletTable = convertletTable;
this.rexBuilder = new RexBuilder(typeFactory);
}
开发者ID:apache,项目名称:kylin,代码行数:19,代码来源:CalcitePrepareImpl.java
示例2: implementSpark
import org.apache.calcite.adapter.enumerable.EnumerableRel; //导入依赖的package包/类
public Result implementSpark(Implementor implementor) {
// Generate:
// Enumerable source = ...;
// return SparkRuntime.createRdd(sparkContext, source);
final BlockBuilder list = new BlockBuilder();
final EnumerableRel child = (EnumerableRel) getInput();
final PhysType physType =
PhysTypeImpl.of(
implementor.getTypeFactory(), getRowType(),
JavaRowFormat.CUSTOM);
final Expression source = null; // TODO:
final Expression sparkContext =
Expressions.call(
SparkMethod.GET_SPARK_CONTEXT.method,
implementor.getRootExpression());
final Expression rdd =
list.append(
"rdd",
Expressions.call(
SparkMethod.CREATE_RDD.method,
sparkContext,
source));
list.add(
Expressions.return_(null, rdd));
return implementor.result(physType, list.toBlock());
}
开发者ID:apache,项目名称:calcite,代码行数:27,代码来源:EnumerableToSparkConverter.java
示例3: CalcitePreparingStmt
import org.apache.calcite.adapter.enumerable.EnumerableRel; //导入依赖的package包/类
CalcitePreparingStmt(CalcitePrepareImpl prepare,
Context context,
CatalogReader catalogReader,
RelDataTypeFactory typeFactory,
CalciteSchema schema,
EnumerableRel.Prefer prefer,
RelOptPlanner planner,
Convention resultConvention,
SqlRexConvertletTable convertletTable) {
super(context, catalogReader, resultConvention);
this.prepare = prepare;
this.schema = schema;
this.prefer = prefer;
this.planner = planner;
this.typeFactory = typeFactory;
this.convertletTable = convertletTable;
this.rexBuilder = new RexBuilder(typeFactory);
}
开发者ID:apache,项目名称:calcite,代码行数:19,代码来源:CalcitePrepareImpl.java
示例4: implementEnumerable
import org.apache.calcite.adapter.enumerable.EnumerableRel; //导入依赖的package包/类
@Override
public EnumerableRel implementEnumerable(List<EnumerableRel> inputs) {
// keep it for having clause
RexBuilder rexBuilder = getCluster().getRexBuilder();
RelDataType inputRowType = getInput().getRowType();
RexProgramBuilder programBuilder = new RexProgramBuilder(inputRowType, rexBuilder);
programBuilder.addIdentity();
programBuilder.addCondition(this.condition);
RexProgram program = programBuilder.getProgram();
return new EnumerableCalc(getCluster(), getCluster().traitSetOf(EnumerableConvention.INSTANCE), //
sole(inputs), program);
}
开发者ID:apache,项目名称:kylin,代码行数:14,代码来源:OLAPFilterRel.java
示例5: implementEnumerable
import org.apache.calcite.adapter.enumerable.EnumerableRel; //导入依赖的package包/类
@Override
public EnumerableRel implementEnumerable(List<EnumerableRel> inputs) {
ArrayList<RelNode> relInputs = new ArrayList<>(inputs.size());
for (EnumerableRel input : inputs) {
if (input instanceof OLAPRel) {
((OLAPRel) input).replaceTraitSet(EnumerableConvention.INSTANCE);
}
relInputs.add(input);
}
return new EnumerableUnion(getCluster(), traitSet, relInputs, localAll);
}
开发者ID:apache,项目名称:kylin,代码行数:12,代码来源:OLAPUnionRel.java
示例6: implementEnumerable
import org.apache.calcite.adapter.enumerable.EnumerableRel; //导入依赖的package包/类
@Override
public EnumerableRel implementEnumerable(List<EnumerableRel> inputs) {
for (EnumerableRel input : inputs) {
if (input instanceof OLAPRel) {
((OLAPRel) input).replaceTraitSet(EnumerableConvention.INSTANCE);
}
}
return EnumerableWindowBridge.createEnumerableWindow(getCluster(), traitSet, inputs.get(0), constants, rowType,
groups);
}
开发者ID:apache,项目名称:kylin,代码行数:11,代码来源:OLAPWindowRel.java
示例7: implementEnumerable
import org.apache.calcite.adapter.enumerable.EnumerableRel; //导入依赖的package包/类
@Override
public EnumerableRel implementEnumerable(List<EnumerableRel> inputs) {
EnumerableRel input = sole(inputs);
if (input instanceof OLAPRel) {
((OLAPRel) input).replaceTraitSet(EnumerableConvention.INSTANCE);
}
return EnumerableLimit.create(input, localOffset, localFetch);
}
开发者ID:apache,项目名称:kylin,代码行数:9,代码来源:OLAPLimitRel.java
示例8: implementEnumerable
import org.apache.calcite.adapter.enumerable.EnumerableRel; //导入依赖的package包/类
@Override
public EnumerableRel implementEnumerable(List<EnumerableRel> inputs) {
if (this.hasSubQuery) {
try {
return constr.newInstance(getCluster(), getCluster().traitSetOf(EnumerableConvention.INSTANCE), //
inputs.get(0), inputs.get(1), condition, leftKeys, rightKeys, variablesSet, joinType);
} catch (Exception e) {
throw new IllegalStateException("Can't create EnumerableJoin!", e);
}
} else {
return this;
}
}
开发者ID:apache,项目名称:kylin,代码行数:14,代码来源:OLAPJoinRel.java
示例9: implementEnumerable
import org.apache.calcite.adapter.enumerable.EnumerableRel; //导入依赖的package包/类
@Override
public EnumerableRel implementEnumerable(List<EnumerableRel> inputs) {
try {
return new EnumerableAggregate(getCluster(), getCluster().traitSetOf(EnumerableConvention.INSTANCE), //
sole(inputs), indicator, this.groupSet, this.groupSets, rewriteAggCalls);
} catch (InvalidRelException e) {
throw new IllegalStateException("Can't create EnumerableAggregate!", e);
}
}
开发者ID:apache,项目名称:kylin,代码行数:10,代码来源:OLAPAggregateRel.java
示例10: createEnumerable
import org.apache.calcite.adapter.enumerable.EnumerableRel; //导入依赖的package包/类
public EnumerableRel createEnumerable(OLAPRel parent) {
ArrayList<EnumerableRel> enumInputs = null;
List<RelNode> children = parent.getInputs();
if (children != null) {
enumInputs = Lists.newArrayListWithCapacity(children.size());
for (RelNode child : children) {
enumInputs.add(createEnumerable((OLAPRel) child));
}
}
EnumerableRel result = parent.implementEnumerable(enumInputs);
relContexts.put(result, parent.getContext());
return result;
}
开发者ID:apache,项目名称:kylin,代码行数:15,代码来源:OLAPRel.java
示例11: visitChild
import org.apache.calcite.adapter.enumerable.EnumerableRel; //导入依赖的package包/类
@Override
public EnumerableRel.Result visitChild(EnumerableRel parent, int ordinal, EnumerableRel child, EnumerableRel.Prefer prefer) {
if (calciteDebug) {
OLAPContext context;
if (child instanceof OLAPRel)
context = ((OLAPRel) child).getContext();
else
context = relContexts.get(child);
System.out.println(context + " - " + child);
}
return super.visitChild(parent, ordinal, child, prefer);
}
开发者ID:apache,项目名称:kylin,代码行数:15,代码来源:OLAPRel.java
示例12: CalciteMaterializer
import org.apache.calcite.adapter.enumerable.EnumerableRel; //导入依赖的package包/类
CalciteMaterializer(CalcitePrepareImpl prepare,
CalcitePrepare.Context context,
CatalogReader catalogReader, CalciteSchema schema,
RelOptPlanner planner, SqlRexConvertletTable convertletTable) {
super(prepare, context, catalogReader, catalogReader.getTypeFactory(),
schema, EnumerableRel.Prefer.ANY, planner, BindableConvention.INSTANCE,
convertletTable);
}
开发者ID:apache,项目名称:calcite,代码行数:9,代码来源:CalciteMaterializer.java
示例13: implementEnumerable
import org.apache.calcite.adapter.enumerable.EnumerableRel; //导入依赖的package包/类
@Override
public EnumerableRel implementEnumerable(List<EnumerableRel> inputs) {
return this;
}
开发者ID:apache,项目名称:kylin,代码行数:6,代码来源:OLAPTableScan.java
示例14: implementEnumerable
import org.apache.calcite.adapter.enumerable.EnumerableRel; //导入依赖的package包/类
@Override
public EnumerableRel implementEnumerable(List<EnumerableRel> inputs) {
return new EnumerableSort(getCluster(),
getCluster().traitSetOf(EnumerableConvention.INSTANCE).replace(collation), //
sole(inputs), collation, offset, fetch);
}
开发者ID:apache,项目名称:kylin,代码行数:7,代码来源:OLAPSortRel.java
示例15: implement
import org.apache.calcite.adapter.enumerable.EnumerableRel; //导入依赖的package包/类
@Override protected PreparedResult implement(RelRoot root) {
RelDataType resultType = root.rel.getRowType();
boolean isDml = root.kind.belongsTo(SqlKind.DML);
final Bindable bindable;
if (resultConvention == BindableConvention.INSTANCE) {
bindable = Interpreters.bindable(root.rel);
} else {
EnumerableRel enumerable = (EnumerableRel) root.rel;
if (!root.isRefTrivial()) {
final List<RexNode> projects = new ArrayList<>();
final RexBuilder rexBuilder = enumerable.getCluster().getRexBuilder();
for (int field : Pair.left(root.fields)) {
projects.add(rexBuilder.makeInputRef(enumerable, field));
}
RexProgram program = RexProgram.create(enumerable.getRowType(),
projects, null, root.validatedRowType, rexBuilder);
enumerable = EnumerableCalc.create(enumerable, program);
}
try {
CatalogReader.THREAD_LOCAL.set(catalogReader);
bindable = EnumerableInterpretable.toBindable(internalParameters,
context.spark(), enumerable, prefer);
} finally {
CatalogReader.THREAD_LOCAL.remove();
}
}
if (timingTracer != null) {
timingTracer.traceTime("end codegen");
}
if (timingTracer != null) {
timingTracer.traceTime("end compilation");
}
return new PreparedResultImpl(
resultType,
parameterRowType,
fieldOrigins,
root.collation.getFieldCollations().isEmpty()
? ImmutableList.<RelCollation>of()
: ImmutableList.of(root.collation),
root.rel,
mapTableModOp(isDml, root.kind),
isDml) {
public String getCode() {
throw new UnsupportedOperationException();
}
public Bindable getBindable(Meta.CursorFactory cursorFactory) {
return bindable;
}
public Type getElementType() {
return ((Typed) bindable).getElementType();
}
};
}
开发者ID:apache,项目名称:kylin,代码行数:60,代码来源:CalcitePrepareImpl.java
示例16: implementEnumerable
import org.apache.calcite.adapter.enumerable.EnumerableRel; //导入依赖的package包/类
public EnumerableRel implementEnumerable(List<EnumerableRel> inputs);
开发者ID:apache,项目名称:kylin,代码行数:2,代码来源:OLAPRel.java
注:本文中的org.apache.calcite.adapter.enumerable.EnumerableRel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论