Class AnalyticQuery


  • public final class AnalyticQuery
    extends Object
    A class representing an analytic query similar to the Over or Window clause in SQL.
    • Method Detail

      • numberingQuery

        @Beta
        public static AnalyticQuerySteps.NumberingQuerySteps.FromStep numberingQuery()
        Entry point for the fluent Numbering Query Builder.

        A numbering assigns integer values to each row based on their position within the specified partition. Numbering queries require Order By.

         Query includes steps for:
         FROM table_name
         [ PARTITION BY col1, col2...]
         ORDER BY
         argument_list AnalyticQuerySteps.NumberingFunctions
         
        Returns:
        a fluent numbering query builder.
      • getTable

        public Table getTable()
        The Table behind the query.
        Returns:
        the underlying Table behind this query.
      • toSqlLikeString

        public String toSqlLikeString()
        Creates a SQL like string for documentation purposes. The returned SQL is not meant be executed in SQL database.
        Returns:
        a SQL like string explaining the query.
      • execute

        public Table execute()
        Executes the query adding all the calculated columns to a new table. The result columns will have the same order as the from table.
        Returns:
        a new table containing only the result columns.
      • executeInPlace

        public void executeInPlace()
        Executes the query and adds all the calculated columns directly to the source table.
        Throws:
        IllegalArgumentException - if any of the calculated columns have the same name as one of the columns in the FROM table.