Module: SparkConnect::Window

Defined in:
lib/spark_connect/window.rb

Overview

Factory entry point for building WindowSpecs. Mirrors PySpark's Window.

Constant Summary collapse

UNBOUNDED_PRECEDING =
WindowSpec::UNBOUNDED_PRECEDING
UNBOUNDED_FOLLOWING =
WindowSpec::UNBOUNDED_FOLLOWING
CURRENT_ROW =
WindowSpec::CURRENT_ROW

Class Method Summary collapse

Class Method Details

.order_by(*cols) ⇒ WindowSpec

Returns ordered by the given columns.

Returns:



105
106
107
# File 'lib/spark_connect/window.rb', line 105

def order_by(*cols)
  WindowSpec.new.order_by(*cols)
end

.partition_by(*cols) ⇒ WindowSpec

Returns partitioned by the given columns.

Returns:

  • (WindowSpec)

    partitioned by the given columns.



100
101
102
# File 'lib/spark_connect/window.rb', line 100

def partition_by(*cols)
  WindowSpec.new.partition_by(*cols)
end

.range_between(start_, end_) ⇒ WindowSpec

Returns with a range-based frame.

Returns:



115
116
117
# File 'lib/spark_connect/window.rb', line 115

def range_between(start_, end_)
  WindowSpec.new.range_between(start_, end_)
end

.rows_between(start_, end_) ⇒ WindowSpec

Returns with a row-based frame.

Returns:



110
111
112
# File 'lib/spark_connect/window.rb', line 110

def rows_between(start_, end_)
  WindowSpec.new.rows_between(start_, end_)
end