mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Merge pull request #57099 from ClickHouse/analyzer-fuzz-3
Analyzer fuzzer 3 (aggregate_functions_null_for_empty for projections)
This commit is contained in:
commit
5430ac2c02
@ -291,9 +291,15 @@ void ProjectionDescription::recalculateWithNewColumns(const ColumnsDescription &
|
|||||||
|
|
||||||
Block ProjectionDescription::calculate(const Block & block, ContextPtr context) const
|
Block ProjectionDescription::calculate(const Block & block, ContextPtr context) const
|
||||||
{
|
{
|
||||||
|
auto mut_context = Context::createCopy(context);
|
||||||
|
/// We ignore aggregate_functions_null_for_empty cause it changes aggregate function types.
|
||||||
|
/// Now, projections do not support in on SELECT, and (with this change) should ignore on INSERT as well.
|
||||||
|
mut_context->setSetting("aggregate_functions_null_for_empty", Field(0));
|
||||||
|
mut_context->setSetting("transform_null_in", Field(0));
|
||||||
|
|
||||||
auto builder = InterpreterSelectQuery(
|
auto builder = InterpreterSelectQuery(
|
||||||
query_ast,
|
query_ast,
|
||||||
context,
|
mut_context,
|
||||||
Pipe(std::make_shared<SourceFromSingleChunk>(block)),
|
Pipe(std::make_shared<SourceFromSingleChunk>(block)),
|
||||||
SelectQueryOptions{
|
SelectQueryOptions{
|
||||||
type == ProjectionDescription::Type::Normal ? QueryProcessingStage::FetchColumns
|
type == ProjectionDescription::Type::Normal ? QueryProcessingStage::FetchColumns
|
||||||
|
5
tests/queries/0_stateless/02915_analyzer_fuzz_2.sql
Normal file
5
tests/queries/0_stateless/02915_analyzer_fuzz_2.sql
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
SET aggregate_functions_null_for_empty = 1;
|
||||||
|
--set allow_experimental_analyzer=1;
|
||||||
|
create table t_delete_projection (x UInt32, y UInt64, projection p (select sum(y))) engine = MergeTree order by tuple() SETTINGS index_granularity = 8192, index_granularity_bytes = '10Mi';
|
||||||
|
insert into t_delete_projection select number, toString(number) from numbers(8192 * 10);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user