maropu commented on a change in pull request #27750: [SPARK-30998][SQL]
ClassCastException when a generator having nested inner generators
URL: https://github.com/apache/spark/pull/27750#discussion_r386256125
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -2164,10 +2164,19 @@ class Analyzer(
}
private def hasNestedGenerator(expr: NamedExpression): Boolean = {
+ def hasUnsupportedInnerGenerator(g: Generator): Boolean = g match {
+ case go: GeneratorOuter => // The only case that can have an inner
generator
+ hasUnsupportedInnerGenerator(go.child)
+ case _ =>
+ g.children.exists { _.find {
+ case _: Generator => true
+ case _ => false
+ }.isDefined }
+ }
CleanupAliases.trimNonTopLevelAliases(expr) match {
- case UnresolvedAlias(_: Generator, _) => false
Review comment:
haha, yes. Currently, this method only checks exprs like `add(explode(v),
literal(1))`, but does not check exprs like `expolode(explode(v))` handled in
this pr.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]