本文整理汇总了Java中org.apache.calcite.rel.core.CorrelationId类的典型用法代码示例。如果您正苦于以下问题:Java CorrelationId类的具体用法?Java CorrelationId怎么用?Java CorrelationId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CorrelationId类属于org.apache.calcite.rel.core包,在下文中一共展示了CorrelationId类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createCopyHook
import org.apache.calcite.rel.core.CorrelationId; //导入依赖的package包/类
private Function2<RelNode, RelNode, Void> createCopyHook() {
return new Function2<RelNode, RelNode, Void>() {
public Void apply(RelNode oldNode, RelNode newNode) {
if (cm.mapRefRelToCorVar.containsKey(oldNode)) {
cm.mapRefRelToCorVar.putAll(newNode, cm.mapRefRelToCorVar.get(oldNode));
}
if (oldNode instanceof LogicalCorrelate && newNode instanceof LogicalCorrelate) {
LogicalCorrelate oldCor = (LogicalCorrelate) oldNode;
CorrelationId c = oldCor.getCorrelationId();
if (cm.mapCorVarToCorRel.get(c) == oldNode) {
cm.mapCorVarToCorRel.put(c, newNode);
}
if (generatedCorRels.contains(oldNode)) {
generatedCorRels.add((LogicalCorrelate) newNode);
}
}
return null;
}
};
}
开发者ID:axbaretto,项目名称:flink,代码行数:22,代码来源:FlinkRelDecorrelator.java
示例2: LogicalCorrelate
import org.apache.calcite.rel.core.CorrelationId; //导入依赖的package包/类
/**
* Creates a LogicalCorrelate.
* @param cluster cluster this relational expression belongs to
* @param left left input relational expression
* @param right right input relational expression
* @param correlationId variable name for the row of left input
* @param requiredColumns Required columns
* @param joinType join type
*/
public LogicalCorrelate(
RelOptCluster cluster,
RelTraitSet traitSet,
RelNode left,
RelNode right,
CorrelationId correlationId,
ImmutableBitSet requiredColumns,
SemiJoinType joinType) {
super(
cluster,
traitSet,
left,
right,
correlationId,
requiredColumns,
joinType);
assert !CalcitePrepareImpl.DEBUG || isValid(Litmus.THROW, null);
}
开发者ID:apache,项目名称:calcite,代码行数:28,代码来源:LogicalCorrelate.java
示例3: create
import org.apache.calcite.rel.core.CorrelationId; //导入依赖的package包/类
/** Creates a LogicalFilter. */
public static LogicalFilter create(final RelNode input, RexNode condition,
ImmutableSet<CorrelationId> variablesSet) {
final RelOptCluster cluster = input.getCluster();
final RelMetadataQuery mq = cluster.getMetadataQuery();
final RelTraitSet traitSet = cluster.traitSetOf(Convention.NONE)
.replaceIfs(RelCollationTraitDef.INSTANCE,
new Supplier<List<RelCollation>>() {
public List<RelCollation> get() {
return RelMdCollation.filter(mq, input);
}
})
.replaceIf(RelDistributionTraitDef.INSTANCE,
new Supplier<RelDistribution>() {
public RelDistribution get() {
return RelMdDistribution.filter(mq, input);
}
});
return new LogicalFilter(cluster, traitSet, input, condition, variablesSet);
}
开发者ID:apache,项目名称:calcite,代码行数:21,代码来源:LogicalFilter.java
示例4: EnumerableJoin
import org.apache.calcite.rel.core.CorrelationId; //导入依赖的package包/类
/** Creates an EnumerableJoin.
*
* <p>Use {@link #create} unless you know what you're doing. */
protected EnumerableJoin(
RelOptCluster cluster,
RelTraitSet traits,
RelNode left,
RelNode right,
RexNode condition,
ImmutableIntList leftKeys,
ImmutableIntList rightKeys,
Set<CorrelationId> variablesSet,
JoinRelType joinType)
throws InvalidRelException {
super(
cluster,
traits,
left,
right,
condition,
leftKeys,
rightKeys,
variablesSet,
joinType);
}
开发者ID:apache,项目名称:calcite,代码行数:26,代码来源:EnumerableJoin.java
示例5: create
import org.apache.calcite.rel.core.CorrelationId; //导入依赖的package包/类
/** Creates an EnumerableJoin. */
public static EnumerableJoin create(
RelNode left,
RelNode right,
RexNode condition,
ImmutableIntList leftKeys,
ImmutableIntList rightKeys,
Set<CorrelationId> variablesSet,
JoinRelType joinType)
throws InvalidRelException {
final RelOptCluster cluster = left.getCluster();
final RelTraitSet traitSet =
cluster.traitSetOf(EnumerableConvention.INSTANCE);
return new EnumerableJoin(cluster, traitSet, left, right, condition,
leftKeys, rightKeys, variablesSet, joinType);
}
开发者ID:apache,项目名称:calcite,代码行数:17,代码来源:EnumerableJoin.java
示例6: EnumerableMergeJoin
import org.apache.calcite.rel.core.CorrelationId; //导入依赖的package包/类
EnumerableMergeJoin(
RelOptCluster cluster,
RelTraitSet traits,
RelNode left,
RelNode right,
RexNode condition,
ImmutableIntList leftKeys,
ImmutableIntList rightKeys,
Set<CorrelationId> variablesSet,
JoinRelType joinType)
throws InvalidRelException {
super(cluster, traits, left, right, condition, leftKeys, rightKeys,
variablesSet, joinType);
final List<RelCollation> collations =
traits.getTraits(RelCollationTraitDef.INSTANCE);
assert collations == null || RelCollations.contains(collations, leftKeys);
}
开发者ID:apache,项目名称:calcite,代码行数:18,代码来源:EnumerableMergeJoin.java
示例7: createCopyHook
import org.apache.calcite.rel.core.CorrelationId; //导入依赖的package包/类
private Function2<RelNode, RelNode, Void> createCopyHook() {
return new Function2<RelNode, RelNode, Void>() {
public Void apply(RelNode oldNode, RelNode newNode) {
if (cm.mapRefRelToCorRef.containsKey(oldNode)) {
cm.mapRefRelToCorRef.putAll(newNode,
cm.mapRefRelToCorRef.get(oldNode));
}
if (oldNode instanceof LogicalCorrelate
&& newNode instanceof LogicalCorrelate) {
LogicalCorrelate oldCor = (LogicalCorrelate) oldNode;
CorrelationId c = oldCor.getCorrelationId();
if (cm.mapCorToCorRel.get(c) == oldNode) {
cm.mapCorToCorRel.put(c, newNode);
}
if (generatedCorRels.contains(oldNode)) {
generatedCorRels.add((LogicalCorrelate) newNode);
}
}
return null;
}
};
}
开发者ID:apache,项目名称:calcite,代码行数:24,代码来源:RelDecorrelator.java
示例8: getVariablesSetAndUsed
import org.apache.calcite.rel.core.CorrelationId; //导入依赖的package包/类
@Deprecated // to be removed before 2.0
public static List<CorrelationId> getVariablesSetAndUsed(RelNode rel0,
RelNode rel1) {
Set<CorrelationId> set = getVariablesSet(rel0);
if (set.size() == 0) {
return ImmutableList.of();
}
Set<CorrelationId> used = getVariablesUsed(rel1);
if (used.size() == 0) {
return ImmutableList.of();
}
final List<CorrelationId> result = new ArrayList<>();
for (CorrelationId s : set) {
if (used.contains(s) && !result.contains(s)) {
result.add(s);
}
}
return result;
}
开发者ID:apache,项目名称:calcite,代码行数:20,代码来源:RelOptUtil.java
示例9: createJoin
import org.apache.calcite.rel.core.CorrelationId; //导入依赖的package包/类
@Override
public RelNode createJoin(RelNode left, RelNode right,
RexNode condition,
Set<CorrelationId> variablesSet,
JoinRelType joinType, boolean semiJoinDone) {
return new JoinRel(left.getCluster(), left.getTraitSet(), left, right, condition, joinType);
}
开发者ID:dremio,项目名称:dremio-oss,代码行数:8,代码来源:DremioRelFactories.java
示例10: isSubQueryNonCorrelated
import org.apache.calcite.rel.core.CorrelationId; //导入依赖的package包/类
/**
* Determines whether a sub-query is non-correlated. Note that a
* non-correlated sub-query can contain correlated references, provided those
* references do not reference select statements that are parents of the
* sub-query.
*
* @param subq the sub-query
* @param bb blackboard used while converting the sub-query, i.e., the
* blackboard of the parent query of this sub-query
* @return true if the sub-query is non-correlated
*/
private boolean isSubQueryNonCorrelated(RelNode subq, Blackboard bb) {
Set<CorrelationId> correlatedVariables = RelOptUtil.getVariablesUsed(subq);
for (CorrelationId correlName : correlatedVariables) {
DeferredLookup lookup = mapCorrelToDeferred.get(correlName);
String originalRelName = lookup.getOriginalRelName();
final SqlNameMatcher nameMatcher =
lookup.bb.scope.getValidator().getCatalogReader().nameMatcher();
final SqlValidatorScope.ResolvedImpl resolved =
new SqlValidatorScope.ResolvedImpl();
lookup.bb.scope.resolve(ImmutableList.of(originalRelName), nameMatcher,
false, resolved);
SqlValidatorScope ancestorScope = resolved.only().scope;
// If the correlated reference is in a scope that's "above" the
// sub-query, then this is a correlated sub-query.
SqlValidatorScope parentScope = bb.scope;
do {
if (ancestorScope == parentScope) {
return false;
}
if (parentScope instanceof DelegatingScope) {
parentScope = ((DelegatingScope) parentScope).getParent();
} else {
break;
}
} while (parentScope != null);
}
return true;
}
开发者ID:axbaretto,项目名称:flink,代码行数:43,代码来源:SqlToRelConverter.java
示例11: OLAPJoinRel
import org.apache.calcite.rel.core.CorrelationId; //导入依赖的package包/类
public OLAPJoinRel(RelOptCluster cluster, RelTraitSet traits, RelNode left, RelNode right, //
RexNode condition, ImmutableIntList leftKeys, ImmutableIntList rightKeys, //
Set<CorrelationId> variablesSet, JoinRelType joinType) throws InvalidRelException {
super(cluster, traits, left, right, condition, leftKeys, rightKeys, variablesSet, joinType);
Preconditions.checkArgument(getConvention() == OLAPRel.CONVENTION);
this.rowType = getRowType();
this.isTopJoin = false;
}
开发者ID:apache,项目名称:kylin,代码行数:9,代码来源:OLAPJoinRel.java
示例12: isSubQueryNonCorrelated
import org.apache.calcite.rel.core.CorrelationId; //导入依赖的package包/类
/**
* Determines whether a sub-query is non-correlated. Note that a
* non-correlated sub-query can contain correlated references, provided those
* references do not reference select statements that are parents of the
* sub-query.
*
* @param subq the sub-query
* @param bb blackboard used while converting the sub-query, i.e., the
* blackboard of the parent query of this sub-query
* @return true if the sub-query is non-correlated
*/
private boolean isSubQueryNonCorrelated(RelNode subq, Blackboard bb) {
Set<CorrelationId> correlatedVariables = RelOptUtil.getVariablesUsed(subq);
for (CorrelationId correlName : correlatedVariables) {
DeferredLookup lookup = mapCorrelToDeferred.get(correlName);
String originalRelName = lookup.getOriginalRelName();
final SqlNameMatcher nameMatcher =
lookup.bb.scope.getValidator().getCatalogReader().nameMatcher();
final SqlValidatorScope.ResolvedImpl resolved =
new SqlValidatorScope.ResolvedImpl();
lookup.bb.scope.resolve(ImmutableList.of(originalRelName), nameMatcher,
false, resolved);
SqlValidatorScope ancestorScope = resolved.only().scope;
// If the correlated reference is in a scope that's "above" the
// sub-query, then this is a correlated sub-query.
SqlValidatorScope parentScope = bb.scope;
do {
if (ancestorScope == parentScope) {
return false;
}
if (parentScope instanceof DelegatingScope) {
parentScope = ((DelegatingScope) parentScope).getParent();
} else {
break;
}
} while (parentScope != null);
}
return true;
}
开发者ID:apache,项目名称:kylin,代码行数:43,代码来源:SqlToRelConverter.java
示例13: MutableJoin
import org.apache.calcite.rel.core.CorrelationId; //导入依赖的package包/类
private MutableJoin(
RelDataType rowType,
MutableRel left,
MutableRel right,
RexNode condition,
JoinRelType joinType,
Set<CorrelationId> variablesSet) {
super(MutableRelType.JOIN, left.cluster, rowType, left, right);
this.condition = condition;
this.variablesSet = variablesSet;
this.joinType = joinType;
}
开发者ID:apache,项目名称:calcite,代码行数:13,代码来源:MutableJoin.java
示例14: MutableCorrelate
import org.apache.calcite.rel.core.CorrelationId; //导入依赖的package包/类
private MutableCorrelate(
RelDataType rowType,
MutableRel left,
MutableRel right,
CorrelationId correlationId,
ImmutableBitSet requiredColumns,
SemiJoinType joinType) {
super(MutableRelType.CORRELATE, left.cluster, rowType, left, right);
this.correlationId = correlationId;
this.requiredColumns = requiredColumns;
this.joinType = joinType;
}
开发者ID:apache,项目名称:calcite,代码行数:13,代码来源:MutableCorrelate.java
示例15: create
import org.apache.calcite.rel.core.CorrelationId; //导入依赖的package包/类
/** Creates a LogicalCorrelate. */
public static LogicalCorrelate create(RelNode left, RelNode right,
CorrelationId correlationId, ImmutableBitSet requiredColumns,
SemiJoinType joinType) {
final RelOptCluster cluster = left.getCluster();
final RelTraitSet traitSet = cluster.traitSetOf(Convention.NONE);
return new LogicalCorrelate(cluster, traitSet, left, right, correlationId,
requiredColumns, joinType);
}
开发者ID:apache,项目名称:calcite,代码行数:10,代码来源:LogicalCorrelate.java
示例16: copy
import org.apache.calcite.rel.core.CorrelationId; //导入依赖的package包/类
@Override public LogicalCorrelate copy(RelTraitSet traitSet,
RelNode left, RelNode right, CorrelationId correlationId,
ImmutableBitSet requiredColumns, SemiJoinType joinType) {
assert traitSet.containsIfApplicable(Convention.NONE);
return new LogicalCorrelate(getCluster(), traitSet, left, right,
correlationId, requiredColumns, joinType);
}
开发者ID:apache,项目名称:calcite,代码行数:8,代码来源:LogicalCorrelate.java
示例17: collectVariablesUsed
import org.apache.calcite.rel.core.CorrelationId; //导入依赖的package包/类
@Override public void collectVariablesUsed(Set<CorrelationId> variableSet) {
final RelOptUtil.VariableUsedVisitor vuv =
new RelOptUtil.VariableUsedVisitor(null);
for (RexNode expr : program.getExprList()) {
expr.accept(vuv);
}
variableSet.addAll(vuv.variables);
}
开发者ID:apache,项目名称:calcite,代码行数:9,代码来源:LogicalCalc.java
示例18: LogicalFilter
import org.apache.calcite.rel.core.CorrelationId; //导入依赖的package包/类
@Deprecated // to be removed before 2.0
public LogicalFilter(
RelOptCluster cluster,
RelTraitSet traitSet,
RelNode child,
RexNode condition) {
this(cluster, traitSet, child, condition, ImmutableSet.<CorrelationId>of());
}
开发者ID:apache,项目名称:calcite,代码行数:9,代码来源:LogicalFilter.java
示例19: LogicalJoin
import org.apache.calcite.rel.core.CorrelationId; //导入依赖的package包/类
@Deprecated // to be removed before 2.0
public LogicalJoin(RelOptCluster cluster, RelTraitSet traitSet, RelNode left,
RelNode right, RexNode condition, JoinRelType joinType,
Set<String> variablesStopped, boolean semiJoinDone,
ImmutableList<RelDataTypeField> systemFieldList) {
this(cluster, traitSet, left, right, condition,
CorrelationId.setOf(variablesStopped), joinType, semiJoinDone,
systemFieldList);
}
开发者ID:apache,项目名称:calcite,代码行数:10,代码来源:LogicalJoin.java
示例20: create
import org.apache.calcite.rel.core.CorrelationId; //导入依赖的package包/类
/** Creates a LogicalJoin, flagged with whether it has been translated to a
* semi-join. */
public static LogicalJoin create(RelNode left, RelNode right,
RexNode condition, Set<CorrelationId> variablesSet, JoinRelType joinType,
boolean semiJoinDone, ImmutableList<RelDataTypeField> systemFieldList) {
final RelOptCluster cluster = left.getCluster();
final RelTraitSet traitSet = cluster.traitSetOf(Convention.NONE);
return new LogicalJoin(cluster, traitSet, left, right, condition,
variablesSet, joinType, semiJoinDone, systemFieldList);
}
开发者ID:apache,项目名称:calcite,代码行数:11,代码来源:LogicalJoin.java
注:本文中的org.apache.calcite.rel.core.CorrelationId类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论