mihailom-db commented on code in PR #47501:
URL: https://github.com/apache/spark/pull/47501#discussion_r1721497683


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala:
##########
@@ -453,12 +467,12 @@ class AstBuilder extends DataTypeAstBuilder
       case table: InsertIntoTableContext =>
         val (relationCtx, options, cols, partition, ifPartitionNotExists, 
byName)
         = visitInsertIntoTable(table)
-        withIdentClause(relationCtx, ident => {
+        withIdentClause(relationCtx, Seq(query), (ident, otherPlans) => {
           val insertIntoStatement = InsertIntoStatement(
             createUnresolvedRelation(relationCtx, ident, options),
             partition,
             cols,
-            query,
+            otherPlans.head,

Review Comment:
   For all the places where we call `.head` we have otherPlans that was defined 
as `Seq(query)`, so it will have exactly one element. But Seq was used, if in 
the future the need for multiple plans is needed.



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