Package org.apache.hadoop.hive.ql.optimizer.optiq.reloperators

Examples of org.apache.hadoop.hive.ql.optimizer.optiq.reloperators.HiveAggregateRel


        throw new RuntimeException("We expect " + parent.toString()
            + " to contain only constants. However, " + rexNode.toString() + " is "
            + rexNode.getKind());
      }
    }
    HiveAggregateRel oldAggRel = (HiveAggregateRel) rel;
    RelDataTypeFactory typeFactory = oldAggRel.getCluster().getTypeFactory();
    RelDataType longType = TypeConverter.convert(TypeInfoFactory.longTypeInfo, typeFactory);
    RelDataType intType = TypeConverter.convert(TypeInfoFactory.intTypeInfo, typeFactory);
    // Create the dummy aggregation.
    Aggregation countFn = (Aggregation) SqlFunctionConverter.getOptiqAggFn("count",
        ImmutableList.of(intType), longType);
    // TODO: Using 0 might be wrong; might need to walk down to find the
    // proper index of a dummy.
    List<Integer> argList = ImmutableList.of(0);
    AggregateCall dummyCall = new AggregateCall(countFn, false, argList, longType, null);
    AggregateRelBase newAggRel = oldAggRel.copy(oldAggRel.getTraitSet(), oldAggRel.getChild(),
        oldAggRel.getGroupSet(), ImmutableList.of(dummyCall));
    RelNode select = introduceDerivedTable(newAggRel);
    parent.replaceInput(0, select);
  }
View Full Code Here


      }
      RelNode gbInputRel = HiveProjectRel.create(srcRel, gbChildProjLst, null);

      HiveRel aggregateRel = null;
      try {
        aggregateRel = new HiveAggregateRel(cluster, cluster.traitSetOf(HiveRel.CONVENTION),
            gbInputRel, groupSet, aggregateCalls);
      } catch (InvalidRelException e) {
        throw new SemanticException(e);
      }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.ql.optimizer.optiq.reloperators.HiveAggregateRel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.