mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
fix functions with sparse arguments
This commit is contained in:
parent
75b0aef03a
commit
c37f1c40be
@ -321,7 +321,7 @@ ColumnPtr IExecutableFunction::execute(const ColumnsWithTypeAndName & arguments,
|
||||
return res->cloneResized(input_rows_count);
|
||||
|
||||
/// If default of sparse column is changed after execution of function, convert to full column.
|
||||
if (!res->isDefaultAt(0))
|
||||
if (!result_type->supportsSparseSerialization() || !res->isDefaultAt(0))
|
||||
{
|
||||
const auto & offsets_data = assert_cast<const ColumnVector<UInt64> &>(*sparse_offsets).getData();
|
||||
return res->createWithOffsets(offsets_data, (*res)[0], input_rows_count, /*shift=*/ 1);
|
||||
|
@ -7,3 +7,9 @@
|
||||
200 84
|
||||
800 167
|
||||
800 167
|
||||
\N
|
||||
\N
|
||||
\N
|
||||
[]
|
||||
[]
|
||||
[]
|
||||
|
@ -32,4 +32,12 @@ SELECT count(v), sum(v) FROM t_sparse_pk WHERE k = 0;
|
||||
SELECT count(v), sum(v) FROM t_full_pk WHERE k = 0;
|
||||
|
||||
SELECT count(v), sum(v) FROM t_sparse_pk WHERE k = 0 OR k = 3 OR k = 7 OR k = 8;
|
||||
SELECT count(v), sum(v) FROM t_full_pk WHERE k = 0 OR k = 3 OR k = 7 OR k = 8;
|
||||
SELECT count(v), sum(v) FROM t_full_pk WHERE k = 0 OR k = 3 OR k = 7 OR k = 8;
|
||||
|
||||
SET force_primary_key = 0;
|
||||
|
||||
SELECT (k = NULL) OR (k = 1000) FROM t_sparse_pk LIMIT 3;
|
||||
SELECT range(k) FROM t_sparse_pk LIMIT 3;
|
||||
|
||||
DROP TABLE IF EXISTS t_sparse_pk;
|
||||
DROP TABLE IF EXISTS t_full_pk;
|
||||
|
Loading…
Reference in New Issue
Block a user