srielau commented on code in PR #52173: URL: https://github.com/apache/spark/pull/52173#discussion_r2314727702
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/executeImmediate.scala: ########## @@ -17,190 +17,137 @@ package org.apache.spark.sql.catalyst.analysis -import scala.util.{Either, Left, Right} - -import org.apache.spark.sql.catalyst.expressions.{Alias, Expression, VariableReference} +import org.apache.spark.sql.catalyst.expressions.{Alias, Attribute, Exists, Expression, InSubquery, ListQuery, ScalarSubquery, VariableReference} import org.apache.spark.sql.catalyst.parser.ParseException -import org.apache.spark.sql.catalyst.plans.logical.{CompoundBody, LogicalPlan, SetVariable} +import org.apache.spark.sql.catalyst.plans.logical.{ExecutableDuringAnalysis, LocalRelation, LogicalPlan, SetVariable, UnaryNode} import org.apache.spark.sql.catalyst.rules.Rule import org.apache.spark.sql.catalyst.trees.TreePattern.{EXECUTE_IMMEDIATE, TreePattern} import org.apache.spark.sql.connector.catalog.CatalogManager import org.apache.spark.sql.errors.QueryCompilationErrors -import org.apache.spark.sql.types.StringType /** * Logical plan representing execute immediate query. * - * @param args parameters of query - * @param query query string or variable + * @param queryParam the query expression (first child) + * @param args parameters from USING clause (subsequent children) * @param targetVariables variables to store the result of the query */ case class ExecuteImmediateQuery( + queryParam: Expression, Review Comment: Yes, we do. We also need to check (for now) that it is a constant folding. Really we could actually evaluate the query (and the using clauses) using nested sql() calls. And then pass the output on. But with constant folding we're already ahead of most DBMS I know. -- 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-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org