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

Re: [PR] [SPARK-52931][Core] Restrict declare variable naming [spark]

dusantism-db commented on code in PR #51669:
URL: https://github.com/apache/spark/pull/51669#discussion_r2247525095


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/ParserUtils.scala:
##########
@@ -411,12 +411,15 @@ class SqlScriptingLabelContext {
 
 }
 
-object SqlScriptingLabelContext {
-  private val forbiddenLabelNames: immutable.Set[Regex] =
+object SqlScriptingParsingContext {
+  private val forbiddenNames: immutable.Set[Regex] =
     immutable.Set("builtin".r, "session".r, "sys.*".r)
 
-  def isForbiddenLabelOrForVariableName(labelName: String): Boolean = {
-    forbiddenLabelNames.exists(_.matches(labelName.toLowerCase(Locale.ROOT)))
+  /**
+   * Used for enforcing names of Labels, FOR variables, and temporary variables

Review Comment:
   nit: session variables are also referred to as temporary variables. Please change the comment to local variables to avoid confusion.



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