Commit Graph

103 Commits

Author SHA1 Message Date
Amos Bird
2a28c127eb
Better code for real 2020-12-18 14:13:59 +08:00
Azat Khuzhin
5b3ab48861 More forward declaration for generic headers
The following headers are pretty generic, so use forward declaration as
much as possible:
- Context.h
- Settings.h
- ConnectionTimeouts.h
(Also this shows that some missing some includes -- this has been fixed)

And split ConnectionTimeouts.h into ConnectionTimeoutsContext.h (since
module part cannot be added for it, due to recursive build dependencies
that will be introduced)

Also remove Settings from the RemoteBlockInputStream/RemoteQueryExecutor
and just pass the context, since settings was passed only in speicifc
places, that can allow making a copy of Context (i.e. Copier).

Approx results (How much units will be recompiled after changing file X?):

- ConnectionTimeouts.h
  - mainline: 100

- Context.h:
  - mainline: ~800
  - patched:  415

- Settings.h:
  - mainline: 900-1K
  - patched:  440 (most of them because of the Context.h)
2020-12-12 17:43:10 +03:00
Vasily Nemkov
70ea507dae OPTIMIZE DEDUPLICATE BY columns
Extended OPTIMIZE ... DEDUPLICATE syntax to allow explicit (or implicit with asterisk/column transformers) list of columns to check for duplicates on.

Following syntax variants are now supported:

OPTIMIZE TABLE table DEDUPLICATE; -- the old one
OPTIMIZE TABLE table DEDUPLICATE BY *;
OPTIMIZE TABLE table DEDUPLICATE BY * EXCEPT colX;
OPTIMIZE TABLE table DEDUPLICATE BY * EXCEPT (colX, colY);
OPTIMIZE TABLE table DEDUPLICATE BY col1,col2,col3;
OPTIMIZE TABLE table DEDUPLICATE BY COLUMNS('column-matched-by-regex');
OPTIMIZE TABLE table DEDUPLICATE BY COLUMNS('column-matched-by-regex') EXCEPT colX;
OPTIMIZE TABLE table DEDUPLICATE BY COLUMNS('column-matched-by-regex') EXCEPT (colX, colY);

Note that * behaves just like in SELECT: MATERIALIZED, and ALIAS columns are not used for expansion.
Also, it is an error to specify empty list of columns, or write an expression that results in an empty list of columns, or deduplicate by an ALIAS column.
Column transformers other than EXCEPT are not supported.
2020-12-07 09:44:07 +03:00
Alexander Kuzmenkov
412c2fe079 Merge remote-tracking branch 'origin/master' into HEAD 2020-11-23 19:51:18 +03:00
Nikolai Kochetov
13eceff55c Remove Converting transform and step. 2020-11-17 20:16:55 +03:00
feng lv
0f9065a91f fix
fix
2020-11-11 02:15:40 +00:00
feng lv
1a34abadbc fix
fix

fix
2020-11-02 10:46:58 +00:00
feng lv
3dce3c6a21 fix 2020-11-02 05:28:37 +00:00
alesapin
c53f59dece
Merge pull request #15984 from ClickHouse/fix_insert_mv_dangling_ref
Fix possibly dangling reference to target table of MV
2020-10-21 12:13:51 +03:00
Alexander Tokmakov
de06a79738 fix possibly dangling reference when inserting into mv 2020-10-14 22:25:31 +03:00
Alexander Tokmakov
72b1339656 Revert "Revert "Write structure of table functions to metadata""
This reverts commit c65d1e5c70.
2020-10-14 15:19:29 +03:00
tavplubix
c65d1e5c70
Revert "Write structure of table functions to metadata" 2020-10-14 13:59:29 +03:00
alexey-milovidov
f60ccb4edf
Merge pull request #14295 from ClickHouse/write_structure_of_table_functions
Write structure of table functions to metadata
2020-10-13 23:56:09 +03:00
alesapin
17b86dec96 Recursive defaults 2020-10-02 15:38:50 +03:00
Alexander Tokmakov
1ca9a92b21 Merge branch 'master' into write_structure_of_table_functions 2020-09-18 21:09:23 +03:00
alexey-milovidov
882206c0b6
Update InterpreterInsertQuery.cpp 2020-09-14 16:45:32 +03:00
Amos Bird
016f707ea1
column transformers in insert select 2020-09-13 10:21:13 +08:00
Alexander Tokmakov
56695727b2 Merge branch 'master' into write_structure_of_table_functions 2020-09-01 20:15:13 +03:00
Alexander Tokmakov
3a9779adb4 slightly better code 2020-09-01 17:41:49 +03:00
Alexander Kuzmenkov
c4fc434a13
Merge pull request #14060 from azat/parallel_distributed_insert_select-2
Extend parallel_distributed_insert_select to run INSERT into local table
2020-08-26 20:37:36 +03:00
Azat Khuzhin
50a312534c Extend parallel_distributed_insert_select to run INSERT into local table
Before this patch there was:

