cty123 commented on code in PR #52947:
URL: https://github.com/apache/spark/pull/52947#discussion_r2508727520


##########
sql/connect/client/jdbc/src/main/scala/org/apache/spark/sql/connect/client/jdbc/SparkConnectResultSet.scala:
##########
@@ -257,11 +257,17 @@ class SparkConnectResultSet(
   override def getCharacterStream(columnLabel: String): Reader =
     throw new SQLFeatureNotSupportedException
 
-  override def getBigDecimal(columnIndex: Int): java.math.BigDecimal =
-    throw new SQLFeatureNotSupportedException
+  override def getBigDecimal(columnIndex: Int): java.math.BigDecimal = {
+    if (currentRow.isNullAt(columnIndex - 1)) {

Review Comment:
   I just tested, you are right.
   
   1. For every getter function, if the statement is closed, the ResultSet 
should be unusable. I have verified this with MySQL driver and Postgresql 
driver.
   
   2. Right now when index goes out of bound, it throws  
`java.lang.ArrayIndexOutOfBoundsException`, but based on the specification on 
`java.sql.ResultSet` which is implemented by `SparkConnectResultSet` class, it 
should throw `java.sql.SQLException`
   
   ```
        * @throws SQLException if the columnIndex is not valid;
   ```
   
   Maybe we can create a separate jira to fix all the getter functions



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