Interface Window<T>
- Type Parameters:
- T- the type of- Windowelement
- All Superinterfaces:
- Queryable<T>
Represents window which stores elements used by window functions
- Since:
- 4.0.0
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.groovy.ginq.provider.collection.runtime.QueryableQueryable.Order<T,U extends Comparable<? super U>> 
- 
Field SummaryFields inherited from interface org.apache.groovy.ginq.provider.collection.runtime.QueryableEMPTY_QUERYABLE, NULL
- 
Method SummaryModifier and TypeMethodDescriptioncumeDist()Returns the cumulative distribution of a value in the windowReturns the dense rank in the window<V> VfirstValue(Function<? super T, ? extends V> extractor) Returns the first value in the windowdefault <V> VReturns the previous value in the window, similar to SQL'slag()default <V> VReturns the previous value in the window, similar to SQL'slag()<V> VReturns the previous value bylagin the window, similar to SQL'slag()<V> VReturns the last value in the windowdefault <V> VReturns the next value in the window, similar to SQL'slead()default <V> VReturns the next value in the window, similar to SQL'slead()<V> VReturns the next value byleadin the window, similar to SQL'slead()<V> VReturns the nth value in the windowlongntile(long bucketCnt) Distributes rows of an ordered window into a pre-defined number of roughly equal bucketsstatic <T,U extends Comparable<? super U>> 
 Window<T>of(Tuple2<T, Long> currentRecord, Partition<Tuple2<T, Long>> partition, WindowDefinition<T, U> windowDefinition) Factory method to createWindowinstanceReturns the percent rank in the windowrank()Returns the rank in the windowlongReturns row number in the window, similar to SQL'srow_number()Methods inherited from interface org.apache.groovy.ginq.provider.collection.runtime.Queryableagg, avg, count, count, crossJoin, distinct, exists, fullHashJoin, fullJoin, groupBy, groupBy, innerHashJoin, innerJoin, intersect, leftHashJoin, leftJoin, limit, limit, list, max, median, min, minus, orderBy, orderBy, over, rightHashJoin, rightJoin, select, size, stdev, stdevp, stream, sum, toList, union, unionAll, var, varp, where
- 
Method Details- 
ofstatic <T,U extends Comparable<? super U>> Window<T> of(Tuple2<T, Long> currentRecord, Partition<Tuple2<T, Long>> partition, WindowDefinition<T, U> windowDefinition) Factory method to createWindowinstance
- 
rowNumberlong rowNumber()Returns row number in the window, similar to SQL'srow_number()- Returns:
- the row number
- Since:
- 4.0.0
 
- 
leadReturns 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
 
- 
leadReturns the next value in the window, similar to SQL'slead()- Type Parameters:
- V- the type of field
- Parameters:
- extractor- field extractor
- lead- the offset
- Returns:
- the next value
- Since:
- 4.0.0
 
- 
leadReturns the next value byleadin the window, similar to SQL'slead()- Type Parameters:
- V- the type of field
- Parameters:
- extractor- field extractor
- lead- the offset
- def- the default value
- Returns:
- the next value by lead
- Since:
- 4.0.0
 
- 
lagReturns 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
 
- 
lagReturns the previous value in the window, similar to SQL'slag()- Type Parameters:
- V- the type of field
- Parameters:
- extractor- field extractor
- lag- the offset
- Returns:
- the previous value
- Since:
- 4.0.0
 
- 
lagReturns the previous value bylagin the window, similar to SQL'slag()- Type Parameters:
- V- the type of field
- Parameters:
- extractor- field extractor
- lag- the offset
- def- the default value
- Returns:
- the previous value by lag
- Since:
- 4.0.0
 
- 
firstValueReturns 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
 
- 
lastValueReturns 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
 
- 
nthValueReturns the nth value in the window- Type Parameters:
- V- the type of field
- Parameters:
- extractor- field extractor
- index- index for value to fetch, starting with- 0
- Returns:
- the nth value
- Since:
- 4.0.0
 
- 
rankLong rank()Returns the rank in the window- Returns:
- the rank
- Since:
- 4.0.0
 
- 
denseRankLong denseRank()Returns the dense rank in the window- Returns:
- the dense rank
- Since:
- 4.0.0
 
- 
percentRankBigDecimal percentRank()Returns the percent rank in the window- Returns:
- the percent rank
- Since:
- 4.0.0
 
- 
cumeDistBigDecimal cumeDist()Returns the cumulative distribution of a value in the window- Returns:
- the cumulative distribution of a value
- Since:
- 4.0.0
 
- 
ntilelong 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
 
 
-