You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "TeodorDjelic (via GitHub)" <gi...@apache.org> on 2025/08/01 15:18:30 UTC

Re: [PR] [SPARK-52998][Core] Multiple variables inside declare [spark]

TeodorDjelic commented on code in PR #51705:
URL: https://github.com/apache/spark/pull/51705#discussion_r2248242803


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/command/v2/V2CommandStrategy.scala:
##########
@@ -27,8 +27,9 @@ object V2CommandStrategy extends Strategy {
 
   // TODO: move v2 commands to here which are not data source v2 related.
   override def apply(plan: LogicalPlan): Seq[SparkPlan] = plan match {
-    case CreateVariable(ident: ResolvedIdentifier, defaultExpr, replace) =>
-      CreateVariableExec(ident, defaultExpr, replace) :: Nil
+    case CreateVariables(idents: IndexedSeq[LogicalPlan], defaultExpr, replace)
+        if idents.forall(_.isInstanceOf[ResolvedIdentifier]) =>

Review Comment:
   It seems that scala does not support enforcing template type restriction in runtime, and an if guard is needed. It does not even compile because of that without if.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org