WindowOptions#
- public class WindowOptions implements AutoCloseable#
Options for rolling windows.
Method Summary
- public static class Builder#
Method Summary
Set the relative number following the current row for range window.
Set the minimum number of observation required to evaluate an element.
orderByColumns(int[] indices, boolean[] ascending, boolean[] nullsFirst)Specify multiple order-by columns for a multi-column RANGE window.
Set the relative number preceding the current row for range window.
Deprecated.
Deprecated.
Deprecated.
window(ColumnVector precedingCol, ColumnVector followingCol)Set the size of the window, one entry per row.
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 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
idescribes the i-th order-by column.Multi-column RANGE windows support only peer-frame bounds (
UNBOUNDEDandCURRENT_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 bybuild().- 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 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()#