Class SplitterUtils


  • public class SplitterUtils
    extends Object
    Utility methods for splitter.
    • Method Detail

      • hasAggregates

        public static boolean hasAggregates​(GridSqlAst el)
        Check whether AST element has aggregates.
        Parameters:
        el - Expression part in SELECT clause.
        Returns:
        true If expression contains aggregates.
      • findParamsQuery

        public static void findParamsQuery​(GridSqlQuery qry,
                                           int paramsCnt,
                                           TreeSet<Integer> paramIdxs)
        Parameters:
        qry - Select.
        paramsCnt - Number of parameters.
        paramIdxs - Parameter indexes.
      • hasDistinctAggregates

        public static boolean hasDistinctAggregates​(GridSqlAst el)
        Lookup for distinct aggregates. Note, DISTINCT make no sense for MIN and MAX aggregates, so its will be ignored.
        Parameters:
        el - Expression.
        Returns:
        true If expression contains distinct aggregates.
      • hasLeftJoin

        public static boolean hasLeftJoin​(GridSqlAst from)
        Check whether LEFT OUTER join exist.
        Parameters:
        from - FROM clause.
        Returns:
        true If contains LEFT OUTER JOIN.
      • checkNoDataTablesInReduceQuery

        public static void checkNoDataTablesInReduceQuery​(GridSqlAst ast,
                                                          String rdcQry)
        Parameters:
        ast - Reduce query AST.
        rdcQry - Reduce query string.
      • isTrue

        public static boolean isTrue​(GridSqlAst expr)
        Parameters:
        expr - Expression.
        Returns:
        true If this expression represents a constant value `TRUE`.
      • isFractionalType

        public static boolean isFractionalType​(int type)
        Parameters:
        type - data type id
        Returns:
        true if given type is fractional
      • column

        public static GridSqlColumn column​(String name)
        Parameters:
        name - Column name.
        Returns:
        Column.
      • hasPartitionedTables

        public static boolean hasPartitionedTables​(GridSqlAst ast)
        Parameters:
        ast - Map query AST.
        Returns:
        true If the given AST has partitioned tables.
      • hasSubQueries

        public static boolean hasSubQueries​(GridSqlSelect qry)
        Check whether the given SELECT has subqueries.
        Parameters:
        qry - Query.
        Returns:
        True if subqueries are found.