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

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

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

Aggregate.getCluster介绍

暂无

代码示例

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

private boolean isAggWithConstantGbyKeys(final Aggregate aggregate, RelOptRuleCall call) {
 final RexBuilder rexBuilder = aggregate.getCluster().getRexBuilder();
 final RelMetadataQuery mq = call.getMetadataQuery();
 final RelOptPredicateList predicates =
   mq.getPulledUpPredicates(aggregate.getInput());
 if (predicates == null) {
  return false;
 }
 final NavigableMap<Integer, RexNode> map = new TreeMap<>();
 for (int key : aggregate.getGroupSet()) {
  final RexInputRef ref =
    rexBuilder.makeInputRef(aggregate.getInput(), key);
  if (predicates.constantMap.containsKey(ref)) {
   map.put(key, predicates.constantMap.get(ref));
  }
 }
 // None of the group expressions are constant. Nothing to do.
 if (map.isEmpty()) {
  return false;
 }
 final int groupCount = aggregate.getGroupCount();
 if (groupCount == map.size()) {
  return true;
 }
 return false;
}

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

cluster = aggregate.getCluster();
rexBuilder = cluster.getRexBuilder();
RelNode converted = null;

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

cluster = aggregate.getCluster();
rexBuilder = cluster.getRexBuilder();
RelNode converted = null;

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

final RelBuilder relBuilder = call.builder();
final Aggregate aggRel = (Aggregate) call.rel(0);
final RexBuilder rexBuilder = aggRel.getCluster().getRexBuilder();

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

final RexBuilder rexBuilder = aggregate.getCluster().getRexBuilder();
final List<AggregateCall> newCalls = new ArrayList<>(aggregate.getAggCallList().size());
final List<RexNode> newProjects = new ArrayList<>(project.getChildExps());
final List<RexNode> newCasts = new ArrayList<>(aggregate.getGroupCount() + aggregate.getAggCallList().size());
final RelDataTypeFactory typeFactory = aggregate.getCluster().getTypeFactory();

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

RexBuilder rexBuilder = aggregate.getCluster().getRexBuilder();
final List<RexNode> newProjects = new ArrayList<>();
 Aggregate newAggregate = new HiveAggregate(aggregate.getCluster(), aggregate.getTraitSet(), relBuilder.build(),
                       aggregate.getGroupSet(), null, aggregate.getAggCallList());
 return newAggregate;

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

final Union union = call.rel(1);
final RexBuilder rexBuilder =
  agg.getCluster().getRexBuilder();

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

