ClickHouse/tests/queries/0_stateless/01593_insert_settings.sql
Azat Khuzhin 3f67e320dd Fix parsing of SETTINGS clause of the INSERT ... SELECT ... SETTINGS query
Before this patch the following query ignores the settings for INSERT:

   insert into test_parallel_insert select * from numbers_mt(65535*2) settings max_insert_threads=10

And the reason is that SETTINGS was parsed by the SELECT parser.
Fix this by push down the SETTINGS from the SELECT to INSERT.

Also note that since INSERT parser does not use ParserQueryWithOutput the
following works:

   insert into test_parallel_insert select * from numbers_mt(65535*2) format Null settings max_insert_threads=10
2020-11-25 22:53:58 +03:00

9 lines
490 B
SQL

drop table if exists data_01593;
create table data_01593 (key Int) engine=MergeTree() order by key partition by key;
insert into data_01593 select * from numbers_mt(10);
-- TOO_MANY_PARTS error
insert into data_01593 select * from numbers_mt(10) settings max_partitions_per_insert_block=1; -- { serverError 252 }
-- settings for INSERT is prefered
insert into data_01593 select * from numbers_mt(10) settings max_partitions_per_insert_block=1 settings max_partitions_per_insert_block=100;