本文整理汇总了Java中org.apache.calcite.rel.core.JoinRelType类的典型用法代码示例。如果您正苦于以下问题:Java JoinRelType类的具体用法?Java JoinRelType怎么用?Java JoinRelType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JoinRelType类属于org.apache.calcite.rel.core包,在下文中一共展示了JoinRelType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: apply
import org.apache.calcite.rel.core.JoinRelType; //导入依赖的package包/类
public boolean apply(Join join, JoinRelType joinType, RexNode exp) {
if (joinType != JoinRelType.INNER) {
return true; // In OUTER join, we could not pull-up the filter.
// All we can do is keep the filter with JOIN, and
// then decide whether the filter could be pushed down
// into LEFT/RIGHT.
}
List<RexNode> tmpLeftKeys = Lists.newArrayList();
List<RexNode> tmpRightKeys = Lists.newArrayList();
List<RelDataTypeField> sysFields = Lists.newArrayList();
RexNode remaining = RelOptUtil.splitJoinCondition(sysFields, join.getLeft(), join.getRight(), exp, tmpLeftKeys, tmpRightKeys, null, null);
if (remaining.isAlwaysTrue()) {
return true;
}
return false;
}
开发者ID:skhalifa,项目名称:QDrill,代码行数:21,代码来源:DrillFilterJoinRules.java
示例2: setupHashJoinProbe
import org.apache.calcite.rel.core.JoinRelType; //导入依赖的package包/类
@Override
public void setupHashJoinProbe(FragmentContext context, VectorContainer buildBatch, RecordBatch probeBatch,
int probeRecordCount, HashJoinBatch outgoing, HashTable hashTable,
HashJoinHelper hjHelper, JoinRelType joinRelType) {
this.probeBatch = probeBatch;
this.probeSchema = probeBatch.getSchema();
this.buildBatch = buildBatch;
this.joinType = joinRelType;
this.recordsToProcess = probeRecordCount;
this.hashTable = hashTable;
this.hjHelper = hjHelper;
this.outgoingJoinBatch = outgoing;
doSetup(context, buildBatch, probeBatch, outgoing);
}
开发者ID:skhalifa,项目名称:QDrill,代码行数:17,代码来源:HashJoinProbeTemplate.java
示例3: getOutcome
import org.apache.calcite.rel.core.JoinRelType; //导入依赖的package包/类
public JoinOutcome getOutcome() {
if (!ok) {
return JoinOutcome.FAILURE;
}
if (bothMatches(IterOutcome.NONE) ||
(joinType == JoinRelType.INNER && eitherMatches(IterOutcome.NONE)) ||
(joinType == JoinRelType.LEFT && lastLeft == IterOutcome.NONE) ||
(joinType == JoinRelType.RIGHT && lastRight == IterOutcome.NONE)) {
return JoinOutcome.NO_MORE_DATA;
}
if (bothMatches(IterOutcome.OK) ||
(eitherMatches(IterOutcome.NONE) && eitherMatches(IterOutcome.OK))) {
return JoinOutcome.BATCH_RETURNED;
}
if (eitherMatches(IterOutcome.OK_NEW_SCHEMA)) {
return JoinOutcome.SCHEMA_CHANGED;
}
if (eitherMatches(IterOutcome.NOT_YET)) {
return JoinOutcome.WAITING;
}
return JoinOutcome.FAILURE;
}
开发者ID:skhalifa,项目名称:QDrill,代码行数:23,代码来源:JoinStatus.java
示例4: apply
import org.apache.calcite.rel.core.JoinRelType; //导入依赖的package包/类
public boolean apply(Join join, JoinRelType joinType, RexNode exp) {
if (joinType != JoinRelType.INNER) {
return true; // In OUTER join, we could not pull-up the filter.
// All we can do is keep the filter with JOIN, and
// then decide whether the filter could be pushed down
// into LEFT/RIGHT.
}
List<RexNode> tmpLeftKeys = Lists.newArrayList();
List<RexNode> tmpRightKeys = Lists.newArrayList();
List<RelDataTypeField> sysFields = Lists.newArrayList();
List<Integer> filterNulls = Lists.newArrayList();
RexNode remaining = RelOptUtil.splitJoinCondition(sysFields, join.getLeft(), join.getRight(),
exp, tmpLeftKeys, tmpRightKeys, filterNulls, null);
return remaining.isAlwaysTrue();
}
开发者ID:dremio,项目名称:dremio-oss,代码行数:19,代码来源:FilterJoinRulesUtil.java
示例5: checkPreconditions
import org.apache.calcite.rel.core.JoinRelType; //导入依赖的package包/类
@Override
protected boolean checkPreconditions(JoinRel join, RelNode left, RelNode right,
PlannerSettings settings) {
JoinRelType type = join.getJoinType();
if (! (type == JoinRelType.INNER || type == JoinRelType.LEFT)) {
return false;
}
JoinCategory category = JoinUtils.getJoinCategory(left, right, join.getCondition(),
Lists.<Integer>newArrayList(), Lists.<Integer>newArrayList(), Lists.<Boolean>newArrayList());
if (category == JoinCategory.EQUALITY
&& (settings.isHashJoinEnabled() || settings.isMergeJoinEnabled())) {
return false;
}
if (settings.isNlJoinForScalarOnly()) {
if (JoinUtils.isScalarSubquery(left) || JoinUtils.isScalarSubquery(right)) {
return true;
} else {
return false;
}
}
return true;
}
开发者ID:dremio,项目名称:dremio-oss,代码行数:27,代码来源:NestedLoopJoinPrule.java
示例6: noMoreToConsumeRight
import org.apache.calcite.rel.core.JoinRelType; //导入依赖的package包/类
@Override
public void noMoreToConsumeRight() throws Exception {
state.is(State.CAN_CONSUME_R);
if (table.size() == 0 && !(joinType == JoinRelType.LEFT || joinType == JoinRelType.FULL)) {
// nothing needs to be read on the left side as right side is empty
state = State.DONE;
return;
}
this.probe = new VectorizedProbe(
context.getAllocator(),
hyperContainer,
left,
probeOutputs,
buildOutputs,
config.getJoinType(),
buildInfoList,
startIndices,
table,
probePivot,
context.getTargetBatchSize(),
comparator);
state = State.CAN_CONSUME_L;
}
开发者ID:dremio,项目名称:dremio-oss,代码行数:26,代码来源:VectorizedHashJoinOperator.java
示例7: emptyRightWithLeftJoin
import org.apache.calcite.rel.core.JoinRelType; //导入依赖的package包/类
@Test
public void emptyRightWithLeftJoin() throws Exception {
JoinInfo joinInfo = getJoinInfo(Arrays.asList(new JoinCondition("EQUALS", f("r_regionKey"), f("key"))),
JoinRelType.LEFT);
final Table expected = t(
th("key", "value", "r_regionKey"),
false,
tr(NULL_BIGINT, NULL_BIGINT, 0L),
tr(NULL_BIGINT, NULL_BIGINT, 1L),
tr(NULL_BIGINT, NULL_BIGINT, 2L),
tr(NULL_BIGINT, NULL_BIGINT, 3L),
tr(NULL_BIGINT, NULL_BIGINT, 4L)
);
validateDual(joinInfo.operator, joinInfo.clazz,
TpchGenerator.singleGenerator(TpchTable.REGION, 0.1, getTestAllocator(), "r_regionKey"),
new EmptyGenerator(getTestAllocator()), DEFAULT_BATCH, expected);
}
开发者ID:dremio,项目名称:dremio-oss,代码行数:21,代码来源:BaseTestJoin.java
示例8: nationRegionPartialKeyRight
import org.apache.calcite.rel.core.JoinRelType; //导入依赖的package包/类
@Test
public void nationRegionPartialKeyRight() throws Exception {
JoinInfo info = getJoinInfo( Arrays.asList(new JoinCondition("EQUALS", f("n_nationKey"), f("r_regionKey"))), JoinRelType.RIGHT);
final Table expected = t(
th("r_regionKey", "r_name", "n_nationKey", "n_name"),
tr(0L, "AFRICA", 0L, "ALGERIA"),
tr(1L, "AMERICA", 1L, "ARGENTINA"),
tr(2L, "ASIA", 2L, "BRAZIL"),
tr(3L, "EUROPE", 3L, "CANADA"),
tr(4L, "MIDDLE EAST", 4L, "EGYPT")
);
validateDual(
info.operator, info.clazz,
TpchGenerator.singleGenerator(TpchTable.NATION, 0.1, getTestAllocator(), "n_nationKey", "n_name"),
TpchGenerator.singleGenerator(TpchTable.REGION, 0.1, getTestAllocator(), "r_regionKey", "r_name"),
DEFAULT_BATCH, expected);
}
开发者ID:dremio,项目名称:dremio-oss,代码行数:20,代码来源:BaseTestJoin.java
示例9: DrillJoinRel
import org.apache.calcite.rel.core.JoinRelType; //导入依赖的package包/类
/** Creates a DrillJoinRel.
* We do not throw InvalidRelException in Logical planning phase. It's up to the post-logical planning check or physical planning
* to detect the unsupported join type, and throw exception.
* */
public DrillJoinRel(RelOptCluster cluster, RelTraitSet traits, RelNode left, RelNode right, RexNode condition,
JoinRelType joinType) {
super(cluster, traits, left, right, condition, joinType);
assert traits.contains(DrillRel.DRILL_LOGICAL);
RelOptUtil.splitJoinCondition(left, right, condition, leftKeys, rightKeys);
}
开发者ID:skhalifa,项目名称:QDrill,代码行数:11,代码来源:DrillJoinRel.java
示例10: copy
import org.apache.calcite.rel.core.JoinRelType; //导入依赖的package包/类
@Override
public Join copy(RelTraitSet traitSet, RexNode conditionExpr, RelNode left, RelNode right, JoinRelType joinType, boolean semiJoinDone) {
try {
return new NestedLoopJoinPrel(this.getCluster(), traitSet, left, right, conditionExpr, joinType);
}catch (InvalidRelException e) {
throw new AssertionError(e);
}
}
开发者ID:skhalifa,项目名称:QDrill,代码行数:9,代码来源:NestedLoopJoinPrel.java
示例11: checkPreconditions
import org.apache.calcite.rel.core.JoinRelType; //导入依赖的package包/类
@Override
protected boolean checkPreconditions(DrillJoinRel join, RelNode left, RelNode right,
PlannerSettings settings) {
JoinRelType type = join.getJoinType();
if (! (type == JoinRelType.INNER || type == JoinRelType.LEFT)) {
return false;
}
List<Integer> leftKeys = Lists.newArrayList();
List<Integer> rightKeys = Lists.newArrayList() ;
JoinCategory category = JoinUtils.getJoinCategory(left, right, join.getCondition(), leftKeys, rightKeys);
if (category == JoinCategory.EQUALITY
&& (settings.isHashJoinEnabled() || settings.isMergeJoinEnabled())) {
return false;
}
if (settings.isNlJoinForScalarOnly()) {
if (JoinUtils.isScalarSubquery(left) || JoinUtils.isScalarSubquery(right)) {
return true;
} else {
return false;
}
}
return true;
}
开发者ID:skhalifa,项目名称:QDrill,代码行数:28,代码来源:NestedLoopJoinPrule.java
示例12: checkBroadcastConditions
import org.apache.calcite.rel.core.JoinRelType; //导入依赖的package包/类
protected boolean checkBroadcastConditions(RelOptPlanner planner, DrillJoinRel join, RelNode left, RelNode right) {
double estimatedRightRowCount = RelMetadataQuery.getRowCount(right);
if (estimatedRightRowCount < PrelUtil.getSettings(join.getCluster()).getBroadcastThreshold()
&& ! left.getTraitSet().getTrait(DrillDistributionTraitDef.INSTANCE).equals(DrillDistributionTrait.SINGLETON)
&& (join.getJoinType() == JoinRelType.INNER || join.getJoinType() == JoinRelType.LEFT)
) {
return true;
}
return false;
}
开发者ID:skhalifa,项目名称:QDrill,代码行数:12,代码来源:JoinPruleBase.java
示例13: testFullJoin
import org.apache.calcite.rel.core.JoinRelType; //导入依赖的package包/类
@Test
public void testFullJoin() throws Exception {
Join join = JdbcAssert
.withModel(MODEL, "HR")
.sql("select * from emp full join dept on emp.deptId = dept.deptId")
.returnsUnordered("DEPTID=31; LASTNAME=Rafferty; DEPTID0=31; NAME=Sales",
"DEPTID=33; LASTNAME=Jones; DEPTID0=33; NAME=Engineering",
"DEPTID=33; LASTNAME=Steinberg; DEPTID0=33; NAME=Engineering",
"DEPTID=34; LASTNAME=Robinson; DEPTID0=34; NAME=Clerical",
"DEPTID=34; LASTNAME=Smith; DEPTID0=34; NAME=Clerical",
"DEPTID=null; LASTNAME=John; DEPTID0=null; NAME=null",
"DEPTID=null; LASTNAME=null; DEPTID0=35; NAME=Marketing").planContains(Join.class);
Assert.assertEquals(JoinRelType.FULL, join.getJoinType());
}
开发者ID:dremio,项目名称:dremio-oss,代码行数:15,代码来源:JdbcDataTest.java
示例14: copy
import org.apache.calcite.rel.core.JoinRelType; //导入依赖的package包/类
@Override
public Join copy(RelTraitSet traitSet, RexNode conditionExpr, RelNode left, RelNode right, JoinRelType joinType, boolean semiJoinDone) {
try {
return new HashJoinPrel(this.getCluster(), traitSet, left, right, conditionExpr, joinType, this.swapped);
}catch (InvalidRelException e) {
throw new AssertionError(e);
}
}
开发者ID:skhalifa,项目名称:QDrill,代码行数:9,代码来源:HashJoinPrel.java
示例15: copy
import org.apache.calcite.rel.core.JoinRelType; //导入依赖的package包/类
@Override
public Join copy(RelTraitSet traitSet, RexNode conditionExpr, RelNode left, RelNode right, JoinRelType joinType, boolean semiJoinDone) {
try {
return new MergeJoinPrel(this.getCluster(), traitSet, left, right, conditionExpr, joinType);
}catch (InvalidRelException e) {
throw new AssertionError(e);
}
}
开发者ID:skhalifa,项目名称:QDrill,代码行数:9,代码来源:MergeJoinPrel.java
示例16: HashJoinPOP
import org.apache.calcite.rel.core.JoinRelType; //导入依赖的package包/类
@JsonCreator
public HashJoinPOP(
@JsonProperty("left") PhysicalOperator left,
@JsonProperty("right") PhysicalOperator right,
@JsonProperty("conditions") List<JoinCondition> conditions,
@JsonProperty("joinType") JoinRelType joinType
) {
this.left = left;
this.right = right;
this.conditions = conditions;
Preconditions.checkArgument(joinType != null, "Join type is missing!");
this.joinType = joinType;
}
开发者ID:skhalifa,项目名称:QDrill,代码行数:14,代码来源:HashJoinPOP.java
示例17: flipIfRight
import org.apache.calcite.rel.core.JoinRelType; //导入依赖的package包/类
public HashJoinPOP flipIfRight(){
if(joinType == JoinRelType.RIGHT){
List<JoinCondition> flippedConditions = Lists.newArrayList();
for(JoinCondition c : conditions){
flippedConditions.add(c.flip());
}
return new HashJoinPOP(right, left, flippedConditions, JoinRelType.LEFT);
}else{
return this;
}
}
开发者ID:skhalifa,项目名称:QDrill,代码行数:12,代码来源:HashJoinPOP.java
示例18: NestedLoopJoinPOP
import org.apache.calcite.rel.core.JoinRelType; //导入依赖的package包/类
@JsonCreator
public NestedLoopJoinPOP(
@JsonProperty("left") PhysicalOperator left,
@JsonProperty("right") PhysicalOperator right,
@JsonProperty("conditions") List<JoinCondition> conditions,
@JsonProperty("joinType") JoinRelType joinType
) {
this.left = left;
this.right = right;
this.conditions = conditions;
Preconditions.checkArgument(joinType != null, "Join type is missing!");
this.joinType = joinType;
}
开发者ID:skhalifa,项目名称:QDrill,代码行数:14,代码来源:NestedLoopJoinPOP.java
示例19: MergeJoinPOP
import org.apache.calcite.rel.core.JoinRelType; //导入依赖的package包/类
@JsonCreator
public MergeJoinPOP(
@JsonProperty("left") PhysicalOperator left,
@JsonProperty("right") PhysicalOperator right,
@JsonProperty("conditions") List<JoinCondition> conditions,
@JsonProperty("joinType") JoinRelType joinType
) {
this.left = left;
this.right = right;
this.conditions = conditions;
Preconditions.checkArgument(joinType != null, "Join type is missing!");
this.joinType = joinType;
Preconditions.checkArgument(joinType != JoinRelType.FULL, "Full outer join not currently supported");
}
开发者ID:skhalifa,项目名称:QDrill,代码行数:15,代码来源:MergeJoinPOP.java
示例20: flipIfRight
import org.apache.calcite.rel.core.JoinRelType; //导入依赖的package包/类
public MergeJoinPOP flipIfRight(){
if(joinType == JoinRelType.RIGHT){
List<JoinCondition> flippedConditions = Lists.newArrayList();
for(JoinCondition c : conditions){
flippedConditions.add(c.flip());
}
return new MergeJoinPOP(right, left, flippedConditions, JoinRelType.LEFT);
}else{
return this;
}
}
开发者ID:skhalifa,项目名称:QDrill,代码行数:13,代码来源:MergeJoinPOP.java
注:本文中的org.apache.calcite.rel.core.JoinRelType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论