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


##########
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:
   How about to put the condition check to a separate function, see 
`isMapWithStringKey` above for instance. This could improve readability, 
probably.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to