OffsetWindowFunction Contract — Unevaluable Window Function Expressions
OffsetWindowFunction
is the base of window function expressions that are unevaluable and ImplicitCastInputTypes
.
Note
|
An unevaluable expression cannot be evaluated to produce a value (neither in interpreted nor code-generated expression evaluations) and has to be resolved (replaced) to some other expressions or logical operators at analysis or optimization phases or they fail analysis. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
package org.apache.spark.sql.catalyst.expressions abstract class OffsetWindowFunction ... { // only required properties (vals and methods) that have no implementation // the others follow val default: Expression val direction: SortDirection val input: Expression val offset: Expression } |
Property | Description |
---|---|
|
|
|
|
|
|
|
OffsetWindowFunction
is not foldable.
OffsetWindowFunction
is nullable when the default is not defined or the default or the input expressions are.
When requested for the dataType, OffsetWindowFunction
simply requests the input expression for the data type.
When requested for the inputTypes, OffsetWindowFunction
returns the AnyDataType
, IntegerType with the data type of the input expression and the NullType.
OffsetWindowFunction
uses the following text representation (i.e. toString
):
1 2 3 4 5 |
[prettyName]([input], [offset], [default]) |
OffsetWindowFunction | Description |
---|---|
Lag |
|
Lead |
frame
Lazy Property
1 2 3 4 5 |
frame: WindowFrame |
Note
|
frame is part of the WindowFunction Contract to define the WindowFrame for function expression execution.
|
frame
…FIXME
Verifying Input Data Types — checkInputDataTypes
Method
1 2 3 4 5 |
checkInputDataTypes(): TypeCheckResult |
Note
|
checkInputDataTypes is part of the Expression Contract to verify (check the correctness of) the input data types.
|
checkInputDataTypes
…FIXME