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

Java ImmutableIntList类代码示例

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

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



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

示例1: mergeJoin

import org.apache.calcite.util.ImmutableIntList; //导入依赖的package包/类
/** Helper method to determine a {@link Join}'s collation assuming that it
 * uses a merge-join algorithm.
 *
 * <p>If the inputs are sorted on other keys <em>in addition to</em> the join
 * key, the result preserves those collations too. */
public static List<RelCollation> mergeJoin(RelMetadataQuery mq,
    RelNode left, RelNode right,
    ImmutableIntList leftKeys, ImmutableIntList rightKeys) {
  final ImmutableList.Builder<RelCollation> builder = ImmutableList.builder();

  final ImmutableList<RelCollation> leftCollations = mq.collations(left);
  assert RelCollations.contains(leftCollations, leftKeys)
      : "cannot merge join: left input is not sorted on left keys";
  builder.addAll(leftCollations);

  final ImmutableList<RelCollation> rightCollations = mq.collations(right);
  assert RelCollations.contains(rightCollations, rightKeys)
      : "cannot merge join: right input is not sorted on right keys";
  final int leftFieldCount = left.getRowType().getFieldCount();
  for (RelCollation collation : rightCollations) {
    builder.add(RelCollations.shift(collation, leftFieldCount));
  }
  return builder.build();
}
 
开发者ID:apache,项目名称:calcite,代码行数:25,代码来源:RelMdCollation.java


示例2: createAggregateCallWithBinding

import org.apache.calcite.util.ImmutableIntList; //导入依赖的package包/类
private AggregateCall createAggregateCallWithBinding(
    RelDataTypeFactory typeFactory,
    SqlAggFunction aggFunction,
    RelDataType operandType,
    Aggregate oldAggRel,
    AggregateCall oldCall,
    int argOrdinal) {
  final Aggregate.AggCallBinding binding =
      new Aggregate.AggCallBinding(typeFactory, aggFunction,
          ImmutableList.of(operandType), oldAggRel.getGroupCount(),
          oldCall.filterArg >= 0);
  return AggregateCall.create(aggFunction,
      oldCall.isDistinct(),
      oldCall.isApproximate(),
      ImmutableIntList.of(argOrdinal),
      oldCall.filterArg,
      aggFunction.inferReturnType(binding),
      null);
}
 
开发者ID:apache,项目名称:calcite,代码行数:20,代码来源:AggregateReduceFunctionsRule.java


示例3: apply

import org.apache.calcite.util.ImmutableIntList; //导入依赖的package包/类
protected void apply(RelOptRuleCall call, Filter filter, TableScan scan) {
  final ImmutableIntList projects;
  final ImmutableList.Builder<RexNode> filters = ImmutableList.builder();
  if (scan instanceof Bindables.BindableTableScan) {
    final Bindables.BindableTableScan bindableScan =
        (Bindables.BindableTableScan) scan;
    filters.addAll(bindableScan.filters);
    projects = bindableScan.projects;
  } else {
    projects = scan.identity();
  }

  final Mapping mapping = Mappings.target(projects,
      scan.getTable().getRowType().getFieldCount());
  filters.add(
      RexUtil.apply(mapping, filter.getCondition()));

  call.transformTo(
      Bindables.BindableTableScan.create(scan.getCluster(), scan.getTable(),
          filters.build(), projects));
}
 
开发者ID:apache,项目名称:calcite,代码行数:22,代码来源:FilterTableScanRule.java


示例4: SemiJoin

import org.apache.calcite.util.ImmutableIntList; //导入依赖的package包/类
/**
 * Creates a SemiJoin.
 *
 * <p>Use {@link #create} unless you know what you're doing.
 *
 * @param cluster   cluster that join belongs to
 * @param traitSet  Trait set
 * @param left      left join input
 * @param right     right join input
 * @param condition join condition
 * @param leftKeys  left keys of the semijoin
 * @param rightKeys right keys of the semijoin
 */
public SemiJoin(
    RelOptCluster cluster,
    RelTraitSet traitSet,
    RelNode left,
    RelNode right,
    RexNode condition,
    ImmutableIntList leftKeys,
    ImmutableIntList rightKeys) {
  super(
      cluster,
      traitSet,
      left,
      right,
      condition,
      leftKeys,
      rightKeys,
      ImmutableSet.<CorrelationId>of(),
      JoinRelType.INNER);
}
 
开发者ID:apache,项目名称:calcite,代码行数:33,代码来源:SemiJoin.java


示例5: of

