beliefer commented on a change in pull request #31143:
URL: https://github.com/apache/spark/pull/31143#discussion_r555516927



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/Count.scala
##########
@@ -51,8 +52,11 @@ case class Count(children: Seq[Expression]) extends 
DeclarativeAggregate {
   override def dataType: DataType = LongType
 
   override def checkInputDataTypes(): TypeCheckResult = {
-    if (children.isEmpty) {
-      TypeCheckResult.TypeCheckFailure(s"$prettyName requires at least one 
argument.")
+    val conf = SQLConf.get
+    if (children.isEmpty && !conf.getConf(SQLConf.ALLOW_PARAMETERLESS_COUNT)) {

Review comment:
       `if (children.isEmpty && 
!SQLConf.get.getConf(SQLConf.ALLOW_PARAMETERLESS_COUNT)) {`




----------------------------------------------------------------
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]

Reply via email to