当前位置: 首页>>代码示例>>Java>>正文


Java LogicalFilter.getCondition方法代码示例

本文整理汇总了Java中org.apache.calcite.rel.logical.LogicalFilter.getCondition方法的典型用法代码示例。如果您正苦于以下问题:Java LogicalFilter.getCondition方法的具体用法?Java LogicalFilter.getCondition怎么用?Java LogicalFilter.getCondition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.calcite.rel.logical.LogicalFilter的用法示例。


在下文中一共展示了LogicalFilter.getCondition方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onMatch

import org.apache.calcite.rel.logical.LogicalFilter; //导入方法依赖的package包/类
public void onMatch(RelOptRuleCall call) {
  LogicalFilter filter = call.rel(0);
  MultiJoin multiJoin = call.rel(1);

  MultiJoin newMultiJoin =
      new MultiJoin(
          multiJoin.getCluster(),
          multiJoin.getInputs(),
          multiJoin.getJoinFilter(),
          multiJoin.getRowType(),
          multiJoin.isFullOuterJoin(),
          multiJoin.getOuterJoinConditions(),
          multiJoin.getJoinTypes(),
          multiJoin.getProjFields(),
          multiJoin.getJoinFieldRefCountsMap(),
          filter.getCondition());

  call.transformTo(newMultiJoin);
}
 
开发者ID:apache,项目名称:calcite,代码行数:20,代码来源:FilterMultiJoinMergeRule.java

示例2: convert

import org.apache.calcite.rel.logical.LogicalFilter; //导入方法依赖的package包/类
public RelNode convert(RelNode rel) {
    final LogicalFilter filter = (LogicalFilter) rel;

    return new JdbcFilter(
            rel.getCluster(),
            rel.getTraitSet().replace(getOut()),
            convert(filter.getInput(),
                    filter.getInput().getTraitSet().replace(getOut())),
            filter.getCondition());
}
 
开发者ID:bitnine-oss,项目名称:octopus,代码行数:11,代码来源:JdbcRules.java

示例3: convert

import org.apache.calcite.rel.logical.LogicalFilter; //导入方法依赖的package包/类
public RelNode convert(RelNode rel) {
    final LogicalFilter filter = (LogicalFilter) rel;
    final RelTraitSet traitSet = filter.getTraitSet().replace(out);
    return new GremlinFilter(
            rel.getCluster(),
            traitSet,
            convert(filter.getInput(), out),
            filter.getCondition());
}
 
开发者ID:twilmes,项目名称:sql-gremlin,代码行数:10,代码来源:GremlinRules.java

示例4: onMatch

import org.apache.calcite.rel.logical.LogicalFilter; //导入方法依赖的package包/类
@Override
public void onMatch(RelOptRuleCall call) {
    LogicalFilter filter = call.rel(0);

    RelTraitSet origTraitSet = filter.getTraitSet();
    RelTraitSet traitSet = origTraitSet.replace(OLAPRel.CONVENTION).simplify();

    OLAPFilterRel olapFilter = new OLAPFilterRel(filter.getCluster(), traitSet, convert(filter.getInput(), traitSet), filter.getCondition());
    call.transformTo(olapFilter);
}
 
开发者ID:apache,项目名称:kylin,代码行数:11,代码来源:OLAPFilterRule.java

示例5: matches

import org.apache.calcite.rel.logical.LogicalFilter; //导入方法依赖的package包/类
@Override public boolean matches(RelOptRuleCall call) {
  // Get the condition from the filter operation
  LogicalFilter filter = call.rel(0);
  RexNode condition = filter.getCondition();

  // Get field names from the scan operation
  CassandraTableScan scan = call.rel(1);
  Pair<List<String>, List<String>> keyFields = scan.cassandraTable.getKeyFields();
  Set<String> partitionKeys = new HashSet<String>(keyFields.left);
  List<String> fieldNames = CassandraRules.cassandraFieldNames(filter.getInput().getRowType());

  List<RexNode> disjunctions = RelOptUtil.disjunctions(condition);
  if (disjunctions.size() != 1) {
    return false;
  } else {
    // Check that all conjunctions are primary key equalities
    condition = disjunctions.get(0);
    for (RexNode predicate : RelOptUtil.conjunctions(condition)) {
      if (!isEqualityOnKey(predicate, fieldNames, partitionKeys, keyFields.right)) {
        return false;
      }
    }
  }

  // Either all of the partition keys must be specified or none
  return partitionKeys.size() == keyFields.left.size() || partitionKeys.size() == 0;
}
 
