fix: fix getLong on NUMERIC by rayudu3745 · Pull Request #2420 · googleapis/java-spanner-jdbc (original) (raw)

Updated the getLong getter in JdbcResultSet for GoogleSQL NUMERIC columns to use spanner.getBigDecimal(spannerIndex) instead of getString(). This prevents an IllegalStateException generated by the underlying Spanner library

we call .toBigInteger() on the retrieved BigDecimal value to truncate fractional parts (e.g., 3.14 becomes 3).

Other integer getters (getByte, getShort, getInt) in JdbcResultSet and generic type conversions in JdbcTypeConverter have been updated accordingly