Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/21082#discussion_r193323738
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/windowExpressions.scala
---
@@ -297,6 +297,37 @@ trait WindowFunction extends Expression {
def frame: WindowFrame = UnspecifiedFrame
}
+/**
+ * Case objects that describe whether a window function is a SQL window
function or a Python
+ * user-defined window function.
+ */
+sealed trait WindowFunctionType
+
+object WindowFunctionType {
+ case object SQL extends WindowFunctionType
+ case object Python extends WindowFunctionType
+
+ def functionType(windowExpression: NamedExpression): WindowFunctionType
= {
+ val t = windowExpression.collectFirst {
+ case _: WindowFunction | _: AggregateFunction => SQL
+ case udf: PythonUDF if PythonUDF.isWindowPandasUDF(udf) => Python
+ }
+
+ // Normally a window expression would either have either a SQL window
function, a SQL
--- End diff --
`either have either` ... :-).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]