Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ public ArrayValue readArray(ClickHouseColumn column) throws IOException {

public ArrayValue readArrayItem(ClickHouseColumn itemTypeColumn, int len) throws IOException {
ArrayValue array;
if (itemTypeColumn.isNullable()) {
if (itemTypeColumn.isNullable() || itemTypeColumn.getDataType() == ClickHouseDataType.Variant) {
array = new ArrayValue(Object.class, len);
for (int i = 0; i < len; i++) {
array.set(i, readValue(itemTypeColumn));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,18 @@ public void testVariantWithArrays() throws Exception {
"[[a, b], [c, d]]",
"[[e, f], [j, h]]",
});

testVariantWith("arrays", new String[]{"field Array(Variant(String, Int32))"},
new Object[]{
new Object[]{1, 2},
new Object[]{"a", 3},
new Object[]{3, "d"}
},
new String[]{
"[1, 2]",
"[a, 3]",
"[3, d]",
});
}

@Test(groups = {"integration"})
Expand Down
Loading