开发者ID:apache,项目名称:calcite,代码行数:28,代码来源:CassandraRules.java

示例6: convert

import org.apache.calcite.rel.logical.LogicalFilter; //导入方法依赖的package包/类
public RelNode convert(LogicalFilter filter, CassandraTableScan scan) {
  final RelTraitSet traitSet = filter.getTraitSet().replace(CassandraRel.CONVENTION);
  final Pair<List<String>, List<String>> keyFields = scan.cassandraTable.getKeyFields();
  return new CassandraFilter(
      filter.getCluster(),
      traitSet,
      convert(filter.getInput(), CassandraRel.CONVENTION),
      filter.getCondition(),
      keyFields.left,
      keyFields.right,
      scan.cassandraTable.getClusteringOrder());
}
 
开发者ID:apache,项目名称:calcite,代码行数:13,代码来源:CassandraRules.java

示例7: convert

import org.apache.calcite.rel.logical.LogicalFilter; //导入方法依赖的package包/类
public RelNode convert(RelNode rel) {
  final LogicalFilter filter = (LogicalFilter) rel;
  final RelTraitSet traitSet = filter.getTraitSet().replace(out);
  return new MongoFilter(
      rel.getCluster(),
      traitSet,
      convert(filter.getInput(), out),
      filter.getCondition());
}
 
开发者ID:apache,项目名称:calcite,代码行数:10,代码来源:MongoRules.java

示例8: onMatch

import org.apache.calcite.rel.logical.LogicalFilter; //导入方法依赖的package包/类
public void onMatch(RelOptRuleCall call) {
  LogicalFilter oldFilter = call.rel(0);
  RexNode oldFilterCond = oldFilter.getCondition();

  if (RexUtil.findOperatorCall(
      SqlStdOperatorTable.IS_NOT_DISTINCT_FROM,
      oldFilterCond)
      == null) {
    // no longer contains isNotDistinctFromOperator
    return;
  }

  // Now replace all the "a isNotDistinctFrom b"
  // with the RexNode given by RelOptUtil.isDistinctFrom() method

  RemoveIsNotDistinctFromRexShuttle rewriteShuttle =
      new RemoveIsNotDistinctFromRexShuttle(
          oldFilter.getCluster().getRexBuilder());

  final RelFactories.FilterFactory factory =
      RelFactories.DEFAULT_FILTER_FACTORY;
  RelNode newFilterRel =
      factory.createFilter(oldFilter.getInput(),
          oldFilterCond.accept(rewriteShuttle));

  call.transformTo(newFilterRel);
}
 
开发者ID:apache,项目名称:calcite,代码行数:28,代码来源:FilterRemoveIsNotDistinctFromRule.java

示例9: convert

import org.apache.calcite.rel.logical.LogicalFilter; //导入方法依赖的package包/类
public RelNode convert(RelNode rel) {
  final LogicalFilter filter = (LogicalFilter) rel;

  return new JdbcFilter(
      rel.getCluster(),
      rel.getTraitSet().replace(out),
      convert(filter.getInput(),
          filter.getInput().getTraitSet().replace(out)),
      filter.getCondition());
}
 
开发者ID:apache,项目名称:calcite,代码行数:11,代码来源:JdbcRules.java

示例10: convert

import org.apache.calcite.rel.logical.LogicalFilter; //导入方法依赖的package包/类
@Override public RelNode convert(RelNode relNode) {
  final LogicalFilter filter = (LogicalFilter) relNode;
  final RelTraitSet traitSet = filter.getTraitSet().replace(out);
  return new ElasticsearchFilter(relNode.getCluster(), traitSet,
    convert(filter.getInput(), out),
    filter.getCondition());
}
 
开发者ID:apache,项目名称:calcite,代码行数:8,代码来源:ElasticsearchRules.java

示例11: convert

