You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/01/12 05:09:11 UTC
[GitHub] [spark] beliefer commented on a change in pull request #31143: [SPARK-28646][SQL][FOLLOWUP] Add legacy config for allowing parameterless count
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org