You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "srielau (via GitHub)" <gi...@apache.org> on 2023/09/12 14:39:03 UTC

[GitHub] [spark] srielau commented on a diff in pull request #42888: [SPARK-45132][SQL] Fix IDENTIFIER for function invocation

srielau commented on code in PR #42888:
URL: https://github.com/apache/spark/pull/42888#discussion_r1323148343


##########
sql/core/src/test/resources/sql-tests/analyzer-results/identifier-clause.sql.out:
##########
@@ -187,10 +187,11 @@ Project [coalesce(cast(null as int), 1) AS coalesce(NULL, 1)#x]
 
 
 -- !query
-SELECT IDENTIFIER('abs')(-1)
+SELECT IDENTIFIER('abs')(c1) FROM VALUES(-1) AS T(c1)

Review Comment:
   `scala> spark.sql("SELECT IDENTIFIER(:agg)(c1) FROM VALUES(1), (2) AS T(c1)", args = Map("agg" -> "max"))
   org.apache.spark.sql.catalyst.ExtendedAnalysisException: [UNRESOLVED_COLUMN.WITH_SUGGESTION] A column, variable, or function parameter with name `max` cannot be resolved. Did you mean one of the following? [`c1`].; line 1 pos 7;
   'Project ['max AS (c1)]
   +- SubqueryAlias T
      +- LocalRelation [c1#0]
   `
   
   It appears to have treated (c1) as an alias!



-- 
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: reviews-unsubscribe@spark.apache.org

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