mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-28 18:42:26 +00:00
Add test.
This commit is contained in:
parent
81022aadd4
commit
192fe1fc5b
@ -45,8 +45,8 @@ struct SummingSortedAlgorithm::AggregateDescription
|
||||
AlignedBuffer state;
|
||||
bool created = false;
|
||||
|
||||
/// For LowCardinality, convert is converted to nested type. nested_type is nullptr if no conversion needed.
|
||||
/// This is used only for simple aggregate functions.
|
||||
/// Those types are used only for simple aggregate functions.
|
||||
/// For LowCardinality, convert to nested type. nested_type is nullptr if no conversion needed.
|
||||
DataTypePtr nested_type; /// Nested type for LowCardinality, if it is.
|
||||
DataTypePtr real_type; /// Type in header.
|
||||
|
||||
@ -275,7 +275,7 @@ static SummingSortedAlgorithm::ColumnsDefinition defineColumns(
|
||||
|
||||
desc.real_type = column.type;
|
||||
desc.nested_type = recursiveRemoveLowCardinality(desc.real_type);
|
||||
if (desc.real_type->equals(*desc.nested_type))
|
||||
if (desc.real_type.get() == desc.nested_type.get())
|
||||
desc.nested_type = nullptr;
|
||||
}
|
||||
else if (!is_agg_func)
|
||||
|
@ -0,0 +1,2 @@
|
||||
1 x
|
||||
1 y
|
@ -0,0 +1,21 @@
|
||||
drop table if exists smta;
|
||||
|
||||
CREATE TABLE smta
|
||||
(
|
||||
`k` Int64,
|
||||
`a` AggregateFunction(max, Int64),
|
||||
`city` SimpleAggregateFunction(max, LowCardinality(String))
|
||||
)
|
||||
ENGINE = SummingMergeTree
|
||||
ORDER BY k;
|
||||
|
||||
insert into smta(k, city) values (1, 'x');
|
||||
|
||||
select k, city from smta;
|
||||
|
||||
insert into smta(k, city) values (1, 'y');
|
||||
optimize table smta;
|
||||
|
||||
select k, city from smta;
|
||||
|
||||
drop table if exists smta;
|
Loading…
Reference in New Issue
Block a user