This is an automated email from the ASF dual-hosted git repository.
xiangfu0 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git
The following commit(s) were added to refs/heads/master by this push:
new 0d02adb733b Exercise JDBC invalid decimal parsing on a valid row
(#19935)
0d02adb733b is described below
commit 0d02adb733bd846ea717804592b0239394e5924b
Author: Xiang Fu <[email protected]>
AuthorDate: Tue Oct 20 16:26:53 2026 -0700
Exercise JDBC invalid decimal parsing on a valid row (#19935)
---
.../java/org/apache/pinot/client/PinotResultSetTest.java | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git
a/pinot-clients/pinot-jdbc-client/src/test/java/org/apache/pinot/client/PinotResultSetTest.java
b/pinot-clients/pinot-jdbc-client/src/test/java/org/apache/pinot/client/PinotResultSetTest.java
index 9965bf7e8e3..a483cdb4fcf 100644
---
a/pinot-clients/pinot-jdbc-client/src/test/java/org/apache/pinot/client/PinotResultSetTest.java
+++
b/pinot-clients/pinot-jdbc-client/src/test/java/org/apache/pinot/client/PinotResultSetTest.java
@@ -23,7 +23,6 @@ import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.sql.ResultSetMetaData;
import java.sql.SQLDataException;
-import java.sql.SQLException;
import java.sql.Timestamp;
import java.sql.Types;
import java.util.Arrays;
@@ -45,6 +44,7 @@ import org.testng.annotations.Test;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.expectThrows;
/// Tests deserialization of a ResultSet given hardcoded Pinot results.
@@ -294,12 +294,11 @@ public class PinotResultSetTest {
currentRow++;
}
- // test bad values and make sure exception is thrown
- try {
- pinotResultSet.getBigDecimal(6);
- } catch (SQLException e) {
- Assert.assertTrue(e.getMessage().contains("Unable to fetch BigDecimal
value"));
- }
+ // Read a valid row so the failure comes from parsing the date string as a
decimal.
+ assertTrue(pinotResultSet.first());
+ SQLDataException exception = expectThrows(SQLDataException.class, () ->
pinotResultSet.getBigDecimal(6));
+ assertTrue(exception.getMessage().contains("Unable to fetch BigDecimal
value"));
+ assertEquals(exception.getCause().getClass(), NumberFormatException.class);
}
@Test
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]