• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RelTraitSet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.calcite.plan.RelTraitSet的典型用法代码示例。如果您正苦于以下问题:Java RelTraitSet类的具体用法?Java RelTraitSet怎么用?Java RelTraitSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RelTraitSet类属于org.apache.calcite.plan包,在下文中一共展示了RelTraitSet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onMatch

import org.apache.calcite.plan.RelTraitSet; //导入依赖的package包/类
@Override
public void onMatch(RelOptRuleCall call) {
  final LogicalAggregate aggregate = (LogicalAggregate) call.rel(0);
  final RelNode input = call.rel(1);

  if (aggregate.containsDistinctCall()) {
    // currently, don't use this rule if any of the aggregates contains DISTINCT
    return;
  }

  final RelTraitSet traits = aggregate.getTraitSet().plus(DrillRel.DRILL_LOGICAL);
  final RelNode convertedInput = convert(input, input.getTraitSet().plus(DrillRel.DRILL_LOGICAL));
  try {
    call.transformTo(new DrillAggregateRel(aggregate.getCluster(), traits, convertedInput, aggregate.indicator,
        aggregate.getGroupSet(), aggregate.getGroupSets(), aggregate.getAggCallList()));
  } catch (InvalidRelException e) {
    tracer.warning(e.toString());
  }
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:20,代码来源:DrillAggregateRule.java


示例2: onMatch

import org.apache.calcite.plan.RelTraitSet; //导入依赖的package包/类
@Override
public void onMatch(RelOptRuleCall call) {
  final UnionRel union = (UnionRel) call.rel(0);
  final List<RelNode> inputs = union.getInputs();
  List<RelNode> convertedInputList = Lists.newArrayList();
  RelTraitSet traits = call.getPlanner().emptyTraitSet().plus(Prel.PHYSICAL);

  try {
    for (int i = 0; i < inputs.size(); i++) {
      RelNode convertedInput = convert(inputs.get(i), PrelUtil.fixTraits(call, traits));
      convertedInputList.add(convertedInput);
    }

    traits = call.getPlanner().emptyTraitSet().plus(Prel.PHYSICAL).plus(DistributionTrait.SINGLETON);
    UnionDistinctPrel unionDistinct =
        new UnionDistinctPrel(union.getCluster(), traits, convertedInputList,
            false /* compatibility already checked during logical phase */);

    call.transformTo(unionDistinct);

  } catch (InvalidRelException e) {
    tracer.warn(e.toString());
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:25,代码来源:UnionDistinctPrule.java


示例3: onMatch

import org.apache.calcite.plan.RelTraitSet; //导入依赖的package包/类
@Override
public void onMatch(RelOptRuleCall call) {
  final LogicalUnion union = (LogicalUnion) call.rel(0);

  // This rule applies to Union-All only
  if(!union.all) {
    return;
  }

  final RelTraitSet traits = union.getTraitSet().plus(DrillRel.DRILL_LOGICAL);
  final List<RelNode> convertedInputs = new ArrayList<>();
  for (RelNode input : union.getInputs()) {
    final RelNode convertedInput = convert(input, input.getTraitSet().plus(DrillRel.DRILL_LOGICAL));
    convertedInputs.add(convertedInput);
  }
  try {
    call.transformTo(new DrillUnionRel(union.getCluster(), traits, convertedInputs, union.all,
        true /* check compatibility */));
  } catch (InvalidRelException e) {
    tracer.warning(e.toString()) ;
  }
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:23,代码来源:DrillUnionAllRule.java


示例4: onMatch

import org.apache.calcite.plan.RelTraitSet; //导入依赖的package包/类
@Override
public void onMatch(RelOptRuleCall call) {
  final DrillUnionRel union = (DrillUnionRel) call.rel(0);
  final List<RelNode> inputs = union.getInputs();
  List<RelNode> convertedInputList = Lists.newArrayList();
  RelTraitSet traits = call.getPlanner().emptyTraitSet().plus(Prel.DRILL_PHYSICAL);

  try {
    for (int i = 0; i < inputs.size(); i++) {
      RelNode convertedInput = convert(inputs.get(i), PrelUtil.fixTraits(call, traits));
      convertedInputList.add(convertedInput);
    }

    traits = call.getPlanner().emptyTraitSet().plus(Prel.DRILL_PHYSICAL).plus(DrillDistributionTrait.SINGLETON);
    UnionDistinctPrel unionDistinct =
        new UnionDistinctPrel(union.getCluster(), traits, convertedInputList,
            false /* compatibility already checked during logical phase */);

    call.transformTo(unionDistinct);

  } catch (InvalidRelException e) {
    tracer.warning(e.toString());
  }
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:25,代码来源:UnionDistinctPrule.java


示例5: onMatch

import org.apache.calcite.plan.RelTraitSet; //导入依赖的package包/类
@Override
public void onMatch(RelOptRuleCall call) {
  final DrillSortRel sort = (DrillSortRel) call.rel(0);
  final RelNode input = sort.getInput();

  // Keep the collation in logical sort. Convert input into a RelNode with 1) this collation, 2) Physical, 3) hash distributed on

  DrillDistributionTrait hashDistribution =
      new DrillDistributionTrait(DrillDistributionTrait.DistributionType.HASH_DISTRIBUTED, ImmutableList.copyOf(getDistributionField(sort)));

  final RelTraitSet traits = sort.getTraitSet().plus(Prel.DRILL_PHYSICAL).plus(hashDistribution);

  final RelNode convertedInput = convert(input, traits);

  if(isSingleMode(call)){
    call.transformTo(convertedInput);
  }else{
    RelNode exch = new SingleMergeExchangePrel(sort.getCluster(), sort.getTraitSet().plus(Prel.DRILL_PHYSICAL).plus(DrillDistributionTrait.SINGLETON), convertedInput, sort.getCollation());
    call.transformTo(exch);  // transform logical "sort" into "SingleMergeExchange".

  }

}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:24,代码来源:SortPrule.java


示例6: onMatch

import org.apache.calcite.plan.RelTraitSet; //导入依赖的package包/类
@Override
public void onMatch(RelOptRuleCall call) {
  final LogicalUnion union = (LogicalUnion) call.rel(0);

  // This rule applies to Union-All only
  if(!union.all) {
    return;
  }

  final RelTraitSet traits = union.getTraitSet().plus(Rel.LOGICAL);
  final List<RelNode> convertedInputs = new ArrayList<>();
  for (RelNode input : union.getInputs()) {
    final RelNode convertedInput = convert(input, input.getTraitSet().plus(Rel.LOGICAL).simplify());
    convertedInputs.add(convertedInput);
  }
  try {
    call.transformTo(new UnionRel(union.getCluster(), traits, convertedInputs, union.all,
        true /* check compatibility */));
  } catch (InvalidRelException e) {
    tracer.warn(e.toString()) ;
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:23,代码来源:UnionAllRule.java


示例7: createTransformRequest

import org.apache.calcite.plan.RelTraitSet; //导入依赖的package包/类
private void createTransformRequest(RelOptRuleCall call, AggregateRel aggregate,
                                    RelNode input, RelTraitSet traits) throws InvalidRelException {

  final RelNode convertedInput = convert(input, traits);

  StreamAggPrel newAgg = new StreamAggPrel(
      aggregate.getCluster(),
      traits,
      convertedInput,
      aggregate.indicator,
      aggregate.getGroupSet(),
      aggregate.getGroupSets(),
      aggregate.getAggCallList(),
      OperatorPhase.PHASE_1of1);

  call.transformTo(newAgg);
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:18,代码来源:StreamAggPrule.java


示例8: onMatch

import org.apache.calcite.plan.RelTraitSet; //导入依赖的package包/类
@Override
public void onMatch(RelOptRuleCall call) {
  final DrillProjectRel project = (DrillProjectRel) call.rel(0);
  final RelNode input = project.getInput();

  RelTraitSet traits = input.getTraitSet().plus(Prel.DRILL_PHYSICAL);
  RelNode convertedInput = convert(input, traits);

  // Maintain two different map for distribution trait and collation trait.
  // For now, the only difference comes from the way how cast function impacts propagating trait.
  final Map<Integer, Integer> distributionMap = getDistributionMap(project);
  final Map<Integer, Integer> collationMap = getCollationMap(project);

  boolean traitPull = new ProjectTraitPull(call, distributionMap, collationMap).go(project, convertedInput);

  if(!traitPull){
    call.transformTo(new ProjectPrel(project.getCluster(), convertedInput.getTraitSet(), convertedInput, project.getProjects(), project.getRowType()));
  }
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:20,代码来源:ProjectPrule.java


示例9: traits

import org.apache.calcite.plan.RelTraitSet; //导入依赖的package包/类
private static RelTraitSet traits(
    RelOptCluster cluster,
    double rowCount,
    int splitCount,
    RelTraitSet traitSet) {
  PlannerSettings settings = PrelUtil.getPlannerSettings(cluster.getPlanner());
  boolean smallInput = rowCount < (double)settings.getSliceTarget();

  DistributionTrait distribution;
  if(settings.isMultiPhaseAggEnabled() && !settings.isSingleMode() && !smallInput && splitCount > 1) {
    distribution = DistributionTrait.ANY;
  } else {
    distribution = DistributionTrait.SINGLETON;
  }

  return traitSet.plus(distribution);
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:18,代码来源:ElasticIntermediateScanPrel.java


示例10: DrillWindowRel

import org.apache.calcite.plan.RelTraitSet; //导入依赖的package包/类
/**
 * Creates a window relational expression.
 *
 * @param cluster Cluster
 * @param traits
 * @param child   Input relational expression
 * @param rowType Output row type
 * @param groups Windows
 */
public DrillWindowRel(
    RelOptCluster cluster,
    RelTraitSet traits,
    RelNode child,
    List<RexLiteral> constants,
    RelDataType rowType,
    List<Group> groups) {
  super(cluster, traits, child, constants, rowType, groups);
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:19,代码来源:DrillWindowRel.java


示例11: onMatch

import org.apache.calcite.plan.RelTraitSet; //导入依赖的package包/类
@Override
public void onMatch(RelOptRuleCall call) {
  final Sort incomingSort = call.rel(0);
  final RelTraitSet incomingTraits = incomingSort.getTraitSet();
  RelNode input = incomingSort.getInput();

  // if the Optiq sort rel includes a collation and a limit, we need to create a copy the sort rel that excludes the
  // limit information.
  if (!incomingSort.getCollation().getFieldCollations().isEmpty()) {
    input = incomingSort.copy(incomingTraits, input, incomingSort.getCollation(), null, null);
  }

  RelNode convertedInput = convert(input, input.getTraitSet().plus(DrillRel.DRILL_LOGICAL));
  call.transformTo(new DrillLimitRel(incomingSort.getCluster(), convertedInput.getTraitSet().plus(DrillRel.DRILL_LOGICAL), convertedInput, incomingSort.offset, incomingSort.fetch));
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:16,代码来源:DrillLimitRule.java


示例12: ElasticIntermediateScanPrel

import org.apache.calcite.plan.RelTraitSet; //导入依赖的package包/类
public ElasticIntermediateScanPrel(
    RelOptCluster cluster,
    RelTraitSet traitSet,
    RelOptTable table,
    TableMetadata dataset,
    List<SchemaPath> projectedColumns,
    double observedRowcountAdjustment) {
  super(cluster, traits(cluster, table.getRowCount(), dataset.getSplitCount(), traitSet), table, dataset.getStoragePluginId(), dataset, projectedColumns, observedRowcountAdjustment);
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:10,代码来源:ElasticIntermediateScanPrel.java


示例13: DrillJoinRel

import org.apache.calcite.plan.RelTraitSet; //导入依赖的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


示例14: OldScanRelBase

import org.apache.calcite.plan.RelTraitSet; //导入依赖的package包/类
/**
 * Creates an <code>AbstractRelNode</code>.
 *
 * @param cluster
 * @param traitSet
 */
public OldScanRelBase(RelOptCluster cluster, RelTraitSet traitSet, RelOptTable relOptTable, RelDataType rowType, GroupScan groupScan, double discountRowCount) {
  super(cluster, traitSet, relOptTable);
  this.rowType = Preconditions.checkNotNull(rowType);
  this.groupScan = Preconditions.checkNotNull(groupScan);
  Preconditions.checkArgument(discountRowCount >= 0 && discountRowCount <= 1, "rowCountDiscount cannot be set to " + discountRowCount);
  this.rowCountDiscount = discountRowCount;
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:14,代码来源:OldScanRelBase.java


示例15: DrillFilterRelBase

import org.apache.calcite.plan.RelTraitSet; //导入依赖的package包/类
protected DrillFilterRelBase(Convention convention, RelOptCluster cluster, RelTraitSet traits, RelNode child, RexNode condition) {
  super(cluster, traits, child, condition);
  assert getConvention() == convention;

  // save the number of conjuncts that make up the filter condition such
  // that repeated calls to the costing function can use the saved copy
  conjunctions = RelOptUtil.conjunctions(condition);
  numConjuncts = conjunctions.size();
  // assert numConjuncts >= 1;

}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:12,代码来源:DrillFilterRelBase.java


示例16: copy

import org.apache.calcite.plan.RelTraitSet; //导入依赖的package包/类
@Override
public Aggregate copy(RelTraitSet traitSet, RelNode input, boolean indicator, ImmutableBitSet groupSet, List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) {
  try {
    return new DrillAggregateRel(getCluster(), traitSet, input, indicator, groupSet, groupSets, aggCalls);
  } catch (InvalidRelException e) {
    throw new AssertionError(e);
  }
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:9,代码来源:DrillAggregateRel.java


示例17: convertChild

import org.apache.calcite.plan.RelTraitSet; //导入依赖的package包/类
@Override
public RelNode convertChild(ProjectRel project, RelNode rel) throws RuntimeException {
  DistributionTrait childDist = rel.getTraitSet().getTrait(DistributionTraitDef.INSTANCE);
  RelCollation childCollation = rel.getTraitSet().getTrait(RelCollationTraitDef.INSTANCE);


  DistributionTrait newDist = convertDist(childDist, distributionMap);
  RelCollation newCollation = convertRelCollation(childCollation, collationMap);
  RelTraitSet newProjectTraits = newTraitSet(Prel.PHYSICAL, newDist, newCollation);
  return new ProjectPrel(project.getCluster(), newProjectTraits, rel, project.getProjects(), project.getRowType());
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:12,代码来源:ProjectPrule.java


示例18: onMatch

import org.apache.calcite.plan.RelTraitSet; //导入依赖的package包/类
@Override
public void onMatch(RelOptRuleCall call) {
  final Project toTransform = call.rel(0);
  final RelNode input = toTransform.getInput();
  final RelTraitSet traits = toTransform.getTraitSet().plus(Rel.LOGICAL);
  final RelNode convertedInput = convert(input, input.getTraitSet().plus(Rel.LOGICAL).simplify());
  call.transformTo(new ProjectRel(toTransform.getCluster(), traits, convertedInput, toTransform.getProjects(), toTransform.getRowType()));
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:9,代码来源:ProjectRule.java


示例19: DrillScanRel

import org.apache.calcite.plan.RelTraitSet; //导入依赖的package包/类
/** Creates a DrillScan. */
public DrillScanRel(final RelOptCluster cluster, final RelTraitSet traits,
    final RelOptTable table) {
  // By default, scan does not support project pushdown.
  // Decision whether push projects into scan will be made solely in DrillPushProjIntoScanRule.
  this(cluster, traits, table, table.getRowType(), GroupScan.ALL_COLUMNS);
  this.settings = PrelUtil.getPlannerSettings(cluster.getPlanner());
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:9,代码来源:DrillScanRel.java


示例20: ElasticScanPrel

import org.apache.calcite.plan.RelTraitSet; //导入依赖的package包/类
public ElasticScanPrel(
    RelOptCluster cluster,
    RelTraitSet traitSet,
    ElasticsearchPrel input,
    ScanBuilder scanBuilder,
    FunctionLookupContext functionLookupContext) {
  super(cluster, traitSet);
  this.input = input;
  this.rowType = input.getRowType();
  this.scanBuilder = scanBuilder;
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:12,代码来源:ElasticScanPrel.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Xembler类代码示例发布时间:2022-05-21
下一篇:
Java ThrowsException类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap