You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the statement is executed, I get a cast exception: class [Ljava.lang.Double; cannot be cast to class [D ([Ljava.lang.Double; and [D are in module java.base of loader 'bootstrap')
I read the code and the cause comes from the class ClickHouseRowBinaryProcessor.MappedFunctions in the method writeArray.
We have this line: double[] array = (double[])value.asObject();
But the result type of value.asObject() is Double[], it can't be cast to double[]
The text was updated successfully, but these errors were encountered:
Thanks @chrix75, it does look like a bug. I'm in the middle of refactoring to better support unsigned types as well as arrays and tuples. I'll definitely fix this and add tests accordingly.
Fixed in PR #1124. It is strongly recommended to use preparedStatement.setObject(<index>, new double[] {1.0D}) rather than createArrayOf to prevent unnecessary overhead from the creation of additional objects.
I've got a table with a column that has type
Array(Nullable(Float64))
.In my Java code, I do something like:
When the statement is executed, I get a cast exception: class [Ljava.lang.Double; cannot be cast to class [D ([Ljava.lang.Double; and [D are in module java.base of loader 'bootstrap')
I read the code and the cause comes from the class
ClickHouseRowBinaryProcessor.MappedFunctions
in the methodwriteArray
.We have this line:
double[] array = (double[])value.asObject();
But the result type of
value.asObject()
isDouble[]
, it can't be cast todouble[]
The text was updated successfully, but these errors were encountered: