Package com.odiago.flumebase.plan

Examples of com.odiago.flumebase.plan.AggregateNode


        aggregateOverFields = mGroupBy.getFieldTypes();
      }

      LOG.debug("Aggregate exprs: " + StringUtils.listToStr(mAggregateExprs));
      assert flowSpec.getConf() != null;
      PlanNode aggregateNode = new AggregateNode(aggregateOverFields,
          mAggregateOver, mAggregateExprs, groupByPropagateFields, flowSpec.getConf());
      flowSpec.attachToLastLayer(aggregateNode);

      // Output schema for this layer contains everything we need to forward
      // from our upstream layers...
      List<TypedField> aggOutputFields = new ArrayList<TypedField>();
      aggOutputFields.addAll(groupByPropagateFields);
      // As well as the names of everything we calculate in this layer.
      for (AliasedExpr aliasExpr : mAggregateExprs) {
        Expr e = aliasExpr.getExpr();
        Type t = e.getType(fieldSymbols);
        TypedField aggregateField = new TypedField(
          aliasExpr.getUserAlias(), t,
          aliasExpr.getAvroLabel(), aliasExpr.getDisplayLabel());
        aggOutputFields.add(aggregateField);
      }
      Schema aggregateOutSchema = createFieldSchema(aggOutputFields);
      aggregateNode.setAttr(PlanNode.OUTPUT_SCHEMA_ATTR, aggregateOutSchema);
    }
  }
View Full Code Here


      ProjectionNode projNode = (ProjectionNode) node;
      Schema outSchema = (Schema) projNode.getAttr(PlanNode.OUTPUT_SCHEMA_ATTR);
      newElem = new ProjectionElement(newContext, outSchema, projNode.getInputFields(),
          projNode.getOutputFields());
    } else if (node instanceof AggregateNode) {
      AggregateNode aggNode = (AggregateNode) node;
      newElem = new BucketedAggregationElement(newContext, aggNode);
    } else if (node instanceof EvaluateExprsNode) {
      EvaluateExprsNode evalNode = (EvaluateExprsNode) node;
      Schema outSchema = (Schema) evalNode.getAttr(PlanNode.OUTPUT_SCHEMA_ATTR);
      newElem = new EvaluationElement(newContext, evalNode.getExprs(),
View Full Code Here

TOP

Related Classes of com.odiago.flumebase.plan.AggregateNode

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.