Package com.odiago.flumebase.plan

Examples of com.odiago.flumebase.plan.HashJoinNode


      // Signal error by returning a null flow specification anyway.
      planContext.setFlowSpec(null);
      return planContext;
    }

    HashJoinNode joinNode = new HashJoinNode(leftName, rightName, leftKey, rightKey,
        window, getSourceName(), leftContext.getOutFields(), rightContext.getOutFields(),
        planContext.getConf());

    // Set this node to expect multiple input schemas.
    List<Schema> inputSchemas = new ArrayList<Schema>();
    inputSchemas.add(leftContext.getSchema());
    inputSchemas.add(rightContext.getSchema());
    joinNode.setAttr(PlanNode.MULTI_INPUT_SCHEMA_ATTR, inputSchemas);

    flowSpec.attachToLastLayer(joinNode);

    // Create an output context defining our fields, etc.
    PlanContext outContext = new PlanContext(planContext);

    SymbolTable outTable = SymbolTable.mergeSymbols(leftContext.getSymbolTable(),
        rightContext.getSymbolTable(), planContext.getSymbolTable());
    outContext.setSymbolTable(outTable);

    List<TypedField> outputFields = new ArrayList<TypedField>();
    outputFields.addAll(leftContext.getOutFields());
    outputFields.addAll(rightContext.getOutFields());
    outputFields = distinctFields(outputFields);
    outContext.setOutFields(outputFields);

    Schema outSchema = createFieldSchema(outputFields);
    outContext.setSchema(outSchema);
    joinNode.setAttr(PlanNode.OUTPUT_SCHEMA_ATTR, outSchema);

    return outContext;
  }
View Full Code Here


      EvaluateExprsNode evalNode = (EvaluateExprsNode) node;
      Schema outSchema = (Schema) evalNode.getAttr(PlanNode.OUTPUT_SCHEMA_ATTR);
      newElem = new EvaluationElement(newContext, evalNode.getExprs(),
          evalNode.getPropagateFields(), outSchema);
    } else if (node instanceof HashJoinNode) {
      HashJoinNode joinNode = (HashJoinNode) node;
      newElem = new HashJoinElement(newContext, joinNode);
    } else {
      throw new DAGOperatorException("Cannot create FlowElement for PlanNode of type: "
          + node.getClass().getName());
    }
View Full Code Here

TOP

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

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.