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

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

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

Aggregate.getIndicatorCount介绍

[英]Returns the number of indicator fields.

This is the same as #getGroupCount() if #indicator is true, zero if indicator is false.

The offset of the first aggregate call in the output record is always groupCount + indicatorCount.
[中]返回指示器字段的数目。
如果#指示符为true,这与#getGroupCount()相同,如果指示符为false,则为零。
输出记录中第一个聚合调用的偏移量始终为groupCount+indicatorCount。

代码示例

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

final int groupingFields = aggregate.getGroupCount() + aggregate.getIndicatorCount();
Set<String> projectExprsDigest = new HashSet<String>();
Map<String, RexNode> windowingExprsDigestToNodes = new HashMap<String,RexNode>();

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

final List<AggregateCall> aggCalls = aggRel.getAggCallList();
final List<AggregateCall> newAggCalls = new ArrayList<>(aggCalls.size());
int nextIdx = aggRel.getGroupCount() + aggRel.getIndicatorCount();
for (int i = 0; i < aggCalls.size(); i++) {
 AggregateCall aggCall = aggCalls.get(i);
  call.transformTo(newAggregate);
 } else {
  final int offset = aggRel.getGroupCount() + aggRel.getIndicatorCount();
  final List<RexNode> projList = Lists.newArrayList();
  for (int i = 0; i < offset; ++i) {

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

final int groupingFields = aggregate.getGroupCount() + aggregate.getIndicatorCount();
Set<String> projectExprsDigest = new HashSet<String>();
Map<String, RexNode> windowingExprsDigestToNodes = new HashMap<String,RexNode>();

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

final int indicatorCount = oldAggRel.getIndicatorCount();

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

if ((aggregate.getIndicatorCount() > 0)
  || (aggregate.getGroupSet().isEmpty())
  || fieldsUsed.contains(aggregate.getGroupSet())) {

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

if (aggregate.getGroupSets().size() > 1 || aggregate.getIndicatorCount() > 0
  || fieldsUsed.contains(originalGroupSet)) {

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

+ newAggregate.getIndicatorCount();
  i < newAggregate.getRowType().getFieldCount(); i++) {
posList.add(i);

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

aggregate.getGroupCount() + aggregate.getIndicatorCount();
final int newLeftWidth = sides.get(0).newInput.getRowType().getFieldCount();
final List<RexNode> projects =

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

aggregate.getGroupCount() + aggregate.getIndicatorCount();
final int newLeftWidth = sides.get(0).newInput.getRowType().getFieldCount();
final List<RexNode> projects =

代码示例来源:origin: Qihoo360/Quicksql

public Set<RelColumnOrigin> getColumnOrigins(Aggregate rel,
  RelMetadataQuery mq, int iOutputColumn) {
 if (iOutputColumn < rel.getGroupCount()) {
  // Group columns pass through directly.
  return mq.getColumnOrigins(rel.getInput(), iOutputColumn);
 }
 if (rel.indicator) {
  if (iOutputColumn < rel.getGroupCount() + rel.getIndicatorCount()) {
   // The indicator column is originated here.
   return ImmutableSet.of();
  }
 }
 // Aggregate columns are derived from input columns
 AggregateCall call =
   rel.getAggCallList().get(iOutputColumn
       - rel.getGroupCount() - rel.getIndicatorCount());
 final Set<RelColumnOrigin> set = new HashSet<>();
 for (Integer iInput : call.getArgList()) {
  Set<RelColumnOrigin> inputSet =
    mq.getColumnOrigins(rel.getInput(), iInput);
  inputSet = createDerivedColumnOrigins(inputSet);
  if (inputSet != null) {
   set.addAll(inputSet);
  }
 }
 return set;
}

代码示例来源:origin: org.apache.calcite/calcite-core

public Set<RelColumnOrigin> getColumnOrigins(Aggregate rel,
  RelMetadataQuery mq, int iOutputColumn) {
 if (iOutputColumn < rel.getGroupCount()) {
  // Group columns pass through directly.
  return mq.getColumnOrigins(rel.getInput(), iOutputColumn);
 }
 if (rel.indicator) {
  if (iOutputColumn < rel.getGroupCount() + rel.getIndicatorCount()) {
   // The indicator column is originated here.
   return ImmutableSet.of();
  }
 }
 // Aggregate columns are derived from input columns
 AggregateCall call =
   rel.getAggCallList().get(iOutputColumn
       - rel.getGroupCount() - rel.getIndicatorCount());
 final Set<RelColumnOrigin> set = new HashSet<>();
 for (Integer iInput : call.getArgList()) {
  Set<RelColumnOrigin> inputSet =
    mq.getColumnOrigins(rel.getInput(), iInput);
  inputSet = createDerivedColumnOrigins(inputSet);
  if (inputSet != null) {
   set.addAll(inputSet);
  }
 }
 return set;
}

代码示例来源:origin: Qihoo360/Quicksql

/**
 * Returns a list of calls to aggregate functions together with their output
 * field names.
 *
 * @return list of calls to aggregate functions and their output field names
 */
public List<Pair<AggregateCall, String>> getNamedAggCalls() {
 final int offset = getGroupCount() + getIndicatorCount();
 return Pair.zip(aggCalls, Util.skip(getRowType().getFieldNames(), offset));
}

代码示例来源:origin: org.apache.calcite/calcite-core

/**
 * Returns a list of calls to aggregate functions together with their output
 * field names.
 *
 * @return list of calls to aggregate functions and their output field names
 */
public List<Pair<AggregateCall, String>> getNamedAggCalls() {
 final int offset = getGroupCount() + getIndicatorCount();
 return Pair.zip(aggCalls, Util.skip(getRowType().getFieldNames(), offset));
}

代码示例来源:origin: Qihoo360/Quicksql

public int getSourceOpt(int source) {
  assert aggregate.getIndicatorCount() == 0;
  if (source < aggregate.getGroupCount()) {
   int in = tileKey.dimensions.nth(source);
   return aggregate.getGroupSet().indexOf(in);
  }
  Lattice.Measure measure =
    measures.get(source - aggregate.getGroupCount());
  int i = tileKey.measures.indexOf(measure);
  assert i >= 0;
  return tileKey.dimensions.cardinality() + i;
 }
} .inverse()));

代码示例来源:origin: org.apache.calcite/calcite-core

public int getSourceOpt(int source) {
  assert aggregate.getIndicatorCount() == 0;
  if (source < aggregate.getGroupCount()) {
   int in = tileKey.dimensions.nth(source);
   return aggregate.getGroupSet().indexOf(in);
  }
  Lattice.Measure measure =
    measures.get(source - aggregate.getGroupCount());
  int i = tileKey.measures.indexOf(measure);
  assert i >= 0;
  return tileKey.dimensions.cardinality() + i;
 }
} .inverse()));

