WindowOptions#

public class WindowOptions implements AutoCloseable#

Options for rolling windows.

Method Summary

Methods

public boolean equals(Object other)#
public int hashCode()#
public WindowOptions incRefCount()#
public void close()#

Static Methods

public static Builder builder()#
public static class Builder#

Method Summary

build()

currentRowFollowing()

currentRowPreceding()

following(Scalar following)

Set the relative number following the current row for range window.

minPeriods(int minPeriods)

Set the minimum number of observation required to evaluate an element.

orderByAscending()

orderByColumnIndex(int index)

orderByColumns(int[] indices, boolean[] ascending, boolean[] nullsFirst)

Specify multiple order-by columns for a multi-column RANGE window.

orderByDescending()

preceding(Scalar preceding)

Set the relative number preceding the current row for range window.

timestampAscending()

Deprecated.

timestampColumnIndex(int index)

Deprecated.

timestampDescending()

Deprecated.

unboundedFollowing()

unboundedPreceding()

window(ColumnVector precedingCol, ColumnVector followingCol)

Set the size of the window, one entry per row.

window(Scalar precedingScalar, Scalar followingScalar)

Set the size of the range window.

Methods

public Builder minPeriods(int minPeriods)#

Set the minimum number of observation required to evaluate an element.

If there are not enough elements for a given window a null is placed in the result instead.

public Builder window(
ColumnVector precedingCol,
ColumnVector followingCol
)#

Set the size of the window, one entry per row.

This does not take ownership of the columns passed in so you have to be sure that the lifetime of the column outlives this operation.

Parameters:
  • precedingCol – the number of rows in the window before and including the current row. precedingCol will be live outside of WindowOptions.

  • followingCol – the number of rows in the window after the current row. followingCol will be live outside of WindowOptions.

public Builder window(Scalar precedingScalar, Scalar followingScalar)#

Set the size of the range window.

This does not take ownership of the scalars passed in so you have to be sure that the lifetime of the scalars outlives this operation.

Parameters:
  • precedingScalar – the number of rows in the window before and including the current row. precedingScalar will be live outside of WindowOptions.

  • followingScalar – the number of rows in the window after the current row. followingScalar will be live outside of WindowOptions.

public Builder timestampColumnIndex(int index) Deprecated#

Deprecated:

Use orderByColumnIndex(int index)

public Builder orderByColumnIndex(int index)#
public Builder orderByColumns(
int[] indices,
boolean[] ascending,
boolean[] nullsFirst
)#

Specify multiple order-by columns for a multi-column RANGE window.

All three arrays must be non-empty and of equal length; entry i describes the i-th order-by column.

Multi-column RANGE windows support only peer-frame bounds (UNBOUNDED and CURRENT_ROW); bounded scalar ranges are not supported across multiple order-by columns. Unlike the single-column order-by methods, null placement is not deduced from the data and must be stated explicitly here. This API is mutually exclusive with the single-column order-by setters; mixing them in one builder is rejected by build().

Parameters:
  • indices – input-table column indices of the order-by columns, in order.

  • ascending – per-column sort direction (true == ascending).

  • nullsFirst – per-column null placement (true == nulls ordered before non-null values).

public Builder timestampAscending() Deprecated#

Deprecated:

Use orderByAscending()

public Builder orderByAscending()#
public Builder orderByDescending()#
public Builder timestampDescending() Deprecated#

Deprecated:

Use orderByDescending()

public Builder currentRowPreceding()#
public Builder currentRowFollowing()#
public Builder unboundedPreceding()#
public Builder unboundedFollowing()#
public Builder preceding(Scalar preceding)#

Set the relative number preceding the current row for range window.

Returns:

this for chaining

public Builder following(Scalar following)#

Set the relative number following the current row for range window.

Returns:

this for chaining

public WindowOptions build()#