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

Examples of com.sap.hadoop.windowing.functions2.table.npath.ResultExpressionParser


  {
    WindowSpec wSpec = wFnSpec.getWindowSpec();
   
    if ( wSpec == null ) return null;
   
    WindowFunctionInfo wFnInfo = FunctionRegistry.getWindowFunctionInfo(wFnSpec.getName());
    String desc = wFnSpec.toString();
   
    if ( wSpec != null && !wFnInfo.isSupportsWindow() )
    {
      throw new WindowingException(sprintf("Function %s doesn't support windowing", desc));
    }
    return WindowSpecTranslation.translateWindowSpecOnInput(qDef, wSpec, iInfo, desc);
  }
View Full Code Here


              args[i++] = arg.getExprEvaluator().evaluate(row);
            }
            fEval.aggregate(aggBuffer, args);
          }
          Object out = fEval.evaluate(aggBuffer);
          WindowFunctionInfo wFnInfo = FunctionRegistry.getWindowFunctionInfo(wFn.getSpec().getName());
          if ( !wFnInfo.isPivotResult())
          {
            out = new SameList(iPart.size(), out);
          }
          oColumns.add((List<?>)out);
        }
View Full Code Here

      WindowFunctionTranslation.addInputColumnsToList(qDef, getEvaluator().getTableDef(), aliases, fieldOIs);
     
      for(WindowFunctionSpec wFnS : wFnSpecs)
      {
          WindowFunctionDef wFnDef = WindowFunctionTranslation.translate(qDef, getEvaluator().getTableDef(), wFnS);
          WindowFunctionInfo wFnInfo = FunctionRegistry.getWindowFunctionInfo(wFnS.getName());
          wFnDefs.add(wFnDef);
          aliases.add(wFnS.getAlias());
          if ( wFnInfo.isPivotResult())
          {
            ListObjectInspector lOI = (ListObjectInspector) wFnDef.getOI();
            fieldOIs.add(lOI.getListElementObjectInspector());
          }
          else
View Full Code Here

        }
        catch (HiveException he)
        {
          throw new WindowingException(he);
        }
        GenericUDFLeadLag llFn = (GenericUDFLeadLag) llFuncExpr
            .getGenericUDF();
        llFn.setExprEvaluator(dupExprEval);
      }
    }

    return OI;
  }
View Full Code Here

        .getLeadLagExprs();
    if (llFnDescs == null)
      return;
    for (ExprNodeGenericFuncDesc llFnDesc : llFnDescs)
    {
      GenericUDFLeadLag llFn = (GenericUDFLeadLag) llFnDesc
          .getGenericUDF();
      llFn.setpItr(pItr);
    }
  }
View Full Code Here

   */
  public static boolean addPTFMapOperator(QueryDef qdef) throws WindowingException
  {
    boolean hasMap = false;
    TableFuncDef tabDef = RuntimeUtils.getFirstTableFunction(qdef);
    TableFunctionEvaluator tEval = tabDef.getFunction();
    if (tEval.isTransformsRawInput())
    {
      hasMap = true;
    }
    return hasMap;

View Full Code Here

    hiveTableDef = tabDef.getHiveTableDef();
    InputInfo inputInfo;
    ArrayList<ColumnDef> partColList = tabDef.getWindow().getPartDef()
        .getColumns();

    TableFunctionEvaluator tEval = tabDef.getFunction();

    /*
     * If the query has a map phase, the inputInfo is retrieved from the map
     * output info of the table function definition. This is constructed
     * using the map output oi of the table function definition. If the
     * query does not have a map phase, the inputInfo is retrieved from the
     * QueryInputDef (either HiveTableDef or HiveQueryDef) of the query.
     */
    if (tEval.isTransformsRawInput())
    {
      inputInfo = qdef.getTranslationInfo().getMapInputInfo(tabDef);
    }
    else
    {
View Full Code Here

        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);
View Full Code Here

    inputInfoMap.put(input.getAlias(), new InputInfo(this, input, null));
  }
 
  public InputInfo getMapInputInfo(TableFuncDef tDef) throws WindowingException
  {
    TableFunctionEvaluator tFn = tDef.getFunction();
    if ( !tFn.isTransformsRawInput() )
    {
      return null;
    }
    mapReshapeInfoMap = mapReshapeInfoMap == null ? new HashMap<String, InputInfo>() : mapReshapeInfoMap;
    InputInfo ii = mapReshapeInfoMap.get(tDef.getAlias());
    if ( ii == null )
    {
      ii = new InputInfo(this, tDef, tFn.getRawInputOI());
      mapReshapeInfoMap.put(tDef.getAlias(), ii);
    }
    return ii;
  }
View Full Code Here

   * (either HiveTableDef or HiveQueryDef) of the query.
   */
  @Override
  public void preVisit(TableFuncDef tblFuncDef) throws WindowingException
  {
    TableFunctionEvaluator tEval = tblFuncDef.getFunction();
    currentTFnResolver = FunctionRegistry.getTableFunctionResolver(tEval.getTableDef().getName());
    currentTFnResolver.initialize(qDef, tblFuncDef, tEval);
    if (tEval.isTransformsRawInput())
    {
      currentTFnResolver.setupRawInputOI();
      inputInfo = qDef.getTranslationInfo().getMapInputInfo(tblFuncDef);
    }
    else
View Full Code Here

TOP

Related Classes of com.sap.hadoop.windowing.functions2.table.npath.ResultExpressionParser

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.