GitHub user gatorsmile opened a pull request: https://github.com/apache/spark/pull/18338
[SPARK-21129] [SQL] Arguments of SQL function call should not be named expressions ### What changes were proposed in this pull request? Function argument should not be named expressions. It could cause misleading error message. ``` spark-sql> select count(distinct c1, distinct c2) from t1; Error in query: cannot resolve '`distinct`' given input columns: [c1, c2]; line 1 pos 26; 'Project [unresolvedalias('count(c1#30, 'distinct), None)] +- SubqueryAlias t1 +- CatalogRelation `default`.`t1`, org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe, [c1#30, c2#31] ``` After the fix, the error message becomes ``` ``` ### How was this patch tested? Added a test case to parser suite. You can merge this pull request into a Git repository by running: $ git pull https://github.com/gatorsmile/spark parserDistinctAggFunc Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/18338.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #18338 ---- commit bc8e638be95b5c163385e22a9d78012116b307fa Author: Xiao Li <gatorsm...@gmail.com> Date: 2017-06-17T20:04:06Z fix. ---- --- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org