You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by xi...@apache.org on 2026/10/19 06:17:12 UTC

(pinot) branch codex/test-audit-jdbc-decimal-error-assertion created (now f8d8aba9ee7)

This is an automated email from the ASF dual-hosted git repository.

xiangfu0 pushed a change to branch codex/test-audit-jdbc-decimal-error-assertion
in repository https://gitbox.apache.org/repos/asf/pinot.git


      at f8d8aba9ee7 Exercise JDBC invalid decimal parsing on a valid row

This branch includes the following new commits:

     new f8d8aba9ee7 Exercise JDBC invalid decimal parsing on a valid row

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


(pinot) 01/01: Exercise JDBC invalid decimal parsing on a valid row

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiangfu0 pushed a commit to branch codex/test-audit-jdbc-decimal-error-assertion
in repository https://gitbox.apache.org/repos/asf/pinot.git

commit f8d8aba9ee7dd7dc00d4c58b23d79b5897e81a26
Author: Xiang Fu <xi...@apache.org>
AuthorDate: Sun Oct 18 23:16:10 2026 -0700

    Exercise JDBC invalid decimal parsing on a valid row
---
 .../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: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org