Package com.sap.hadoop.windowing.query2.translate

Examples of com.sap.hadoop.windowing.query2.translate.WindowFunctionTranslation


    this.orderString = orderString;
  }

  public String getOutputPath()
  {
    QueryOutputSpec qOutSpec = qdef.getOutput().getOutputSpec();
    outputPath = qOutSpec.getPath();
    return outputPath;
  }
View Full Code Here


public class WhereTranslation
{
  public static void translate(QueryDef qDef) throws WindowingException
  {
    QueryTranslationInfo tInfo = qDef.getTranslationInfo();
    QuerySpec spec = qDef.getSpec();
   
    ASTNode wExpr = spec.getWhereExpr();
   
    if ( wExpr == null ) return;
   
    WhereDef whDef = new WhereDef();
    whDef.setExpression(wExpr);
View Full Code Here

public class InputTranslation
{
 
  public static void translate(QueryDef qDef) throws WindowingException
  {
    QuerySpec spec = qDef.getSpec();
   
    /*
     * validate that input chain ends in a Hive Query or TAble.
     */
    if ( !spec.getInput().sourcedFromHive() )
    {
      throw new WindowingException("Translation not supported for HdfsLocation based queries");
    }
   
    EnsureTableFunctionInQuery.execute(qDef);
View Full Code Here

    return ParseUtils.parse(query);
  }
 
  public QueryDef translate(String query) throws WindowingException
  {
    QuerySpec qSpec = parse(query);
    return translator.translate(qSpec, this);
  }
View Full Code Here

    return translator.translate(qSpec, this);
  }

  public void execute(String query, QueryOutputPrinter outP) throws WindowingException
  {
    QuerySpec qSpec = parse(query);
    QueryDef q = translator.translate(qSpec, this);
   
    ArrayList<QueryDef> componentQueries;
    executor.beforeComponentization(q, this);
    QueryComponentizer qC = new QueryComponentizer(q, this);
View Full Code Here

    }
  }
 
  protected void execute(QueryDef q, QueryOutputPrinter outP) throws WindowingException
  {
    QuerySpec qSpec = q.getSpec();
    try
    {
      executor.execute(q, this);
    }
    finally
    {
      HiveTableDef hiveTable = q.getHiveTableDef();
      if ( hiveTable instanceof HiveQueryDef )
      {
        String tableName = hiveTable.getHiveTableSpec().getTableName();
        hiveQryExec.dropTable(tableName);
      }
     
    }
   
    if ( qSpec.getOutput().getHiveTable() != null )
    {
      loadToOutputTable(q);
    }
   
    if (outP != null)
View Full Code Here

    {
     
      nodes = new CommonTreeNodeStream(t);
      nodes.setTokenStream(tokens);
      qSpecBldr = new QSpecBuilder2(nodes);
      SelectSpec selectSpec = qSpecBldr.select();
 
      err = qSpecBldr.getWindowingParseErrors();
      if ( err != null )
      {
        throw new WindowingException(err);
View Full Code Here

  {
    QueryTranslationInfo tInfo = qDef.getTranslationInfo();
    QueryInputDef iDef = qDef.getInput();
    InputInfo iInfo = tInfo.getInputInfo(iDef);
    SelectDef selectDef = qDef.getSelectList();
    SelectSpec selectSpec = qDef.getSpec().getSelectList();
    Iterator<Object> selectExprsAndAliases = selectSpec.getColumnListAndAlias();
    int i = 0;
    ColumnDef cDef = null;
   
   
    while(selectExprsAndAliases.hasNext())
View Full Code Here

    public QueryInputSpec next()
    {
      QueryInputSpec curr = nextInput;
      if ( curr instanceof TableFuncSpec)
      {
        TableFuncSpec tFunc = (TableFuncSpec) curr;
        nextInput = tFunc.getInput();
      }
      else
      {
        nextInput = null;
      }
View Full Code Here

    // $ANTLR start window_range_expression
    // QSpecBuilder2.g:182:1: window_range_expression returns [WindowFrameSpec wf] : ^( WINDOWRANGE s= rowsboundary e= rowsboundary ) ;
    public final WindowFrameSpec window_range_expression() throws RecognitionException {
        WindowFrameSpec wf = null;

        BoundarySpec s = null;

        BoundarySpec e = null;


        try {
            // QSpecBuilder2.g:182:54: ( ^( WINDOWRANGE s= rowsboundary e= rowsboundary ) )
            // QSpecBuilder2.g:183:2: ^( WINDOWRANGE s= rowsboundary e= rowsboundary )
View Full Code Here

TOP

Related Classes of com.sap.hadoop.windowing.query2.translate.WindowFunctionTranslation

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.