dongjoon-hyun commented on a change in pull request #27803: [SPARK-31049][SQL] 
Support nested adjacent generators, e.g., explode(explode(v))
URL: https://github.com/apache/spark/pull/27803#discussion_r390676744
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
 ##########
 @@ -2286,24 +2304,66 @@ class Analyzer(
         // Holds the resolved generator, if one exists in the project list.
         var resolvedGenerator: Generate = null
 
+        def createGenerate(g: Generator, outer: Boolean, names: Seq[String], 
child: LogicalPlan) = {
+          Generate(
+            g,
+            unrequiredChildIndex = Nil,
+            outer = outer,
+            qualifier = None,
+            generatorOutput = ResolveGenerate.makeGeneratorOutput(g, names),
+            child)
+        }
+
         val newProjectList = projectList
           
.map(CleanupAliases.trimNonTopLevelAliases(_).asInstanceOf[NamedExpression])
           .flatMap {
-            case AliasedGenerator(generator, names, outer) if 
generator.childrenResolved =>
+            case AliasedGenerator(generator, names, outer) =>
               // It's a sanity check, this should not happen as the previous 
case will throw
               // exception earlier.
               assert(resolvedGenerator == null, "More than one generator found 
in SELECT.")
 
-              resolvedGenerator =
-                Generate(
-                  generator,
-                  unrequiredChildIndex = Nil,
-                  outer = outer,
-                  qualifier = None,
-                  generatorOutput = 
ResolveGenerate.makeGeneratorOutput(generator, names),
-                  child)
+              if (hasInnerGenerator(generator)) {
+                // The case of multiple nested inner generators
+                def collectAdjacentGenerators(children: Seq[Expression])
 
 Review comment:
   This one too?

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

Reply via email to