diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/SqlScriptingLogicalPlans.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/SqlScriptingLogicalPlans.scala index 517bb1ead71f1..4faf1f5d26672 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/SqlScriptingLogicalPlans.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/SqlScriptingLogicalPlans.scala @@ -290,7 +290,7 @@ case class ForStatement( override def children: Seq[LogicalPlan] = Seq(query, body) override protected def withNewChildrenInternal( - newChildren: IndexedSeq[LogicalPlan]): LogicalPlan = newChildren match { + newChildren: IndexedSeq[LogicalPlan]): LogicalPlan = newChildren match { case IndexedSeq(query: SingleStatement, body: CompoundBody) => ForStatement(query, variableName, body, label) }