import org.apache.calcite.util.ImmutableIntList; //导入依赖的package包/类
/** Creates a {@code JoinInfo} by analyzing a condition. */
public static JoinInfo of(RelNode left, RelNode right, RexNode condition) {
  final List<Integer> leftKeys = new ArrayList<Integer>();
  final List<Integer> rightKeys = new ArrayList<Integer>();
  final List<Boolean> filterNulls = new ArrayList<Boolean>();
  RexNode remaining =
      RelOptUtil.splitJoinCondition(left, right, condition, leftKeys,
          rightKeys, filterNulls);
  if (remaining.isAlwaysTrue()) {
    return new EquiJoinInfo(ImmutableIntList.copyOf(leftKeys),
        ImmutableIntList.copyOf(rightKeys));
  } else {
    return new NonEquiJoinInfo(ImmutableIntList.copyOf(leftKeys),
        ImmutableIntList.copyOf(rightKeys), remaining);
  }
}
 
开发者ID:apache,项目名称:calcite,代码行数:17,代码来源:JoinInfo.java


示例6: EnumerableJoin

import org.apache.calcite.util.ImmutableIntList; //导入依赖的package包/类
/** Creates an EnumerableJoin.
 *
 * <p>Use {@link #create} unless you know what you're doing. */
protected EnumerableJoin(
    RelOptCluster cluster,
    RelTraitSet traits,
    RelNode left,
    RelNode right,
    RexNode condition,
    ImmutableIntList leftKeys,
    ImmutableIntList rightKeys,
    Set<CorrelationId> variablesSet,
    JoinRelType joinType)
    throws InvalidRelException {
  super(
      cluster,
      traits,
      left,
      right,
      condition,
      leftKeys,
      rightKeys,
      variablesSet,
      joinType);
}
 
开发者ID:apache,项目名称:calcite,代码行数:26,代码来源:EnumerableJoin.java


示例7: create

import org.apache.calcite.util.ImmutableIntList; //导入依赖的package包/类
/** Creates an EnumerableJoin. */
public static EnumerableJoin create(
    RelNode left,
    RelNode right,
    RexNode condition,
    ImmutableIntList leftKeys,
    ImmutableIntList rightKeys,
    Set<CorrelationId> variablesSet,
    JoinRelType joinType)
    throws InvalidRelException {
  final RelOptCluster cluster = left.getCluster();
  final RelTraitSet traitSet =
      cluster.traitSetOf(EnumerableConvention.INSTANCE);
  return new EnumerableJoin(cluster, traitSet, left, right, condition,
      leftKeys, rightKeys, variablesSet, joinType);
}
 
开发者ID:apache,项目名称:calcite,代码行数:17,代码来源:EnumerableJoin.java


示例8: EnumerableMergeJoin

import org.apache.calcite.util.ImmutableIntList; //导入依赖的package包/类
EnumerableMergeJoin(
    RelOptCluster cluster,
    RelTraitSet traits,
    RelNode left,
    RelNode right,
    RexNode condition,
    ImmutableIntList leftKeys,
    ImmutableIntList rightKeys,
    Set<CorrelationId> variablesSet,
    JoinRelType joinType)
    throws InvalidRelException {
  super(cluster, traits, left, right, condition, leftKeys, rightKeys,
      variablesSet, joinType);
  final List<RelCollation> collations =
      traits.getTraits(RelCollationTraitDef.INSTANCE);
  assert collations == null || RelCollations.contains(collations, leftKeys);
}
 
开发者ID:apache,项目名称:calcite,代码行数:18,代码来源:EnumerableMergeJoin.java


示例9: groupKey_

import org.apache.calcite.util.ImmutableIntList; //导入依赖的package包/类
private GroupKey groupKey_(ImmutableBitSet groupSet, boolean indicator,
    ImmutableList<ImmutableBitSet> groupSets) {
  if (groupSet.length() > peek().getRowType().getFieldCount()) {
    throw new IllegalArgumentException("out of bounds: " + groupSet);
  }
  if (groupSets == null) {
    groupSets = ImmutableList.of(groupSet);
  }
  final ImmutableList<RexNode> nodes =
      fields(ImmutableIntList.of(groupSet.toArray()));
  final List<ImmutableList<RexNode>> nodeLists =
      Lists.transform(groupSets,
          new Function<ImmutableBitSet, ImmutableList<RexNode>>() {
            public ImmutableList<RexNode> apply(ImmutableBitSet input) {
              return fields(ImmutableIntList.of(input.toArray()));
            }
          });
  return groupKey(nodes, indicator, nodeLists);
}
 
开发者ID:apache,项目名称:calcite,代码行数:20,代码来源:RelBuilder.java


示例10: getNewColumnMapping

