cloud-fan commented on code in PR #51705: URL: https://github.com/apache/spark/pull/51705#discussion_r2255781627
########## sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveCatalogs.scala: ########## @@ -40,35 +40,40 @@ class ResolveCatalogs(val catalogManager: CatalogManager) override def apply(plan: LogicalPlan): LogicalPlan = plan resolveOperatorsDown { // We only support temp variables for now and the system catalog is not properly implemented // yet. We need to resolve `UnresolvedIdentifier` for variable commands specially. - case c @ CreateVariable(UnresolvedIdentifier(nameParts, _), _, _) => - // From scripts we can only create local variables, which must be unqualified, - // and must not be DECLARE OR REPLACE. - val resolved = if (withinSqlScript) { - if (c.replace) { - throw new AnalysisException( - "INVALID_VARIABLE_DECLARATION.REPLACE_LOCAL_VARIABLE", - Map("varName" -> toSQLId(nameParts)) - ) - } - - if (nameParts.length != 1) { - throw new AnalysisException( - "INVALID_VARIABLE_DECLARATION.QUALIFIED_LOCAL_VARIABLE", - Map("varName" -> toSQLId(nameParts))) - } - - SqlScriptingContextManager.get().map(_.getVariableManager) - .getOrElse(throw SparkException.internalError( - "Scripting local variable manager should be present in SQL script.")) - .qualify(nameParts.last) - } else { - val resolvedIdentifier = catalogManager.tempVariableManager.qualify(nameParts.last) - - assertValidSessionVariableNameParts(nameParts, resolvedIdentifier) - resolvedIdentifier + case c @ CreateVariable(plans, _, _) => Review Comment: ```suggestion case c @ CreateVariable(identifiers, _, _) => ``` -- 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