本文整理汇总了Java中org.apache.calcite.rex.RexNode.isAlwaysTrue方法的典型用法代码示例。如果您正苦于以下问题:Java RexNode.isAlwaysTrue方法的具体用法?Java RexNode.isAlwaysTrue怎么用?Java RexNode.isAlwaysTrue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.calcite.rex.RexNode
的用法示例。
在下文中一共展示了RexNode.isAlwaysTrue方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import org.apache.calcite.rex.RexNode; //导入方法依赖的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;
}
示例2: apply
import org.apache.calcite.rex.RexNode; //导入方法依赖的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();
}
示例3: getJoinCategory
import org.apache.calcite.rex.RexNode; //导入方法依赖的package包/类
public static JoinCategory getJoinCategory(RelNode left, RelNode right, RexNode condition,
List<Integer> leftKeys, List<Integer> rightKeys, List<Boolean> filterNulls) {
if (condition.isAlwaysTrue()) {
return JoinCategory.CARTESIAN;
}
leftKeys.clear();
rightKeys.clear();
filterNulls.clear();
RexNode remaining = RelOptUtil.splitJoinCondition(left, right, condition, leftKeys, rightKeys, filterNulls);
if (!remaining.isAlwaysTrue() || (leftKeys.size() == 0 || rightKeys.size() == 0) ) {
// for practical purposes these cases could be treated as inequality
return JoinCategory.INEQUALITY;
}
return JoinCategory.EQUALITY;
}
示例4: checkCartesianJoin
import org.apache.calcite.rex.RexNode; //导入方法依赖的package包/类
/**
* Check if the given RelNode contains any Cartesian join.
* Return true if find one. Otherwise, return false.
*
* @param relNode the RelNode to be inspected.
* @param leftKeys a list used for the left input into the join which has
* equi-join keys. It can be empty or not (but not null),
* this method will clear this list before using it.
* @param rightKeys a list used for the right input into the join which has
* equi-join keys. It can be empty or not (but not null),
* this method will clear this list before using it.
* @return Return true if the given relNode contains Cartesian join.
* Otherwise, return false
*/
public static boolean checkCartesianJoin(RelNode relNode, List<Integer> leftKeys, List<Integer> rightKeys) {
if (relNode instanceof Join) {
leftKeys.clear();
rightKeys.clear();
Join joinRel = (Join) relNode;
RelNode left = joinRel.getLeft();
RelNode right = joinRel.getRight();
RexNode remaining = RelOptUtil.splitJoinCondition(left, right, joinRel.getCondition(), leftKeys, rightKeys);
if(joinRel.getJoinType() == JoinRelType.INNER) {
if(leftKeys.isEmpty() || rightKeys.isEmpty()) {
return true;
}
} else {
if(!remaining.isAlwaysTrue() || leftKeys.isEmpty() || rightKeys.isEmpty()) {
return true;
}
}
}
for (RelNode child : relNode.getInputs()) {
if(checkCartesianJoin(child, leftKeys, rightKeys)) {
return true;
}
}
return false;
}
示例5: getJoinCategory
import org.apache.calcite.rex.RexNode; //导入方法依赖的package包/类
public static JoinCategory getJoinCategory(RelNode left, RelNode right, RexNode condition,
List<Integer> leftKeys, List<Integer> rightKeys) {
if (condition.isAlwaysTrue()) {
return JoinCategory.CARTESIAN;
}
leftKeys.clear();
rightKeys.clear();
RexNode remaining = RelOptUtil.splitJoinCondition(left, right, condition, leftKeys, rightKeys);
if (!remaining.isAlwaysTrue() || (leftKeys.size() == 0 || rightKeys.size() == 0) ) {
// for practical purposes these cases could be treated as inequality
return JoinCategory.INEQUALITY;
}
return JoinCategory.EQUALITY;
}
示例6: getDistinctRowCount
import org.apache.calcite.rex.RexNode; //导入方法依赖的package包/类
public Double getDistinctRowCount(Aggregate rel, RelMetadataQuery mq,
ImmutableBitSet groupKey, RexNode predicate) {
if (predicate == null || predicate.isAlwaysTrue()) {
if (groupKey.isEmpty()) {
return 1D;
}
}
final ImmutableBitSet allGroupSet = rel.getGroupSet().union(groupKey);
return getDistinctRowCountFromEstimateRowCount(rel.getInput(), mq, allGroupSet, predicate);
}
示例7: checkCartesianJoin
import org.apache.calcite.rex.RexNode; //导入方法依赖的package包/类
/**
* Check if the given RelNode contains any Cartesian join.
* Return true if find one. Otherwise, return false.
*
* @param relNode the RelNode to be inspected.
* @param leftKeys a list used for the left input into the join which has
* equi-join keys. It can be empty or not (but not null),
* this method will clear this list before using it.
* @param rightKeys a list used for the right input into the join which has
* equi-join keys. It can be empty or not (but not null),
* this method will clear this list before using it.
* @param filterNulls The join key positions for which null values will not
* match. null values only match for the "is not distinct
* from" condition.
* @return Return true if the given relNode contains Cartesian join.
* Otherwise, return false
*/
public static boolean checkCartesianJoin(RelNode relNode, List<Integer> leftKeys, List<Integer> rightKeys, List<Boolean> filterNulls) {
if (relNode instanceof Join) {
leftKeys.clear();
rightKeys.clear();
Join joinRel = (Join) relNode;
RelNode left = joinRel.getLeft();
RelNode right = joinRel.getRight();
RexNode remaining = RelOptUtil.splitJoinCondition(left, right, joinRel.getCondition(), leftKeys, rightKeys, filterNulls);
if(joinRel.getJoinType() == JoinRelType.INNER) {
if(leftKeys.isEmpty() || rightKeys.isEmpty()) {
return true;
}
} else {
if(!remaining.isAlwaysTrue() || leftKeys.isEmpty() || rightKeys.isEmpty()) {
return true;
}
}
}
for (RelNode child : relNode.getInputs()) {
if(checkCartesianJoin(child, leftKeys, rightKeys, filterNulls)) {
return true;
}
}
return false;
}