Package com.sap.hadoop.windowing.query2.specification

Examples of com.sap.hadoop.windowing.query2.specification.TableFuncSpec


    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

   * -
   */
  static WindowDef translateWindow(QueryDef qDef, TableFuncDef tFnDef) throws WindowingException
  {
    QueryTranslationInfo tInfo = qDef.getTranslationInfo();
    TableFuncSpec tFnSpec = tFnDef.getTableFuncSpec();
   
    /*
     * for now the Language only allows explicit specification of Partition & Order clauses.
     * Easy to allow references to a Global Window Spec.
     */
    WindowSpec wSpec = new WindowSpec();
    wSpec.setPartition(tFnSpec.getPartition());
    wSpec.setOrder(tFnSpec.getOrder());
    QueryInputDef iDef = tFnDef.getInput();
   
    if ( wSpec.getPartition() == null )
    {
      return null;
View Full Code Here

TOP

Related Classes of com.sap.hadoop.windowing.query2.specification.TableFuncSpec

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.