Github user yhuai commented on a diff in the pull request:
https://github.com/apache/spark/pull/7588#discussion_r35185783
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/SqlParser.scala ---
@@ -271,8 +271,7 @@ class SqlParser extends AbstractSparkSQLParser with
DataTypeParser {
lexical.normalizeKeyword(udfName) match {
case "sum" => SumDistinct(exprs.head)
case "count" => CountDistinct(exprs)
- case name => UnresolvedFunction(name, exprs, isDistinct = true)
- case _ => throw new AnalysisException(s"function $udfName does not
support DISTINCT")
+ case _ => UnresolvedFunction(udfName, exprs, isDistinct = true)
--- End diff --
Since we can register a UDAF and use DISTINCT with it, we can just create
an `UnresolvedFunction` at here. If it is actually a built-in aggregate
function and it does not support DISTINCT, we will throw an error later.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]