Skip to content

Commit 4d34bae

Browse files
committed
Fixed test in case if backward_compatibility_lowcardinality_as_wrapped_column is false
1 parent 13c5f8f commit 4d34bae

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

ut/array_of_low_cardinality_tests.cpp

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,19 @@ TEST(ArrayOfLowCardinality, InsertAndQuery) {
8787
client.Insert("array_lc", block);
8888

8989
client.Select("SELECT * FROM array_lc", [&](const Block& bl) {
90-
for (size_t c = 0; c < bl.GetRowCount(); ++c) {
91-
auto col = bl[0]->As<ColumnArray>()->GetAsColumn(c);
92-
for (size_t i = 0; i < col->Size(); ++i) {
93-
auto stringColumn = col->As<ColumnString>();
94-
const auto string = stringColumn->At(i);
95-
90+
for (size_t c = 0; c < bl.GetRowCount(); ++c) {
91+
auto col = bl[0]->As<ColumnArray>()->GetAsColumn(c);
92+
for (size_t i = 0; i < col->Size(); ++i) {
93+
if (auto string_column = col->As<ColumnString>()) {
94+
const auto string = string_column->At(i);
95+
ASSERT_EQ(testData[c][i], string);
96+
} else if (auto lc_string_column = col->As<ColumnLowCardinalityT<ColumnString>>()) {
97+
const auto string = lc_string_column->At(i);
9698
ASSERT_EQ(testData[c][i], string);
99+
} else {
100+
FAIL() << "Unexpected column type: " << col->Type()->GetName();
97101
}
98102
}
99-
}
100-
);
101-
}
103+
}
104+
});
105+
}

0 commit comments

Comments
 (0)