import org.apache.calcite.util.ImmutableIntList; //导入依赖的package包/类
/**
 * Creates a mapping from the view index to the index in the underlying table.
 */
private static ImmutableIntList getNewColumnMapping(Table underlying,
    ImmutableIntList oldColumnMapping, List<RelDataTypeField> extendedColumns,
    RelDataTypeFactory typeFactory) {
  final List<RelDataTypeField> baseColumns =
      underlying.getRowType(typeFactory).getFieldList();
  final Map<String, Integer> nameToIndex = mapNameToIndex(baseColumns);

  final ImmutableList.Builder<Integer> newMapping = ImmutableList.builder();
  newMapping.addAll(oldColumnMapping);
  int newMappedIndex = baseColumns.size();
  for (RelDataTypeField extendedColumn : extendedColumns) {
    if (nameToIndex.containsKey(extendedColumn.getName())) {
      // The extended column duplicates a column in the underlying table.
      // Map to the index in the underlying table.
      newMapping.add(nameToIndex.get(extendedColumn.getName()));
    } else {
      // The extended column is not in the underlying table.
      newMapping.add(newMappedIndex++);
    }
  }
  return ImmutableIntList.copyOf(newMapping.build());
}
 
开发者ID:apache,项目名称:calcite,代码行数:26,代码来源:ModifiableViewTable.java


示例11: create

import org.apache.calcite.util.ImmutableIntList; //导入依赖的package包/类
/** Creates a BindableTableScan. */
public static BindableTableScan create(RelOptCluster cluster,
    RelOptTable relOptTable, List<RexNode> filters,
    List<Integer> projects) {
  final Table table = relOptTable.unwrap(Table.class);
  final RelTraitSet traitSet =
      cluster.traitSetOf(BindableConvention.INSTANCE)
          .replaceIfs(RelCollationTraitDef.INSTANCE,
              new Supplier<List<RelCollation>>() {
                public List<RelCollation> get() {
                  if (table != null) {
                    return table.getStatistic().getCollations();
                  }
                  return ImmutableList.of();
                }
              });
  return new BindableTableScan(cluster, traitSet, relOptTable,
      ImmutableList.copyOf(filters), ImmutableIntList.copyOf(projects));
}
 
开发者ID:apache,项目名称:calcite,代码行数:20,代码来源:Bindables.java


示例12: createFilterable

import org.apache.calcite.util.ImmutableIntList; //导入依赖的package包/类
private static TableScanNode createFilterable(Compiler compiler,
    TableScan rel, ImmutableList<RexNode> filters, ImmutableIntList projects,
    FilterableTable filterableTable) {
  final DataContext root = compiler.getDataContext();
  final List<RexNode> mutableFilters = Lists.newArrayList(filters);
  final Enumerable<Object[]> enumerable =
      filterableTable.scan(root, mutableFilters);
  for (RexNode filter : mutableFilters) {
    if (!filters.contains(filter)) {
      throw RESOURCE.filterableTableInventedFilter(filter.toString()).ex();
    }
  }
  final Enumerable<Row> rowEnumerable = Enumerables.toRow(enumerable);
  return createEnumerable(compiler, rel, rowEnumerable, null,
      mutableFilters, projects);
}
 
开发者ID:apache,项目名称:calcite,代码行数:17,代码来源:TableScanNode.java


示例13: remap

