Class Over


  • @PublicEvolving
    public final class Over
    extends Object
    Helper class for creating an over window. Similar to SQL, over window aggregates compute an aggregate for each input row over a range of its neighboring rows.

    Java Example:

    
     Over.partitionBy("a").orderBy("rowtime").preceding("unbounded_range").as("w")
     

    Scala Example:

    
     Over partitionBy 'a orderBy 'rowtime preceding UNBOUNDED_RANGE as 'w
     
    • Constructor Detail

      • Over

        public Over()
    • Method Detail

      • partitionBy

        public static OverWindowPartitioned partitionBy​(org.apache.flink.table.expressions.Expression... partitionBy)
        Partitions the elements on some partition keys.

        Each partition is individually sorted and aggregate functions are applied to each partition separately.

        Parameters:
        partitionBy - list of field references
        Returns:
        an over window with defined partitioning
      • orderBy

        public static OverWindowPartitionedOrdered orderBy​(org.apache.flink.table.expressions.Expression orderBy)
        Specifies the time attribute on which rows are ordered.

        For streaming tables, reference a rowtime or proctime time attribute here to specify the time mode.

        For batch tables, refer to a timestamp or long attribute.

        Parameters:
        orderBy - field reference
        Returns:
        an over window with defined order