cloud-fan commented on a change in pull request #32832: URL: https://github.com/apache/spark/pull/32832#discussion_r657622253
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala ########## @@ -432,10 +432,26 @@ class Analyzer(override val catalogManager: CatalogManager) case e if !e.resolved => u case g: Generator => MultiAlias(g, Nil) case c @ Cast(ne: NamedExpression, _, _, _) => Alias(c, ne.name)() - case e: ExtractValue => Alias(e, toPrettySQL(e))() + case e: ExtractValue => + val onlyExtract = e.collect { + case _: ExtractValue => true + case _ => false + }.forall(a => a) Review comment: let's write a small function for it: ``` def extractOnly(e: Expression): Boolean = e match { case _: ExtractValue => e.children.forall(extractOnly) case _: Literal => true case _: Attribute => true case _ => false } ``` -- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org