cloud-fan commented on code in PR #53530:
URL: https://github.com/apache/spark/pull/53530#discussion_r2660317974


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/v2Commands.scala:
##########
@@ -1927,6 +1927,55 @@ case class SetVariable(
     copy(sourceQuery = newChild)
 }
 
+/**
+ * The logical plan of the DECLARE CURSOR statement.
+ *
+ * The queryText is stored to support both parameterized and non-parameterized 
cursors.
+ * The query is parsed and analyzed when the cursor is declared at execution 
time.
+ *
+ * @param cursorName Name of the cursor
+ * @param queryText The original SQL text of the query (preserves parameter 
markers)
+ * @param asensitive Whether the cursor is ASENSITIVE or INSENSITIVE
+ */
+case class DeclareCursor(
+    cursorName: String,
+    queryText: String,
+    asensitive: Boolean = true) extends LeafCommand
+
+/**
+ * The logical plan of the OPEN cursor command.
+ *
+ * @param nameParts Cursor name parts (unqualified: Seq(name) or qualified: 
Seq(label, name))
+ * @param args Parameter expressions from USING clause
+ * @param paramNames Names for each parameter (empty string "" for positional 
parameters)
+ */
+case class OpenCursor(
+    nameParts: Seq[String],
+    args: Seq[Expression] = Seq.empty,
+    paramNames: Seq[String] = Seq.empty) extends LeafCommand {
+  override lazy val resolved: Boolean = args.forall(_.resolved)

Review Comment:
   shall we add an assert that `args.length` must be equal to 
`paramNames.length`?



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