- parallel_distributed_insert_select=1, that executes:

    INSERT INTO dist_out SELECT ... FROM underlying_dist_in

After this patch there will be:

- parallel_distributed_insert_select=2, that executes:

    INSERT INTO underlying_dist_out SELECT ... FROM underlying_dist_in

And cover the behaviour w/o integration test, by using the following
techincs:
- SYSTEM STOP DISTRIBUTED SENDS
- prefer_localhost_replica=0
2020-08-25 22:49:13 +03:00
Alexey Milovidov
1fa4978685 Make the code more clear; add comments 2020-08-24 17:29:31 +03:00
feng lv
aaedf02d2b fix conflict 2020-08-16 12:38:39 +08:00
Nikolai Kochetov
20e63d2271 Refactor Pipe [part 6] 2020-08-06 15:24:05 +03:00
feng lv
a827462f55 fix 2020-08-02 20:30:41 +08:00
feng lv
88e48168d9 fix 2020-08-02 13:35:58 +08:00
feng lv
fdf646283d fix
fix
2020-08-02 09:59:25 +08:00
feng lv
2cce811dda optimize trivial insert select
style fix

update

fix

fix

fix
2020-07-09 20:12:30 +08:00
alesapin
b9e74f4e82 Merge branch 'master' into atomic_metadata5 2020-06-22 12:03:53 +03:00
Nikolai Kochetov
8a048340b0 Fix tests. 2020-06-19 21:23:44 +03:00
Nikolai Kochetov
7bfb5c9a47 Fix build. 2020-06-18 21:40:02 +03:00
alesapin
d79982f497 Better locks in Storages 2020-06-18 19:10:47 +03:00
alesapin
dffdece350 getColumns in StorageInMemoryMetadta (only compilable) 2020-06-17 19:39:58 +03:00
alesapin
ccc2bda666 getConstraints() in StorageInMemoryMetadata (suspicious commit, but pretend to work) 2020-06-16 19:55:04 +03:00
alesapin
1ddeb3d149 Buildable getSampleBlock in StorageInMemoryMetadata 2020-06-16 18:51:29 +03:00
alesapin
08b9aa6b2e getSampleBlockWithVirtuals in StorageInMemoryMetadata 2020-06-16 15:58:05 +03:00
alesapin
53cb5210de Move getSampleBlockNonMaterialized to StorageInMemoryMetadata 2020-06-16 15:48:10 +03:00
alesapin
36ba0192df Metadata in read and write methods of IStorage 2020-06-15 22:08:58 +03:00
Nikolai Kochetov
5fea34d0e1 Use Resize instead of Concat in InterpreterInsertQuery. 2020-06-05 12:30:16 +03:00
alexey-milovidov
3eea042d16
Merge pull request #11243 from ClickHouse/remove-experimental-use-processors-flag-4
Remove some code.
2020-05-30 21:05:14 +03:00
tavplubix
a4e40fb5f2
Merge pull request #11269 from ClickHouse/add_context_to_idatabase_methods
Add context to IDatabase methods
2020-05-29 21:15:35 +03:00
Alexey Milovidov
23d7947549 Fix constraints for DEFAULT fields; fix constraints for temporary tables; improve performance of INSERT for small blocks 2020-05-29 05:08:48 +03:00
Alexander Tokmakov
c071e0a473 add context to DatabaseCatalog methods 2020-05-29 02:01:18 +03:00
Nikolai Kochetov
6efa4d1d4f Fix style. 2020-05-28 13:41:59 +03:00
Nikolai Kochetov
e93882c977 Insert select using PipelineExecutor. 2020-05-27 21:20:26 +03:00
Nikolai Kochetov
32baa073b5 Merge remote-tracking branch 'upstream/master' into insert_into_watch_from_live_view 2020-04-27 17:49:50 +03:00
Vitaliy Zakaznikov
e73166c78d Removing SquashingBlockOutputStream from the stream to
allow blocks from WATCH query to propagate to target table
as is.
2020-04-25 09:46:46 -04:00
Vitaliy Zakaznikov
8621e93460 Starting to remove changes to LIVE VIEW table. 2020-04-25 07:37:33 -04:00
Vitaliy Zakaznikov
34a03939ea First changes to try to support INSERT INTO table WATCH query. 2020-04-25 07:33:47 -04:00
Alexey Milovidov
0a7edce036 Checkpoint 2020-04-22 09:01:33 +03:00
Alexey Milovidov
8ad04d4fec Remove useless code 2020-04-15 00:05:45 +03:00
Alexander Kazakov
26dd6140b2 Added new config settings to control timeouts
* "lock_acquire_timeout" controls for how long a query will continue to
acquire each lock on its argument tables
 * "lock_acquire_timeout_for_background_operations" is a per-table
setting for storages of *MergeTree family
2020-04-09 21:10:27 +03:00
Ivan Lezhankin
06446b4f08 dbms/ → src/ 2020-04-03 18:14:31 +03:00