RelOptRuleCall ruleCall,
 Aggregate oldAggRel) {
RexBuilder rexBuilder = oldAggRel.getCluster().getRexBuilder();

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

final RexBuilder rexBuilder = aggregate.getCluster().getRexBuilder();

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

RelMetadataQuery mq = aggregate.getCluster().getMetadataQuery();

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

final RelOptPredicateList inputInfo = mq.getPulledUpPredicates(input);
final List<RexNode> aggPullUpPredicates = new ArrayList<>();
final RexBuilder rexBuilder = agg.getCluster().getRexBuilder();

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

Schema(Schema src, Aggregate gBy) {
 for (int i : gBy.getGroupSet()) {
  ColumnInfo cI = src.get(i);
  add(cI);
 }
 List<AggregateCall> aggs = gBy.getAggCallList();
 for (AggregateCall agg : aggs) {
  if (agg.getAggregation() == HiveGroupingID.INSTANCE) {
   add(new ColumnInfo(null,VirtualColumn.GROUPINGID.getName()));
   continue;
  }
  int argCount = agg.getArgList().size();
  ASTBuilder b = agg.isDistinct() ? ASTBuilder.construct(HiveParser.TOK_FUNCTIONDI,
    "TOK_FUNCTIONDI") : argCount == 0 ? ASTBuilder.construct(HiveParser.TOK_FUNCTIONSTAR,
    "TOK_FUNCTIONSTAR") : ASTBuilder.construct(HiveParser.TOK_FUNCTION, "TOK_FUNCTION");
  b.add(HiveParser.Identifier, agg.getAggregation().getName());
  for (int i : agg.getArgList()) {
   RexInputRef iRef = new RexInputRef(i, gBy.getCluster().getTypeFactory()
     .createSqlType(SqlTypeName.ANY));
   b.add(iRef.accept(new RexVisitor(src, false, gBy.getCluster().getRexBuilder())));
  }
  add(new ColumnInfo(null, b.node()));
 }
}

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

List<RexNode> inputExprs) {
final int nGroups = oldAggRel.getGroupCount();
final RexBuilder rexBuilder = oldAggRel.getCluster().getRexBuilder();
final RelDataTypeFactory typeFactory = oldAggRel.getCluster().getTypeFactory();
final int iAvgInput = oldCall.getArgList().get(0);
final RelDataType sum0InputType = typeFactory.createTypeWithNullability(

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

final Aggregate aggregate = call.rel(0);
final Join join = call.rel(1);
final RexBuilder rexBuilder = aggregate.getCluster().getRexBuilder();
final RelBuilder relBuilder = call.builder();

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

List<RexNode> inputExprs) {
final int nGroups = oldAggRel.getGroupCount();
final RexBuilder rexBuilder = oldAggRel.getCluster().getRexBuilder();
final RelDataTypeFactory typeFactory = oldAggRel.getCluster().getTypeFactory();
final int iAvgInput = oldCall.getArgList().get(0);
final RelDataType avgInputType = typeFactory.createTypeWithNullability(

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

RexBuilder rexBuilder = oldAggRel.getCluster().getRexBuilder();
final int nGroups = oldAggRel.getGroupCount();
List<RelDataType> oldArgTypes =

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

b.add(HiveParser.Identifier, agg.getAggregation().getName());
for (int i : agg.getArgList()) {
 RexInputRef iRef = new RexInputRef(i, gBy.getCluster().getTypeFactory()
   .createSqlType(SqlTypeName.ANY));
 b.add(iRef.accept(new RexVisitor(src)));

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

final RelOptCluster cluster = oldAggRel.getCluster();
final RexBuilder rexBuilder = cluster.getRexBuilder();
final RelDataTypeFactory typeFactory = cluster.getTypeFactory();

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

for (int pos : hiveAgg.getAggregateColumnsOrder()) {
 RexInputRef iRef = new RexInputRef(groupBy.getGroupSet().nth(pos),
   groupBy.getCluster().getTypeFactory().createSqlType(SqlTypeName.ANY));
 b.add(iRef.accept(new RexVisitor(schema, false, root.getCluster().getRexBuilder())));
 if (!hiveAgg.getAggregateColumnsOrder().contains(pos)) {
  RexInputRef iRef = new RexInputRef(groupBy.getGroupSet().nth(pos),
    groupBy.getCluster().getTypeFactory().createSqlType(SqlTypeName.ANY));
  b.add(iRef.accept(new RexVisitor(schema, false, root.getCluster().getRexBuilder())));
      HiveParser.TOK_GROUPING_SETS_EXPRESSION, "TOK_GROUPING_SETS_EXPRESSION");
  for (int i : groupSet) {
   RexInputRef iRef = new RexInputRef(i, groupBy.getCluster().getTypeFactory()
     .createSqlType(SqlTypeName.ANY));
   expression.add(iRef.accept(new RexVisitor(schema, false, root.getCluster().getRexBuilder())));

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

for (int pos : hiveAgg.getAggregateColumnsOrder()) {
 RexInputRef iRef = new RexInputRef(groupBy.getGroupSet().nth(pos),
   groupBy.getCluster().getTypeFactory().createSqlType(SqlTypeName.ANY));
 b.add(iRef.accept(new RexVisitor(schema)));
 if (!hiveAgg.getAggregateColumnsOrder().contains(pos)) {
  RexInputRef iRef = new RexInputRef(groupBy.getGroupSet().nth(pos),
    groupBy.getCluster().getTypeFactory().createSqlType(SqlTypeName.ANY));
  b.add(iRef.accept(new RexVisitor(schema)));
      HiveParser.TOK_GROUPING_SETS_EXPRESSION, "TOK_GROUPING_SETS_EXPRESSION");
  for (int i : groupSet) {
   RexInputRef iRef = new RexInputRef(i, groupBy.getCluster().getTypeFactory()
     .createSqlType(SqlTypeName.ANY));
   expression.add(iRef.accept(new RexVisitor(schema)));

相关文章