You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "mihailotim-db (via GitHub)" <gi...@apache.org> on 2025/11/20 09:30:42 UTC

Re: [PR] [SPARK-54417][SQL] Fix error message for scalar subquery in IDENTIFIER clause [spark]

mihailotim-db commented on code in PR #53133:
URL: https://github.com/apache/spark/pull/53133#discussion_r2545089344


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala:
##########
@@ -340,6 +340,12 @@ trait CheckAnalysis extends LookupCatalog with QueryErrorsBase with PlanToString
           errorClass = "UNSUPPORTED_FEATURE.OVERWRITE_BY_SUBQUERY",
           messageParameters = Map.empty)
 
+      case p: PlanWithUnresolvedIdentifier if !p.identifierExpr.resolved =>
+        p.identifierExpr.failAnalysis(
+          errorClass = "NOT_A_CONSTANT_STRING.NOT_CONSTANT",

Review Comment:
   The issue with adding a new error message in the format you propose is that we create a dependency for available features. So if we add to this list, we would also have to update the error message.
   
   That being said, I was thinking of creating a separate exception for this case but they all ended up being something like `Couldn't resolve identifier, identifier needs to be a constant string`. So I decided to leave this exception as the same one is thrown from `IdentifierResolution.evalIdentifierExpr`



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