pan3793 commented on code in PR #56341:
URL: https://github.com/apache/spark/pull/56341#discussion_r3361710248


##########
sql/connect/client/jdbc/src/main/scala/org/apache/spark/sql/connect/client/jdbc/SparkConnectConnection.scala:
##########
@@ -128,8 +131,26 @@ class SparkConnectConnection(val url: String, val info: 
Properties) extends Conn
     throw new SQLFeatureNotSupportedException
 
   override def createStatement(
-      resultSetType: Int, resultSetConcurrency: Int): Statement =
-    throw new SQLFeatureNotSupportedException
+      resultSetType: Int, resultSetConcurrency: Int): Statement = {
+    checkSupportedResultSet(resultSetType, resultSetConcurrency)
+    createStatement()
+  }
+
+  // SCROLL_INSENSITIVE is accepted but the returned statement is forward-only.
+  // Mirrors the Hive JDBC driver policy used by the Spark Thrift Server.
+  private def checkSupportedResultSet(
+      resultSetType: Int, resultSetConcurrency: Int): Unit = {
+    if (resultSetConcurrency != ResultSet.CONCUR_READ_ONLY) {
+      throw new SQLFeatureNotSupportedException(
+        s"ResultSet concurrency $resultSetConcurrency is not supported; " +
+          "only CONCUR_READ_ONLY.")

Review Comment:
   `resultSetConcurrency` is an int, you should stringify it to a readable 
string, see `JdbcErrorUtils.stringify*` methods



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