Package com.sap.hadoop.windowing.functions2.table

Examples of com.sap.hadoop.windowing.functions2.table.WindowingTableFunction$WindowingTableFunctionResolver


   *    with this table function definition.
   */
  @Override
  public void visit(TableFuncDef tblFuncDef) throws WindowingException
  {
    TableFunctionEvaluator tEval = tblFuncDef.getFunction();
    currentTFnResolver.setupOutputOI();
    TranslateUtils.setupSerdeAndOI(tblFuncDef, qInDef, tInfo, tEval);
    tInfo.addInput(tblFuncDef);
    inputInfo = qDef.getTranslationInfo().getInputInfo(tblFuncDef);
  }
View Full Code Here


  {
    super();
    this.wIn = wIn;
    this.qDef = qDef;
    TableFuncDef tabDef = (TableFuncDef) qDef.getInput();
    TableFunctionEvaluator tEval = tabDef.getFunction();
    partClassName = tEval.getPartitionClass();
    partMemSize = tEval.getPartitionMemSize();
   
    serDe = (SerDe) wIn.getDeserializer();
    try
    {
      OI = (StructObjectInspector) serDe.getObjectInspector();
View Full Code Here

   */
  public static Partition createFirstPartitionForChain(QueryDef qDef, ObjectInspector oi,
      HiveConf hiveConf, boolean isMapSide) throws WindowingException
  {
    TableFuncDef tabDef = getFirstTableFunction(qDef);
    TableFunctionEvaluator tEval = tabDef.getFunction();
    String partClassName = tEval.getPartitionClass();
    int partMemSize = tEval.getPartitionMemSize();

    Partition part = null;
    SerDe serde = tabDef.getInput().getSerde();
    part = new Partition(partClassName, partMemSize, serde,
        (StructObjectInspector) oi);
View Full Code Here

    {
      return null;
    }
   
    String desc = getInputDescription(qDef, tFnDef);
    TableFunctionEvaluator tFn = tFnDef.getFunction();
    InputInfo iInfo = null;
    if ( tFn.isTransformsRawInput() )
    {
      iInfo = tInfo.getMapInputInfo(tFnDef);
    }
    else
    {
View Full Code Here

   */
  private static TableFuncDef translate(QueryDef qDef, TableFuncSpec tSpec, QueryInputDef inputDef) throws WindowingException
  {
    QueryTranslationInfo tInfo = qDef.getTranslationInfo();
   
    TableFunctionResolver tFn = FunctionRegistry.getTableFunctionResolver(tSpec.getName());
    if ( tFn == null)
    {
      throw new WindowingException(sprintf("Unknown Table Function %s", tSpec.getName()));
    }
   
    TableFuncDef tDef = new TableFuncDef();
    tDef.setSpec(tSpec);
    tDef.setInput(inputDef);
    InputInfo iInfo = tInfo.getInputInfo(inputDef);
   
    /*
     * translate args
     */
    ArrayList<ASTNode> args = tSpec.getArgs();
    if ( args != null)
    {
      for(ASTNode expr : args)
      {
        ArgDef argDef = translateTableFunctionArg(qDef, tDef, iInfo,  expr);
        tDef.addArg(argDef);
      }
    }
   
    tFn.initialize(qDef, tDef);
    TableFunctionEvaluator tEval = tFn.getEvaluator();   
    tDef.setFunction(tEval);
    tFn.setupRawInputOI();
    tDef.setWindow(WindowSpecTranslation.translateWindow(qDef, tDef));
    tFn.setupOutputOI();
    TranslateUtils.setupSerdeAndOI(tDef, inputDef, tInfo, tEval);

    return tDef;
  }
View Full Code Here

    {
      super();
      this.displayName = displayName;
      this.functionResolver = tFnCls;
      isInternal = false;
      TableFuncDef def = functionResolver.getAnnotation(TableFuncDef.class);
      if ( def != null)
      {
        isInternal = def.isInternal();
      }
    }
View Full Code Here

    WindowFunctionInfo(FunctionInfo fInfo)
    {
      assert fInfo.isGenericUDAF();
      this.fInfo = fInfo;
      Class<? extends GenericUDAFResolver> wfnCls = fInfo.getGenericUDAFResolver().getClass();
      WindowFuncDef def = wfnCls.getAnnotation(WindowFuncDef.class);
      if ( def != null)
      {
        supportsWindow = def.supportsWindow();
        pivotResult = def.pivotResult();
      }
    }
View Full Code Here

      {
        sFn = new Plus(sFn);
      }
      symbolFunctions.add(sFn);
    }
    symbolFnChain = new Chain(symbolFunctions);
  }
View Full Code Here

      {
        sFn = new Star(sFn);
      }
      else if ( isPlus )
      {
        sFn = new Plus(sFn);
      }
      symbolFunctions.add(sFn);
    }
    symbolFnChain = new Chain(symbolFunctions);
  }
View Full Code Here

      ObjectInspector symbolExprOI = (ObjectInspector) symbolDetails[1];
      SymbolFunction sFn = new Symbol(symbolExprEval, symbolExprOI);
     
      if ( isStar )
      {
        sFn = new Star(sFn);
      }
      else if ( isPlus )
      {
        sFn = new Plus(sFn);
      }
View Full Code Here

TOP

Related Classes of com.sap.hadoop.windowing.functions2.table.WindowingTableFunction$WindowingTableFunctionResolver

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.