When querying values from Snowflake via jdbc driver snowflake-jdbc-3.12.5.jar, the result is incorrect.
- The table definition in Snowflake:
create table test_dob(DOB DECIMAL(38,3),REL DECIMAL(38,5));
insert into test_dob values(0.99, 0.99);
- Querying values from table 'test_dob' via jdbc driver snowflake-jdbc-3.12.5.jar;
.....
Connection conn = DriverManager.getConnection("jdbc:snowflake://XXXXX.aws.snowflakecomputing.com?db=testdbu", "user", "password");
......
String sql = "select dob,rel from test_dob";
PreparedStatement stmt = conn.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
for (int j = 1; j < rs.getMetaData().getColumnCount() + 1; j++) {
//System.out.print(rs.getString(j) + ",");
System.out.print(rs.getDouble(j) + ",");
}
.......
The querying results are:
0.9900000095367432,0.99,
You can get that the querying value of first column("dob") is incorrect, but the second("rel") is correct.
Is it a bug for driver?