Class ImmutableConsistentPartitionWindow

All Implemented Interfaces:
HasExtension, Rel

public final class ImmutableConsistentPartitionWindow extends ConsistentPartitionWindow
Immutable implementation of ConsistentPartitionWindow.

Use the builder to create immutable instances: ImmutableConsistentPartitionWindow.builder().

  • Method Details

    • getExtension

      public Optional<AdvancedExtension> getExtension()
      Returns:
      the AdvancedExtension associated directly with the class
    • getRemap

      public Optional<Rel.Remap> getRemap()
      Returns:
      The value of the remap attribute
    • getCommonExtension

      public Optional<AdvancedExtension> getCommonExtension()
      Returns:
      the AdvancedExtension associated with a RelCommon message, if present
    • getHint

      public Optional<Hint> getHint()
      Returns:
      The value of the hint attribute
    • getInput

      public Rel getInput()
      Specified by:
      getInput in class SingleInputRel
      Returns:
      The value of the input attribute
    • getWindowFunctions

      Returns the window function invocations applied over the input.
      Specified by:
      getWindowFunctions in class ConsistentPartitionWindow
      Returns:
      list of window function invocations
    • getPartitionExpressions

      public List<Expression> getPartitionExpressions()
      Returns the expressions used to partition the input rows.
      Specified by:
      getPartitionExpressions in class ConsistentPartitionWindow
      Returns:
      list of partitioning expressions
    • getSorts

      public List<Expression.SortField> getSorts()
      Returns the sort fields defining row order within each partition.
      Specified by:
      getSorts in class ConsistentPartitionWindow
      Returns:
      list of sort fields
    • withExtension

      public final ImmutableConsistentPartitionWindow withExtension(AdvancedExtension value)
      Copy the current immutable object by setting a present value for the optional extension attribute.
      Parameters:
      value - The value for extension
      Returns:
      A modified copy or this if not changed
    • withExtension

      public final ImmutableConsistentPartitionWindow withExtension(Optional<? extends AdvancedExtension> optional)
      Copy the current immutable object by setting an optional value for the extension attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for extension
      Returns:
      A modified copy or this if not changed
    • withRemap

      public final ImmutableConsistentPartitionWindow withRemap(Rel.Remap value)
      Copy the current immutable object by setting a present value for the optional remap attribute.
      Parameters:
      value - The value for remap
      Returns:
      A modified copy or this if not changed
    • withRemap

      public final ImmutableConsistentPartitionWindow withRemap(Optional<? extends Rel.Remap> optional)
      Copy the current immutable object by setting an optional value for the remap attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for remap
      Returns:
      A modified copy or this if not changed
    • withCommonExtension

      public final ImmutableConsistentPartitionWindow withCommonExtension(AdvancedExtension value)
      Copy the current immutable object by setting a present value for the optional commonExtension attribute.
      Parameters:
      value - The value for commonExtension
      Returns:
      A modified copy or this if not changed
    • withCommonExtension

      public final ImmutableConsistentPartitionWindow withCommonExtension(Optional<? extends AdvancedExtension> optional)
      Copy the current immutable object by setting an optional value for the commonExtension attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for commonExtension
      Returns:
      A modified copy or this if not changed
    • withHint

      public final ImmutableConsistentPartitionWindow withHint(Hint value)
      Copy the current immutable object by setting a present value for the optional hint attribute.
      Parameters:
      value - The value for hint
      Returns:
      A modified copy or this if not changed
    • withHint

      public final ImmutableConsistentPartitionWindow withHint(Optional<? extends Hint> optional)
      Copy the current immutable object by setting an optional value for the hint attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for hint
      Returns:
      A modified copy or this if not changed
    • withInput

      public final ImmutableConsistentPartitionWindow withInput(Rel value)
      Copy the current immutable object by setting a value for the input attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for input
      Returns:
      A modified copy or the this object
    • withWindowFunctions

      Copy the current immutable object with elements that replace the content of windowFunctions.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withWindowFunctions

      Copy the current immutable object with elements that replace the content of windowFunctions. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of windowFunctions elements to set
      Returns:
      A modified copy or this if not changed
    • withPartitionExpressions

      public final ImmutableConsistentPartitionWindow withPartitionExpressions(Expression... elements)
      Copy the current immutable object with elements that replace the content of partitionExpressions.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withPartitionExpressions

      public final ImmutableConsistentPartitionWindow withPartitionExpressions(Iterable<? extends Expression> elements)
      Copy the current immutable object with elements that replace the content of partitionExpressions. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of partitionExpressions elements to set
      Returns:
      A modified copy or this if not changed
    • withSorts

      public final ImmutableConsistentPartitionWindow withSorts(Expression.SortField... elements)
      Copy the current immutable object with elements that replace the content of sorts.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withSorts

      public final ImmutableConsistentPartitionWindow withSorts(Iterable<? extends Expression.SortField> elements)
      Copy the current immutable object with elements that replace the content of sorts. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of sorts elements to set
      Returns:
      A modified copy or this if not changed
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableConsistentPartitionWindow that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: extension, remap, commonExtension, hint, input, windowFunctions, partitionExpressions, sorts.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value ConsistentPartitionWindow with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      Creates an immutable copy of a ConsistentPartitionWindow value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable ConsistentPartitionWindow instance
    • builder

      Creates a builder for ImmutableConsistentPartitionWindow.
       ImmutableConsistentPartitionWindow.builder()
          .extension(Optional<io.substrait.extension.AdvancedExtension>) // optional extension
          .remap(Optional<io.substrait.relation.Rel.Remap>) // optional remap
          .commonExtension(Optional<io.substrait.extension.AdvancedExtension>) // optional commonExtension
          .hint(Optional<io.substrait.hint.Hint>) // optional hint
          .input(io.substrait.relation.Rel) // required input
          .addWindowFunctions|addAllWindowFunctions(io.substrait.relation.ConsistentPartitionWindow.WindowRelFunctionInvocation) // windowFunctions elements
          .addPartitionExpressions|addAllPartitionExpressions(io.substrait.expression.Expression) // partitionExpressions elements
          .addSorts|addAllSorts(io.substrait.expression.Expression.SortField) // sorts elements
          .build();
       
      Returns:
      A new ImmutableConsistentPartitionWindow builder