import org.apache.calcite.util.ImmutableIntList; //导入依赖的package包/类
private static List<Integer> remap(ImmutableBitSet groupSet,
								List<Integer> argList) {
	ImmutableIntList list = ImmutableIntList.of();
	for (int arg : argList) {
		list = list.append(remap(groupSet, arg));
	}
	return list;
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:9,代码来源:FlinkAggregateExpandDistinctAggregatesRule.java


示例14: AnalyzeViewResult

import org.apache.calcite.util.ImmutableIntList; //导入依赖的package包/类
AnalyzeViewResult(CalcitePrepareImpl prepare,
                  SqlValidator validator, String sql, SqlNode sqlNode,
                  RelDataType rowType, RelRoot root, Table table,
                  ImmutableList<String> tablePath, RexNode constraint,
                  ImmutableIntList columnMapping) {
    super(prepare, validator, sql, sqlNode, rowType, root);
    this.table = table;
    this.tablePath = tablePath;
    this.constraint = constraint;
    this.columnMapping = columnMapping;
}
 
开发者ID:bitnine-oss,项目名称:octopus,代码行数:12,代码来源:CalcitePrepare.java


示例15: OLAPJoinRel

import org.apache.calcite.util.ImmutableIntList; //导入依赖的package包/类
public OLAPJoinRel(RelOptCluster cluster, RelTraitSet traits, RelNode left, RelNode right, //
        RexNode condition, ImmutableIntList leftKeys, ImmutableIntList rightKeys, //
        Set<CorrelationId> variablesSet, JoinRelType joinType) throws InvalidRelException {
    super(cluster, traits, left, right, condition, leftKeys, rightKeys, variablesSet, joinType);
    Preconditions.checkArgument(getConvention() == OLAPRel.CONVENTION);
    this.rowType = getRowType();
    this.isTopJoin = false;
}
 
开发者ID:apache,项目名称:kylin,代码行数:9,代码来源:OLAPJoinRel.java


示例16: contains

import org.apache.calcite.util.ImmutableIntList; //导入依赖的package包/类
/** Returns whether one of a list of collations indicates that the collection
 * is sorted on the given list of keys. */
public static boolean contains(List<RelCollation> collations,
    ImmutableIntList keys) {
  final List<Integer> distinctKeys = Util.distinctList(keys);
  for (RelCollation collation : collations) {
    if (contains(collation, distinctKeys)) {
      return true;
    }
  }
  return false;
}
 
开发者ID:apache,项目名称:calcite,代码行数:13,代码来源:RelCollations.java


示例17: MutableSemiJoin

import org.apache.calcite.util.ImmutableIntList; //导入依赖的package包/类
private MutableSemiJoin(
    RelDataType rowType,
    MutableRel left,
    MutableRel right,
    RexNode condition,
    ImmutableIntList leftKeys,
    ImmutableIntList rightKeys) {
  super(MutableRelType.SEMIJOIN, left.cluster, rowType, left, right);
  this.condition = condition;
  this.leftKeys = leftKeys;
  this.rightKeys = rightKeys;
}
 
开发者ID:apache,项目名称:calcite,代码行数:13,代码来源:MutableSemiJoin.java


示例18: of

import org.apache.calcite.util.ImmutableIntList; //导入依赖的package包/类
/** Creates a simple RelRoot. */
public static RelRoot of(RelNode rel, RelDataType rowType, SqlKind kind) {
  final ImmutableIntList refs =
      ImmutableIntList.identity(rowType.getFieldCount());
  final List<String> names = rowType.getFieldNames();
  return new RelRoot(rel, rowType, kind, Pair.zip(refs, names),
      RelCollations.EMPTY);
}
 
开发者ID:apache,项目名称:calcite,代码行数:9,代码来源:RelRoot.java


示例19: remap

import org.apache.calcite.util.ImmutableIntList; //导入依赖的package包/类
private static List<Integer> remap(ImmutableBitSet groupSet,
    List<Integer> argList) {
  ImmutableIntList list = ImmutableIntList.of();
  for (int arg : argList) {
    list = list.append(remap(groupSet, arg));
  }
  return list;
}
 
开发者ID:apache,项目名称:calcite,代码行数:9,代码来源:AggregateExpandDistinctAggregatesRule.java


示例20: onMatch

import org.apache.calcite.util.ImmutableIntList; //导入依赖的package包/类
public void onMatch(RelOptRuleCall call) {
  SemiJoin semiJoin = call.rel(0);
  LogicalProject project = call.rel(1);

  // Convert the LHS semi-join keys to reference the child projection
  // expression; all projection expressions must be RexInputRefs,
  // otherwise, we wouldn't have created this semi-join.
  final List<Integer> newLeftKeys = new ArrayList<>();
  final List<Integer> leftKeys = semiJoin.getLeftKeys();
  final List<RexNode> projExprs = project.getProjects();
  for (int leftKey : leftKeys) {
    RexInputRef inputRef = (RexInputRef) projExprs.get(leftKey);
    newLeftKeys.add(inputRef.getIndex());
  }

  // convert the semijoin condition to reflect the LHS with the project
  // pulled up
  RexNode newCondition = adjustCondition(project, semiJoin);

  SemiJoin newSemiJoin =
      SemiJoin.create(project.getInput(), semiJoin.getRight(), newCondition,
          ImmutableIntList.copyOf(newLeftKeys), semiJoin.getRightKeys());

  // Create the new projection.  Note that the projection expressions
  // are the same as the original because they only reference the LHS
  // of the semijoin and the semijoin only projects out the LHS
  final RelBuilder relBuilder = call.builder();
  relBuilder.push(newSemiJoin);
  relBuilder.project(projExprs, project.getRowType().getFieldNames());

  call.transformTo(relBuilder.build());
}
 
开发者ID:apache,项目名称:calcite,代码行数:33,代码来源:SemiJoinProjectTransposeRule.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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