cloud-fan commented on code in PR #53530:
URL: https://github.com/apache/spark/pull/53530#discussion_r2660319532
##########
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)
+}
+
+/**
+ * The logical plan of the FETCH cursor command.
+ *
+ * @param nameParts Cursor name parts (unqualified: Seq(name) or qualified:
Seq(label, name))
+ * @param targetVariables Target variables to fetch into
+ */
+case class FetchCursor(
+ nameParts: Seq[String],
+ targetVariables: Seq[Expression]) extends LeafCommand {
+ override lazy val resolved: Boolean = targetVariables.forall(_.resolved)
Review Comment:
I think it's effectively the same as the default implementation, we don't
need this override. Same to `OpenCursor`
--
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]