mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 09:10:48 +00:00
Skip null columns while checknig num rows.
This commit is contained in:
parent
61b583ccb9
commit
630872837e
@ -219,11 +219,14 @@ size_t Block::getPositionByName(const std::string & name) const
|
||||
}
|
||||
|
||||
|
||||
void Block::checkNumberOfRows() const
|
||||
void Block::checkNumberOfRows(bool allow_null_columns) const
|
||||
{
|
||||
ssize_t rows = -1;
|
||||
for (const auto & elem : data)
|
||||
{
|
||||
if (!elem.column && allow_null_columns)
|
||||
continue;
|
||||
|
||||
if (!elem.column)
|
||||
throw Exception("Column " + elem.name + " in block is nullptr, in method checkNumberOfRows."
|
||||
, ErrorCodes::SIZES_OF_COLUMNS_DOESNT_MATCH);
|
||||
|
@ -90,7 +90,7 @@ public:
|
||||
size_t columns() const { return data.size(); }
|
||||
|
||||
/// Checks that every column in block is not nullptr and has same number of elements.
|
||||
void checkNumberOfRows() const;
|
||||
void checkNumberOfRows(bool allow_null_columns = false) const;
|
||||
|
||||
/// Approximate number of bytes in memory - for profiling and limits.
|
||||
size_t bytes() const;
|
||||
|
@ -385,7 +385,7 @@ static ColumnPtr replaceLowCardinalityColumnsByNestedAndGetDictionaryIndexes(
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
block.checkNumberOfRows();
|
||||
block.checkNumberOfRows(true);
|
||||
#endif
|
||||
|
||||
return indexes;
|
||||
|
Loading…
Reference in New Issue
Block a user