Fix FullSortingJoinTest.AsofGreaterGeneratedTestData with empty data

This commit is contained in:
vdimir 2024-08-13 12:33:44 +00:00
parent d28e2d7546
commit d2be1bf693
No known key found for this signature in database
GPG Key ID: 6EE4CE2BEDC51862

View File

@ -208,6 +208,12 @@ Block executePipeline(QueryPipeline && pipeline)
template <typename T>
void assertColumnVectorEq(const typename ColumnVector<T>::Container & expected, const Block & block, const std::string & name)
{
if (expected.empty())
{
ASSERT_TRUE(block.columns() == 0);
return;
}
const auto * actual = typeid_cast<const ColumnVector<T> *>(block.getByName(name).column.get());
ASSERT_TRUE(actual) << "unexpected column type: " << block.getByName(name).column->dumpStructure() << "expected: " << typeid(ColumnVector<T>).name();
@ -230,6 +236,12 @@ void assertColumnVectorEq(const typename ColumnVector<T>::Container & expected,
template <typename T>
void assertColumnEq(const IColumn & expected, const Block & block, const std::string & name)
{
if (expected.empty())
{
ASSERT_TRUE(block.columns() == 0);
return;
}
const ColumnPtr & actual = block.getByName(name).column;
ASSERT_TRUE(checkColumn<T>(*actual));
ASSERT_TRUE(checkColumn<T>(expected));