mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
dbms: better [#METR-19266]
This commit is contained in:
parent
2514b2a04c
commit
44aa30fedf
@ -1,7 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <DB/Columns/ColumnConst.h>
|
||||
|
||||
#include <DB/DataTypes/DataTypeNullable.h>
|
||||
#include <DB/DataTypes/DataTypesNumberFixed.h>
|
||||
#include <DB/DataStreams/IProfilingBlockInputStream.h>
|
||||
|
||||
|
||||
@ -41,7 +42,15 @@ protected:
|
||||
auto & src = res.getByPosition(i).column;
|
||||
ColumnPtr converted = src->convertToFullColumnIfConst();
|
||||
if (converted)
|
||||
{
|
||||
src = converted;
|
||||
auto & type = res.getByPosition(i).type;
|
||||
if (type.get()->isNull())
|
||||
{
|
||||
/// A ColumnNull that is converted to a full column has the type DataTypeUInt8.
|
||||
type = std::make_shared<DataTypeNullable>(std::make_shared<DataTypeUInt8>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
|
@ -1,6 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <DB/Columns/ColumnConst.h>
|
||||
#include <DB/DataTypes/DataTypeNullable.h>
|
||||
#include <DB/DataTypes/DataTypesNumberFixed.h>
|
||||
#include <DB/DataStreams/IBlockOutputStream.h>
|
||||
#include <ext/range.hpp>
|
||||
|
||||
@ -42,7 +44,15 @@ private:
|
||||
auto & src = block.getByPosition(i).column;
|
||||
ColumnPtr converted = src->convertToFullColumnIfConst();
|
||||
if (converted)
|
||||
{
|
||||
src = converted;
|
||||
auto & type = block.getByPosition(i).type;
|
||||
if (type.get()->isNull())
|
||||
{
|
||||
/// A ColumnNull that is converted to a full column has the type DataTypeUInt8.
|
||||
type = std::make_shared<DataTypeNullable>(std::make_shared<DataTypeUInt8>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return block;
|
||||
|
@ -404,19 +404,8 @@ Block Block::extractNonNullableBlock(const ColumnNumbers & arguments) const
|
||||
auto nullable_col = static_cast<const ColumnNullable *>(col.column.get());
|
||||
ColumnPtr nested_col = nullable_col->getNestedColumn();
|
||||
|
||||
DataTypePtr nested_type;
|
||||
|
||||
if (col.type.get()->isNull())
|
||||
{
|
||||
/// A ColumnNull that is converted to a full column has the type DataTypeUInt8.
|
||||
nested_type = std::make_shared<DataTypeUInt8>();
|
||||
}
|
||||
else
|
||||
{
|
||||
auto nullable_type = static_cast<const DataTypeNullable *>(col.type.get());
|
||||
nested_type = nullable_type->getNestedType();
|
||||
|
||||
}
|
||||
auto nullable_type = static_cast<const DataTypeNullable *>(col.type.get());
|
||||
DataTypePtr nested_type = nullable_type->getNestedType();
|
||||
|
||||
non_nullable_block.insert(pos, {nested_col, nested_type, col.name});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user