import org.apache.calcite.rel.logical.LogicalFilter; //导入方法依赖的package包/类
public RelNode convert(RelNode rel) {
  final LogicalFilter filter = (LogicalFilter) rel;
  return new EnumerableFilter(rel.getCluster(),
      rel.getTraitSet().replace(EnumerableConvention.INSTANCE),
      convert(filter.getInput(),
          filter.getInput().getTraitSet()
              .replace(EnumerableConvention.INSTANCE)),
      filter.getCondition());
}
 
开发者ID:apache,项目名称:calcite,代码行数:10,代码来源:EnumerableFilterRule.java

示例12: convert

import org.apache.calcite.rel.logical.LogicalFilter; //导入方法依赖的package包/类
public RelNode convert(RelNode rel) {
  LogicalFilter filter = (LogicalFilter) rel;

  return new JdbcRules.JdbcFilter(rel.getCluster(), rel.getTraitSet().replace(this.out), convert(filter.getInput(),
      filter.getInput().getTraitSet().replace(this.out)), filter.getCondition());
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:7,代码来源:DrillJdbcRuleBase.java

示例13: convert

import org.apache.calcite.rel.logical.LogicalFilter; //导入方法依赖的package包/类
public RelNode convert(RelNode rel) {
  final LogicalFilter filter = (LogicalFilter) rel;
  final RelTraitSet traitSet = filter.getTraitSet().replace(PigRel.CONVENTION);
  return new PigFilter(rel.getCluster(), traitSet,
      convert(filter.getInput(), PigRel.CONVENTION), filter.getCondition());
}
 
开发者ID:apache,项目名称:calcite,代码行数:7,代码来源:PigRules.java

示例14: onMatch

import org.apache.calcite.rel.logical.LogicalFilter; //导入方法依赖的package包/类
public void onMatch(RelOptRuleCall call) {
  LogicalFilter filter = call.rel(0);
  LogicalTableFunctionScan funcRel = call.rel(1);
  Set<RelColumnMapping> columnMappings = funcRel.getColumnMappings();
  if (columnMappings == null || columnMappings.isEmpty()) {
    // No column mapping information, so no push-down
    // possible.
    return;
  }

  List<RelNode> funcInputs = funcRel.getInputs();
  if (funcInputs.size() != 1) {
    // TODO:  support more than one relational input; requires
    // offsetting field indices, similar to join
    return;
  }
  // TODO:  support mappings other than 1-to-1
  if (funcRel.getRowType().getFieldCount()
      != funcInputs.get(0).getRowType().getFieldCount()) {
    return;
  }
  for (RelColumnMapping mapping : columnMappings) {
    if (mapping.iInputColumn != mapping.iOutputColumn) {
      return;
    }
    if (mapping.derived) {
      return;
    }
  }
  final List<RelNode> newFuncInputs = new ArrayList<RelNode>();
  final RelOptCluster cluster = funcRel.getCluster();
  final RexNode condition = filter.getCondition();

  // create filters on top of each func input, modifying the filter
  // condition to reference the child instead
  RexBuilder rexBuilder = filter.getCluster().getRexBuilder();
  List<RelDataTypeField> origFields = funcRel.getRowType().getFieldList();
  // TODO:  these need to be non-zero once we
  // support arbitrary mappings
  int[] adjustments = new int[origFields.size()];
  for (RelNode funcInput : funcInputs) {
    RexNode newCondition =
        condition.accept(
            new RelOptUtil.RexInputConverter(
                rexBuilder,
                origFields,
                funcInput.getRowType().getFieldList(),
                adjustments));
    newFuncInputs.add(
        LogicalFilter.create(funcInput, newCondition));
  }

  // create a new UDX whose children are the filters created above
  LogicalTableFunctionScan newFuncRel =
      LogicalTableFunctionScan.create(cluster, newFuncInputs,
          funcRel.getCall(), funcRel.getElementType(), funcRel.getRowType(),
          columnMappings);
  call.transformTo(newFuncRel);
}
 
开发者ID:apache,项目名称:calcite,代码行数:60,代码来源:FilterTableFunctionTransposeRule.java

示例15: test

import org.apache.calcite.rel.logical.LogicalFilter; //导入方法依赖的package包/类
public boolean test(LogicalFilter input) {
  return input.getCondition() instanceof RexInputRef;
}
 
开发者ID:apache,项目名称:calcite,代码行数:4,代码来源:SubstitutionVisitor.java


注:本文中的org.apache.calcite.rel.logical.LogicalFilter.getCondition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。