Interface Window<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.groovy.ginq.provider.collection.runtime.Queryable
Queryable.Order<T,U extends Comparable<? super U>>
-
-
Field Summary
-
Fields inherited from interface org.apache.groovy.ginq.provider.collection.runtime.Queryable
EMPTY_QUERYABLE, NULL
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description BigDecimal
cumeDist()
Returns the cumulative distribution of a value in the windowLong
denseRank()
Returns the dense rank in the window<V> V
firstValue(Function<? super T,? extends V> extractor)
Returns the first value in the windowdefault <V> V
lag(Function<? super T,? extends V> extractor)
Returns the previous value in the window, similar to SQL'slag()
default <V> V
lag(Function<? super T,? extends V> extractor, long lag)
Returns the previous value in the window, similar to SQL'slag()
<V> V
lag(Function<? super T,? extends V> extractor, long lag, V def)
Returns the previous value bylag
in the window, similar to SQL'slag()
<V> V
lastValue(Function<? super T,? extends V> extractor)
Returns the last value in the windowdefault <V> V
lead(Function<? super T,? extends V> extractor)
Returns the next value in the window, similar to SQL'slead()
default <V> V
lead(Function<? super T,? extends V> extractor, long lead)
Returns the next value in the window, similar to SQL'slead()
<V> V
lead(Function<? super T,? extends V> extractor, long lead, V def)
Returns the next value bylead
in the window, similar to SQL'slead()
<V> V
nthValue(Function<? super T,? extends V> extractor, long index)
Returns the nth value in the windowlong
ntile(long bucketCnt)
Distributes rows of an ordered window into a pre-defined number of roughly equal bucketsBigDecimal
percentRank()
Returns the percent rank in the windowLong
rank()
Returns the rank in the windowlong
rowNumber()
Returns row number in the window, similar to SQL'srow_number()
-
Methods inherited from interface org.apache.groovy.ginq.provider.collection.runtime.Queryable
agg, avg, count, count, crossJoin, distinct, exists, fullHashJoin, fullJoin, groupBy, groupBy, innerHashJoin, innerJoin, intersect, leftHashJoin, leftJoin, limit, limit, max, median, min, minus, orderBy, orderBy, over, rightHashJoin, rightJoin, select, size, stdev, stdevp, stream, sum, toList, union, unionAll, var, varp, where
-
-
-
-
Method Detail
-
rowNumber
long rowNumber()
Returns row number in the window, similar to SQL'srow_number()
- Returns:
- the row number
- Since:
- 4.0.0
-
lead
default <V> V lead(Function<? super T,? extends V> extractor)
Returns the next value in the window, similar to SQL'slead()
- Type Parameters:
V
- the type of field- Parameters:
extractor
- field extractor- Returns:
- the next value
- Since:
- 4.0.0
-
lead
default <V> V lead(Function<? super T,? extends V> extractor, long lead)
Returns the next value in the window, similar to SQL'slead()
- Type Parameters:
V
- the type of field- Parameters:
extractor
- field extractorlead
- the offset- Returns:
- the next value
- Since:
- 4.0.0
-
lead
<V> V lead(Function<? super T,? extends V> extractor, long lead, V def)
Returns the next value bylead
in the window, similar to SQL'slead()
- Type Parameters:
V
- the type of field- Parameters:
extractor
- field extractorlead
- the offsetdef
- the default value- Returns:
- the next value by
lead
- Since:
- 4.0.0
-
lag
default <V> V lag(Function<? super T,? extends V> extractor)
Returns the previous value in the window, similar to SQL'slag()
- Type Parameters:
V
- the type of field- Parameters:
extractor
- field extractor- Returns:
- the previous value
- Since:
- 4.0.0
-
lag
default <V> V lag(Function<? super T,? extends V> extractor, long lag)
Returns the previous value in the window, similar to SQL'slag()
- Type Parameters:
V
- the type of field- Parameters:
extractor
- field extractorlag
- the offset- Returns:
- the previous value
- Since:
- 4.0.0
-
lag
<V> V lag(Function<? super T,? extends V> extractor, long lag, V def)
Returns the previous value bylag
in the window, similar to SQL'slag()
- Type Parameters:
V
- the type of field- Parameters:
extractor
- field extractorlag
- the offsetdef
- the default value- Returns:
- the previous value by
lag
- Since:
- 4.0.0
-
firstValue
<V> V firstValue(Function<? super T,? extends V> extractor)
Returns the first value in the window- Type Parameters:
V
- the type of field- Parameters:
extractor
- field extractor- Returns:
- the first value
- Since:
- 4.0.0
-
lastValue
<V> V lastValue(Function<? super T,? extends V> extractor)
Returns the last value in the window- Type Parameters:
V
- the type of field- Parameters:
extractor
- field extractor- Returns:
- the last value
- Since:
- 4.0.0
-
nthValue
<V> V nthValue(Function<? super T,? extends V> extractor, long index)
Returns the nth value in the window- Type Parameters:
V
- the type of field- Parameters:
extractor
- field extractorindex
- index for value to fetch, starting with0
- Returns:
- the nth value
- Since:
- 4.0.0
-
rank
Long rank()
Returns the rank in the window- Returns:
- the rank
- Since:
- 4.0.0
-
denseRank
Long denseRank()
Returns the dense rank in the window- Returns:
- the dense rank
- Since:
- 4.0.0
-
percentRank
BigDecimal percentRank()
Returns the percent rank in the window- Returns:
- the percent rank
- Since:
- 4.0.0
-
cumeDist
BigDecimal cumeDist()
Returns the cumulative distribution of a value in the window- Returns:
- the cumulative distribution of a value
- Since:
- 4.0.0
-
ntile
long ntile(long bucketCnt)
Distributes rows of an ordered window into a pre-defined number of roughly equal buckets- Parameters:
bucketCnt
- bucket count- Returns:
- bucket index starting with
0
- Since:
- 4.0.0
-
-