Fix LimitStep header after limit push down optimization.

This commit is contained in:
Nikolai Kochetov 2021-10-22 16:19:49 +03:00
parent 1e2ceeb2e7
commit 54cc8e1d27
3 changed files with 22 additions and 1 deletions

View File

@ -40,7 +40,7 @@ void LimitStep::updateInputStream(DataStream input_stream)
{
input_streams.clear();
input_streams.emplace_back(std::move(input_stream));
output_stream = createOutputStream(input_streams.front(), output_stream->header, getDataStreamTraits());
output_stream = createOutputStream(input_streams.front(), input_streams.front().header, getDataStreamTraits());
}
void LimitStep::transformPipeline(QueryPipelineBuilder & pipeline, const BuildQueryPipelineSettings &)

View File

@ -0,0 +1,21 @@
drop table if exists tbl_repr;
CREATE TABLE tbl_repr(
ts DateTime,
x String)
ENGINE=MergeTree ORDER BY ts;
SELECT *
FROM
(
SELECT
x,
length(x)
FROM tbl_repr
WHERE ts > now()
LIMIT 1
)
WHERE x != '';
drop table if exists tbl_repr;