You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "wangyum (via GitHub)" <gi...@apache.org> on 2024/12/06 08:54:16 UTC

Re: [PR] [SPARK-49349][SQL] Improve error message for LCA with Generate [spark]

wangyum commented on code in PR #48915:
URL: https://github.com/apache/spark/pull/48915#discussion_r1872852332


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala:
##########
@@ -340,6 +340,21 @@ trait CheckAnalysis extends PredicateHelper with LookupCatalog with QueryErrorsB
           // surrounded with single quotes, or there is a typo in the attribute name.
           case GetMapValue(map, key: Attribute) if isMapWithStringKey(map) && !key.resolved =>
             failUnresolvedAttribute(operator, key, "UNRESOLVED_MAP_KEY")
+
+          case e: Expression if e.containsPattern(LATERAL_COLUMN_ALIAS_REFERENCE) &&
+            operator.expressions.exists {
+              case a: Alias
+                  if e.collect { case l: LateralColumnAliasReference => l.nameParts.head }
+                    .contains(a.name) =>
+                a.exists(_.isInstanceOf[Generator])
+              case _ => false
+            } =>

Review Comment:
   fixed.



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