org.apache.calcite.rel.core.Filter.getCondition()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(132)

本文整理了Java中org.apache.calcite.rel.core.Filter.getCondition()方法的一些代码示例,展示了Filter.getCondition()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Filter.getCondition()方法的具体详情如下:
包路径:org.apache.calcite.rel.core.Filter
类名称:Filter
方法名:getCondition

Filter.getCondition介绍

暂无

代码示例

代码示例来源:origin: apache/drill

public boolean apply(Filter input) {
  return input.getCondition() instanceof RexInputRef;
 }
};

代码示例来源:origin: apache/drill

private boolean isSimple(Filter filter, RelMetadataQuery mq) {
 ImmutableBitSet condBits = RelOptUtil.InputFinder.bits(filter.getCondition());
 return isKey(condBits, filter, mq);
}

代码示例来源:origin: apache/hive

@Override
public boolean matches(RelOptRuleCall call) {
 Filter filter = call.rel(0);
 if (!HiveCalciteUtil.isDeterministic(filter.getCondition())) {
  return false;
 }
 return true;
}

代码示例来源:origin: apache/drill

@Override
public boolean matches(RelOptRuleCall call) {
 Filter filter = call.rel(0);
 if (!HiveCalciteUtil.isDeterministic(filter.getCondition())) {
  return false;
 }
 return true;
}

代码示例来源:origin: apache/incubator-druid

@Nullable
private static DimFilter computeWhereFilter(
  final PartialDruidQuery partialQuery,
  final RowSignature sourceRowSignature,
  final PlannerContext plannerContext
)
{
 final Filter whereFilter = partialQuery.getWhereFilter();
 if (whereFilter == null) {
  return null;
 }
 final RexNode condition = whereFilter.getCondition();
 final DimFilter dimFilter = Expressions.toFilter(
   plannerContext,
   sourceRowSignature,
   condition
 );
 if (dimFilter == null) {
  throw new CannotBuildQueryException(whereFilter, condition);
 } else {
  return dimFilter;
 }
}

代码示例来源:origin: apache/incubator-druid

@Nullable
private static DimFilter computeHavingFilter(
  final PartialDruidQuery partialQuery,
  final RowSignature outputRowSignature,
  final PlannerContext plannerContext
)
{
 final Filter havingFilter = partialQuery.getHavingFilter();
 if (havingFilter == null) {
  return null;
 }
 final RexNode condition = havingFilter.getCondition();
 final DimFilter dimFilter = Expressions.toFilter(
   plannerContext,
   outputRowSignature,
   condition
 );
 if (dimFilter == null) {
  throw new CannotBuildQueryException(havingFilter, condition);
 } else {
  return dimFilter;
 }
}

代码示例来源:origin: apache/hive

@Override
public boolean matches(RelOptRuleCall call) {
 final Filter filterRel = call.rel(1);
 RexNode condition = filterRel.getCondition();
 if (!HiveCalciteUtil.isDeterministic(condition)) {
  return false;
 }
 return super.matches(call);
}

代码示例来源:origin: apache/hive

@Override
 public boolean matches(RelOptRuleCall call) {
  final Filter filterRel = call.rel(0);
  RexNode condition = filterRel.getCondition();
  if (!HiveCalciteUtil.isDeterministic(condition)) {
   return false;
  }

  return super.matches(call);
 }
}

代码示例来源:origin: apache/hive

@Override
public boolean matches(RelOptRuleCall call) {
 Filter filterRel = call.rel(0);
 RexNode condition = filterRel.getCondition();
 if (!HiveCalciteUtil.isDeterministic(condition)) {
  return false;
 }
 return super.matches(call);
}

代码示例来源:origin: apache/drill

@Override
public boolean matches(RelOptRuleCall call) {
 final Filter filterRel = call.rel(0);
 RexNode condition = filterRel.getCondition();
 if (this.onlyDeterministic && !HiveCalciteUtil.isDeterministic(condition)) {
  return false;
 }
 return super.matches(call);
}

代码示例来源:origin: apache/drill

@Override
public boolean matches(RelOptRuleCall call) {
 final Filter filterRel = call.rel(1);
 RexNode condition = filterRel.getCondition();
 if (!HiveCalciteUtil.isDeterministic(condition)) {
  return false;
 }
 return super.matches(call);
}

代码示例来源:origin: apache/drill

@Override
 public boolean matches(RelOptRuleCall call) {
  final Filter filterRel = call.rel(0);
  RexNode condition = filterRel.getCondition();
  if (!HiveCalciteUtil.isDeterministic(condition)) {
   return false;
  }

  return super.matches(call);
 }
}

