-
Notifications
You must be signed in to change notification settings - Fork 619
Closed
Labels
action:verifyarea:data-typedata type processing issuesdata type processing issuesenhancementjdbc-v1JDBC driverJDBC driver
Description
When I insert Float.MAX_VALUE into table column with Float64 type, it seems cannot store the correct precision!
reproduct:
-
jdbc version:
0.2.4/0.3.2-patch2
clickhouse version:21.3.5.42 -
create table:
CREATE TABLE default.`TEST_Boundary` ( `byte` Int32, `double1` Nullable(Float64), `double2` Nullable(Float64) ) ENGINE = MergeTree ORDER BY byte SETTINGS index_granularity = 8192;
-
insert value using jdbc
PreparedStatement preparedStatement = ckConnection .prepareStatement("insert into default.`TEST_Boundary` values(1, ?, ?)"); preparedStatement.setObject(1, Float.MAX_VALUE); preparedStatement.setObject(2, Double.MAX_VALUE); preparedStatement.addBatch(); preparedStatement.executeBatch();
-
select using jdbc
1 3.4028235000000003E38 1.7976931348623157E308
We can find that Double.MAX_VALUE can be stored correctly, but Float.MAX_VALUE cannot(should be 3.4028235E38).
Is it a jdbc bug? or it is a clickhouse issue?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
action:verifyarea:data-typedata type processing issuesdata type processing issuesenhancementjdbc-v1JDBC driverJDBC driver