代码示例来源:origin: Qihoo360/Quicksql

/**
 * Takes a bitmap representing a set of input references and extracts the
 * ones that reference the group by columns in an aggregate.
 *
 * @param groupKey the original bitmap
 * @param aggRel   the aggregate
 * @param childKey sets bits from groupKey corresponding to group by columns
 */
public static void setAggChildKeys(
  ImmutableBitSet groupKey,
  Aggregate aggRel,
  ImmutableBitSet.Builder childKey) {
 List<AggregateCall> aggCalls = aggRel.getAggCallList();
 for (int bit : groupKey) {
  if (bit < aggRel.getGroupCount()) {
   // group by column
   childKey.set(bit);
  } else {
   // aggregate column -- set a bit for each argument being
   // aggregated
   AggregateCall agg = aggCalls.get(bit
     - (aggRel.getGroupCount() + aggRel.getIndicatorCount()));
   for (Integer arg : agg.getArgList()) {
    childKey.set(arg);
   }
  }
 }
}

代码示例来源:origin: org.apache.calcite/calcite-core

/**
 * Takes a bitmap representing a set of input references and extracts the
 * ones that reference the group by columns in an aggregate.
 *
 * @param groupKey the original bitmap
 * @param aggRel   the aggregate
 * @param childKey sets bits from groupKey corresponding to group by columns
 */
public static void setAggChildKeys(
  ImmutableBitSet groupKey,
  Aggregate aggRel,
  ImmutableBitSet.Builder childKey) {
 List<AggregateCall> aggCalls = aggRel.getAggCallList();
 for (int bit : groupKey) {
  if (bit < aggRel.getGroupCount()) {
   // group by column
   childKey.set(bit);
  } else {
   // aggregate column -- set a bit for each argument being
   // aggregated
   AggregateCall agg = aggCalls.get(bit
     - (aggRel.getGroupCount() + aggRel.getIndicatorCount()));
   for (Integer arg : agg.getArgList()) {
    childKey.set(arg);
   }
  }
 }
}

代码示例来源:origin: org.apache.calcite/calcite-core

+ newAggregate.getIndicatorCount();
  i < newAggregate.getRowType().getFieldCount(); i++) {
posList.add(i);

代码示例来源:origin: Qihoo360/Quicksql

final int indicatorCount = oldAggRel.getIndicatorCount();

代码示例来源:origin: org.apache.calcite/calcite-core

final int indicatorCount = oldAggRel.getIndicatorCount();

相关文章