beliefer commented on a change in pull request #29800:
URL: https://github.com/apache/spark/pull/29800#discussion_r503782816
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/windowExpressions.scala
##########
@@ -327,38 +327,56 @@ object WindowFunctionType {
}
}
-
-/**
- * An offset window function is a window function that returns the value of
the input column offset
- * by a number of rows within the partition. For instance: an
OffsetWindowfunction for value x with
- * offset -2, will get the value of x 2 rows back in the partition.
- */
-abstract class OffsetWindowFunction
- extends Expression with WindowFunction with Unevaluable with
ImplicitCastInputTypes {
+trait OffsetWindowSpec extends Expression {
/**
* Input expression to evaluate against a row which a number of rows below
or above (depending on
- * the value and sign of the offset) the current row.
+ * the value and sign of the offset) the starting row (current row if
isRelative=true, or the
+ * first row of the window frame otherwise).
*/
val input: Expression
+ /**
+ * (Foldable) expression that contains the number of rows between the
starting row (current row
+ * if isRelative=true, or the first row of the window frame otherwise) and
the row where the
+ * input expression is evaluated.
+ */
+ val inputOffset: Expression
+
/**
* Default result value for the function when the `offset`th row does not
exist.
*/
val default: Expression
/**
- * (Foldable) expression that contains the number of rows between the
current row and the row
- * where the input expression is evaluated.
+ * A new expression based on inputOffset, considering the direction of the
`offset`.
+ */
+ val offsetExpr: Expression
Review comment:
OK
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]