allisonwang-db commented on a change in pull request #32303:
URL: https://github.com/apache/spark/pull/32303#discussion_r639390074



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala
##########
@@ -174,13 +174,21 @@ trait CheckAnalysis extends PredicateHelper with 
LookupCatalog {
                 hof.failAnalysis(
                   s"cannot resolve '${hof.sql}' due to argument data type 
mismatch: $message")
             }
+          // Check if there are expressions with children containing star 
expressions.
+          case e if e.children.exists(_.isInstanceOf[Star]) =>
+            e.failAnalysis(s"Invalid usage of '*' in expression 
'${e.prettyName}'")
         }
 
         operator transformExpressionsUp {
           case a: Attribute if !a.resolved =>
             val from = 
operator.inputSet.toSeq.map(_.qualifiedName).mkString(", ")
             a.failAnalysis(s"cannot resolve '${a.sql}' given input columns: 
[$from]")
 
+          case s @ UnresolvedStar(Some(target)) =>

Review comment:
       Yup L178 checks invalid star usage inside expressions first, for 
example, `sum(t.*)` and here the unresolved star is not inside any expressions.




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

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