srielau commented on code in PR #53530:
URL: https://github.com/apache/spark/pull/53530#discussion_r2695133681


##########
sql/core/src/main/scala/org/apache/spark/sql/scripting/SqlScriptingExecutionContext.scala:
##########
@@ -53,6 +55,108 @@ class SqlScriptingExecutionContext extends 
SqlScriptingExecutionContextExtension
   def currentFrame: SqlScriptingExecutionFrame = frames.last
   def currentScope: SqlScriptingExecutionScope = currentFrame.currentScope
 
+  /**
+   * Find a cursor by its normalized name in the current scope and parent 
scopes.
+   * Implementation of SqlScriptingExecutionContextExtension API.
+   *
+   * Searches current frame first (respects shadowing), then script frame (for 
cross-frame access).
+   * This ensures cursors declared in handlers shadow cursors with the same 
name in the script.
+   */
+  override def findCursorByName(normalizedName: String): 
Option[CursorDefinition] = {

Review Comment:
   @davidm-db How are cursors behving differently than variables?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to