代码示例来源:origin: apache/drill

@Override
 public boolean matches(RelOptRuleCall call) {
  Filter filterRel = call.rel(0);
  RexNode condition = filterRel.getCondition();
  if (!HiveCalciteUtil.isDeterministic(condition)) {
   return false;
  }

  return super.matches(call);
 }
}

代码示例来源:origin: apache/hive

@Override
public boolean matches(RelOptRuleCall call) {
 final Filter filterRel = call.rel(0);
 // The condition fetched here can reference a udf that is not deterministic, but defined
 // as part of the select list when a view is in play.  But the condition after the pushdown
 // will resolve to using the udf from select list.  The check here for deterministic filters
 // should be based on the resolved expression.  Refer to test case cbo_ppd_non_deterministic.q.
 RexNode condition = RelOptUtil.pushPastProject(filterRel.getCondition(), call.rel(1));
 if (this.onlyDeterministic && !HiveCalciteUtil.isDeterministic(condition)) {
  return false;
 }
 return super.matches(call);
}

代码示例来源:origin: apache/drill

protected void perform(RelOptRuleCall call, Filter filter,
   HiveTableScan tScan) {

  RelOptHiveTable hiveTable = (RelOptHiveTable) tScan.getTable();
  RexNode predicate = filter.getCondition();

  Pair<RexNode, RexNode> predicates = PartitionPrune
    .extractPartitionPredicates(filter.getCluster(), hiveTable, predicate);
  RexNode partColExpr = predicates.left;
  hiveTable.computePartitionList(conf, partColExpr, tScan.getPartOrVirtualCols());
 }
}

代码示例来源:origin: apache/storm

@Override
  public RelNode convert(RelNode rel) {
    final Filter filter = (Filter) rel;
    final RelNode input = filter.getInput();

    return new StreamsFilterRel(filter.getCluster(),
                  filter.getTraitSet().replace(StreamsLogicalConvention.INSTANCE),
                  convert(input, input.getTraitSet().replace(StreamsLogicalConvention.INSTANCE)),
                  filter.getCondition());
  }
}

代码示例来源:origin: apache/hive

@Override
 public void onMatch(RelOptRuleCall call) {
  final Filter filter = call.rel(0);
  final RexBuilder rexBuilder = filter.getCluster().getRexBuilder();
  final RexNode condition = RexUtil.pullFactors(rexBuilder, filter.getCondition());
  RexNode newCondition = analyzeRexNode(rexBuilder, condition);
  // If we could not transform anything, we bail out
  if (newCondition.toString().equals(condition.toString())) {
   return;
  }
  RelNode newNode = filter.copy(filter.getTraitSet(), filter.getInput(), newCondition);
  call.transformTo(newNode);
 }
}

代码示例来源:origin: apache/hive

@Override
public boolean matches(RelOptRuleCall call) {
 Filter filter = call.rel(0);
 Join   join = call.rel(1);
 HiveJdbcConverter   conv1 = call.rel(2);
 HiveJdbcConverter   conv2 = call.rel(3);
 if (!conv1.getJdbcDialect().equals(conv2.getJdbcDialect())) {
  return false;
 }
 boolean visitorRes = JDBCRexCallValidator.isValidJdbcOperation(filter.getCondition(), conv1.getJdbcDialect());
 if (visitorRes) {
  return JDBCRexCallValidator.isValidJdbcOperation(join.getCondition(), conv1.getJdbcDialect());
 }
 return false;
}

代码示例来源:origin: apache/hive

public void onMatch(RelOptRuleCall call) {
 final Project project = call.rel(0);
 final Filter filter = call.rel(1);
 final RelBuilder builder = call.builder();
 List<RexNode> projects = project.getChildExps();
 List<RexNode> newProjects = rewriteProjects(projects, filter.getCondition(), builder);
 if (newProjects == null) {
  return;
 }
 RelNode newProjRel = builder.push(filter)
     .project(newProjects, project.getRowType().getFieldNames()).build();
 call.transformTo(newProjRel);
}

代码示例来源:origin: apache/drill

public void onMatch(RelOptRuleCall call) {
 final Project project = call.rel(0);
 final Filter filter = call.rel(1);
 final RelBuilder builder = call.builder();
 List<RexNode> projects = project.getChildExps();
 List<RexNode> newProjects = rewriteProjects(projects, filter.getCondition(), builder);
 if (newProjects == null) {
  return;
 }
 RelNode newProjRel = builder.push(filter)
     .project(newProjects, project.getRowType().getFieldNames()).build();
 call.transformTo(newProjRel);
}

相关文章