cloud-fan commented on a change in pull request #30943:
URL: https://github.com/apache/spark/pull/30943#discussion_r549937413
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -2123,19 +2123,58 @@ class Analyzer(override val catalogManager:
CatalogManager)
if (isDistinct || filter.isDefined) {
throw
QueryCompilationErrors.distinctOrFilterOnlyWithAggregateFunctionError(
wf.prettyName)
+ } else if (ignoreNulls) {
+ wf match {
+ case nthValue: NthValue =>
+ nthValue.copy(ignoreNulls = ignoreNulls)
+ case _ =>
+ throw
QueryCompilationErrors.ignoreNullsWithUnsupportedFunctionError(
+ wf.prettyName)
+ }
} else {
wf
}
+ case owf: FrameLessOffsetWindowFunction =>
+ if (isDistinct || filter.isDefined) {
+ throw
QueryCompilationErrors.distinctOrFilterOnlyWithAggregateFunctionError(
+ owf.prettyName)
+ } else if (ignoreNulls) {
+ owf match {
+ case lead: Lead =>
+ lead.copy(ignoreNulls = ignoreNulls)
+ case lag: Lag =>
+ lag.copy(ignoreNulls = ignoreNulls)
Review comment:
we need to add a catch-all case at the end.
----------------------------------------------------------------
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]