Closed joceron closed 1 month ago
You can use Array
instead of Tuple
, like this:
connection.createArrayOf(
"Tuple(String, String)",
List(Array("first", "second"), Array("aa", "bb")).toArray[Object]
)
or
connection.createArrayOf(
"Tuple(String, String)",
Array(Array("first", "second"), Array("aa", "bb"))
)
@joceron
Thank you very much @7hong ! That worked
I'm trying to use an Array of Tuple in a PreparedStatement, but somehow while serializing, it seems the Tuple gets combined into a single value. I don't know if it's due to my misunderstanding of how to use the driver, or an actual bug. If it's the first case, I apologize.
I created an example table with this:
And this is my testing code:
When executing that, it goes to
BinaryDataProcessor.ArraySerializer.serialize
, and then I see that at that point so far the serializing goes well:But then when going into
ClickHouseRowBinaryProcessor.TupleSerializer.serialize
later during the execution, it seems that it has combined the whole tuple into a single value:That throws an
IndexOutOfBoundsException
, because (I'm copy&pasting code fromClickHouseRowBinaryProcessor
):There,
tupleValues
, I suppose it's meant to have two values: each of the values of the Tuple. But since it was combined into one (see my second screenshot), in thefor
loop it throws an exception when trying to dotupleValues.get(1)
.Amd I misunderstanding something?