mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 16:50:48 +00:00
fix again
This commit is contained in:
parent
feb3a12d34
commit
c988a4e770
@ -415,8 +415,7 @@ void MergeTreeBaseSelectProcessor::injectVirtualColumns(
|
||||
chunk.setColumns(columns, num_rows);
|
||||
}
|
||||
|
||||
Block MergeTreeBaseSelectProcessor::transformHeader(
|
||||
Block block, const PrewhereInfoPtr & prewhere_info, const DataTypePtr & partition_value_type, const Names & virtual_columns)
|
||||
void MergeTreeBaseSelectProcessor::transformBlockViaPrewhereInfo(Block & block, const PrewhereInfoPtr & prewhere_info)
|
||||
{
|
||||
if (prewhere_info)
|
||||
{
|
||||
@ -460,7 +459,12 @@ Block MergeTreeBaseSelectProcessor::transformHeader(
|
||||
ErrorCodes::ILLEGAL_TYPE_OF_COLUMN_FOR_FILTER);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Block MergeTreeBaseSelectProcessor::transformHeader(
|
||||
Block block, const PrewhereInfoPtr & prewhere_info, const DataTypePtr & partition_value_type, const Names & virtual_columns)
|
||||
{
|
||||
transformBlockViaPrewhereInfo(block, prewhere_info);
|
||||
injectVirtualColumns(block, nullptr, partition_value_type, virtual_columns);
|
||||
return block;
|
||||
}
|
||||
|
@ -42,6 +42,8 @@ public:
|
||||
const MergeTreeReadTaskColumns & task_columns,
|
||||
const Block & sample_block);
|
||||
|
||||
static void transformBlockViaPrewhereInfo(Block & block, const PrewhereInfoPtr & prewhere_info);
|
||||
|
||||
protected:
|
||||
Chunk generate() final;
|
||||
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include <Parsers/parseQuery.h>
|
||||
#include <Parsers/queryToString.h>
|
||||
#include <Storages/AlterCommands.h>
|
||||
#include <Storages/MergeTree/MergeTreeBaseSelectProcessor.h>
|
||||
#include <Storages/MergeTree/MergeTreeDataPartCompact.h>
|
||||
#include <Storages/MergeTree/MergeTreeDataPartInMemory.h>
|
||||
#include <Storages/MergeTree/MergeTreeDataPartWide.h>
|
||||
@ -4480,7 +4481,7 @@ Block MergeTreeData::getMinMaxCountProjectionBlock(
|
||||
}
|
||||
|
||||
size_t pos = 0;
|
||||
for(size_t i : metadata_snapshot->minmax_count_projection->partition_value_indices)
|
||||
for (size_t i : metadata_snapshot->minmax_count_projection->partition_value_indices)
|
||||
{
|
||||
if (i >= part->partition.value.size())
|
||||
throw Exception("Partition value index is out of boundary. It's a bug", ErrorCodes::LOGICAL_ERROR);
|
||||
@ -4788,6 +4789,9 @@ bool MergeTreeData::getQueryProcessingStageWithAggregateProjection(
|
||||
query_info.minmax_count_projection_block = getMinMaxCountProjectionBlock(
|
||||
metadata_snapshot, minmax_conut_projection_candidate->required_columns, query_info, parts, normal_parts, query_context);
|
||||
|
||||
MergeTreeBaseSelectProcessor::transformBlockViaPrewhereInfo(
|
||||
query_info.minmax_count_projection_block, minmax_conut_projection_candidate->prewhere_info);
|
||||
|
||||
if (normal_parts.empty())
|
||||
{
|
||||
selected_candidate = &*minmax_conut_projection_candidate;
|
||||
|
@ -9,3 +9,9 @@
|
||||
1 9999
|
||||
3
|
||||
2021-10-25 10:00:00 2021-10-27 10:00:00 3
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
\N 2021-10-27 10:00:00 4
|
||||
2021-10-24 10:00:00
|
||||
|
@ -49,4 +49,10 @@ drop table if exists d;
|
||||
create table d (dt DateTime, j int) engine MergeTree partition by (toDate(dt), ceiling(j), toDate(dt), CEILING(j)) order by tuple();
|
||||
insert into d values ('2021-10-24 10:00:00', 10), ('2021-10-25 10:00:00', 10), ('2021-10-26 10:00:00', 10), ('2021-10-27 10:00:00', 10);
|
||||
select min(dt), max(dt), count() from d where toDate(dt) >= '2021-10-25';
|
||||
select count() from d group by toDate(dt);
|
||||
|
||||
-- fuzz crash
|
||||
SELECT pointInEllipses(min(j), NULL), max(dt), count('0.0000000007') FROM d WHERE toDate(dt) >= '2021-10-25';
|
||||
SELECT min(dt) FROM d PREWHERE ceil(j) <= 0;
|
||||
|
||||
drop table d;
|
||||
|
Loading…
Reference in New Issue
Block a user