Search in sources :

Example 6 with OrderDef

use of com.sap.hadoop.windowing.query2.definition.OrderDef in project SQLWindowing by hbutani.

the class QueryDefWalker method walk.

/**
 * Visit the partition columns and order columns
 * Visit the window frame definitions
 * @param window
 * @throws WindowingException
 */
protected void walk(WindowDef window) throws WindowingException {
    if (window == null)
        return;
    PartitionDef pDef = window.getPartDef();
    if (pDef != null) {
        ArrayList<ColumnDef> cols = pDef.getColumns();
        for (ColumnDef col : cols) {
            visitor.visit(col);
        }
        visitor.visit(pDef);
    }
    OrderDef oDef = window.getOrderDef();
    if (oDef != null) {
        ArrayList<OrderColumnDef> ocols = oDef.getColumns();
        for (OrderColumnDef ocol : ocols) {
            visitor.visit(ocol);
        }
        visitor.visit(oDef);
    }
    WindowFrameDef wFrmDef = window.getWindow();
    if (wFrmDef != null) {
        walk(wFrmDef.getStart());
        walk(wFrmDef.getEnd());
        visitor.visit(wFrmDef);
    }
    visitor.visit(window);
}
Also used : OrderColumnDef(com.sap.hadoop.windowing.query2.definition.OrderColumnDef) WindowFrameDef(com.sap.hadoop.windowing.query2.definition.WindowFrameDef) PartitionDef(com.sap.hadoop.windowing.query2.definition.PartitionDef) ColumnDef(com.sap.hadoop.windowing.query2.definition.ColumnDef) OrderColumnDef(com.sap.hadoop.windowing.query2.definition.OrderColumnDef) OrderDef(com.sap.hadoop.windowing.query2.definition.OrderDef)

Aggregations

OrderDef (com.sap.hadoop.windowing.query2.definition.OrderDef)6 WindowingException (com.sap.hadoop.windowing.WindowingException)3 OrderColumnDef (com.sap.hadoop.windowing.query2.definition.OrderColumnDef)3 PartitionDef (com.sap.hadoop.windowing.query2.definition.PartitionDef)3 ColumnDef (com.sap.hadoop.windowing.query2.definition.ColumnDef)2 WindowDef (com.sap.hadoop.windowing.query2.definition.WindowDef)2 WindowFrameDef (com.sap.hadoop.windowing.query2.definition.WindowFrameDef)2 QueryDef (com.sap.hadoop.windowing.query2.definition.QueryDef)1 QueryInputDef (com.sap.hadoop.windowing.query2.definition.QueryInputDef)1 OrderColumnSpec (com.sap.hadoop.windowing.query2.specification.OrderColumnSpec)1 OrderSpec (com.sap.hadoop.windowing.query2.specification.OrderSpec)1 PartitionSpec (com.sap.hadoop.windowing.query2.specification.PartitionSpec)1 QuerySpec (com.sap.hadoop.windowing.query2.specification.QuerySpec)1 WindowFrameSpec (com.sap.hadoop.windowing.query2.specification.WindowFrameSpec)1 InputInfo (com.sap.hadoop.windowing.query2.translate.QueryTranslationInfo.InputInfo)1 LocalExecutorTest (com.sap.hadoop.windowing.testutils.LocalExecutorTest)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1