LuciferYang commented on code in PR #40120:
URL: https://github.com/apache/spark/pull/40120#discussion_r1114005961
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/windowExpressions.scala:
##########
@@ -517,6 +517,10 @@ case class Lead(
input: Expression, offset: Expression, default: Expression, ignoreNulls:
Boolean)
extends FrameLessOffsetWindowFunction with TernaryLike[Expression] {
+ def this(
Review Comment:
without this change, `function_lead` in `ProtoToParsedPlanTestSuite` will
failed as follows:
```
- function_lead *** FAILED ***
org.apache.spark.sql.AnalysisException:
[WRONG_NUM_ARGS.WITHOUT_SUGGESTION] The `lead` requires [0, 1, 2, 3] parameters
but the actual number is 4. Please, refer to
'https://spark.apache.org/docs/latest/sql-ref-functions.html' for a fix.
at
org.apache.spark.sql.errors.QueryCompilationErrors$.wrongNumArgsError(QueryCompilationErrors.scala:681)
at
org.apache.spark.sql.catalyst.analysis.FunctionRegistryBase$.$anonfun$build$7(FunctionRegistry.scala:143)
at scala.Option.getOrElse(Option.scala:189)
at
org.apache.spark.sql.catalyst.analysis.FunctionRegistryBase$.$anonfun$build$4(FunctionRegistry.scala:139)
at
org.apache.spark.sql.catalyst.analysis.FunctionRegistry$.$anonfun$expression$1(FunctionRegistry.scala:875)
at
org.apache.spark.sql.catalyst.analysis.SimpleFunctionRegistryBase.lookupFunction(FunctionRegistry.scala:233)
at
org.apache.spark.sql.catalyst.analysis.SimpleFunctionRegistryBase.lookupFunction$(FunctionRegistry.scala:227)
at
org.apache.spark.sql.catalyst.analysis.SimpleFunctionRegistry.lookupFunction(FunctionRegistry.scala:299)
at
org.apache.spark.sql.catalyst.catalog.SessionCatalog.$anonfun$resolveBuiltinOrTempFunctionInternal$1(SessionCatalog.scala:1644)
at
org.apache.spark.sql.catalyst.catalog.SessionCatalog.lookupTempFuncWithViewContext(SessionCatalog.scala:1654)
...
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]