Commit Graph

2508 Commits

Author SHA1 Message Date
alesapin
12b6a54a24 Merge branch 'master' into try_rewrite_writer 2020-12-14 10:30:01 +03:00
alesapin
fd695c9ff4 Dive into debug 2020-12-14 10:28:42 +03:00
Maksim Kita
1bccd6dff6 Fixed style issues 2020-12-14 00:50:55 +03:00
Azat Khuzhin
2bf226decc Fix typo in KafkaSettings comments 2020-12-14 00:38:10 +03:00
Maksim Kita
69127ca0ed Changed BlocksList to Blocks 2020-12-14 00:21:25 +03:00
Vitaly Baranov
9310437920 Fix access rights required for the merge() table function. 2020-12-13 23:34:53 +03:00
Maksim Kita
3c6df61e5c MemoryStorage read optimization 2020-12-13 22:24:15 +03:00
Alexander Tokmakov
0c80fce7f0 Merge branch 'master' into allow_atomic_database_inside_materialize_mysql 2020-12-13 17:56:50 +03:00
Azat Khuzhin
77a1d00dee Add new remote context as interpreter context to the Pipe 2020-12-12 17:43:10 +03: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
Amos Bird
04128c33e1
disable TSAN for real 2020-12-12 14:17:48 +08:00
Amos Bird
0aa75e6023
Another try of TSan fix 2020-12-12 13:59:34 +08:00
alexey-milovidov
cfeaff6aa7
Update StorageSystemStackTrace.cpp 2020-12-12 13:59:34 +08:00
alexey-milovidov
b513eeee7f
Another try... 2020-12-12 13:59:34 +08:00
Amos Bird
5e71f4e810
Have to resort to NO_SANITIZE_THREAD 2020-12-12 13:59:34 +08:00
Amos Bird
c4306b5788
Another try of TSan fix 2020-12-12 13:59:34 +08:00
Amos Bird
d0044886ab
fix TSan 2020-12-12 13:59:34 +08:00
Amos Bird
4809b5975a
Fix system.stack_trace in daemon 2020-12-12 13:59:33 +08:00
alexey-milovidov
adbe8e1ebb
Merge pull request #17903 from ClickHouse/attach_table_from_path
Implement ATTACH TABLE name FROM 'path/to/data/'
2020-12-12 02:42:53 +03:00
Alexander Kuzmenkov
dcc4b5609f fixup 2020-12-11 21:16:26 +03:00
Alexander Kuzmenkov
d54d96701a fixup 2020-12-11 18:57:26 +03:00
Pavel Kovalenko
59a5e63417 Merge remote-tracking branch 'origin/master' into s3-adaptive-single-part-upload
# Conflicts:
#	src/Disks/S3/DiskS3.cpp
#	src/Disks/S3/DiskS3.h
#	src/Disks/S3/registerDiskS3.cpp
#	src/IO/WriteBufferFromS3.cpp
#	src/IO/WriteBufferFromS3.h
2020-12-11 18:28:41 +03:00
alesapin
a24a76828e Fix 2020-12-11 18:18:51 +03:00
alesapin
4b83707c63 Compileable code for some reason 2020-12-11 18:00:58 +03:00
alesapin
57c30c4164 Garbage 2020-12-11 16:20:19 +03:00
Alexander Tokmakov
58a31e4882 Merge branch 'master' into allow_atomic_database_inside_materialize_mysql 2020-12-11 16:14:03 +03:00
alesapin
7ffd76a605 Fix bug 2020-12-11 11:41:02 +03:00
alesapin
cbba73672e Merge branch 'master' into try_rewrite_writer 2020-12-11 11:09:47 +03:00
Alexander Kuzmenkov
d757f32300 Remove some redundant includes to speed up build 2020-12-11 02:58:11 +03:00
Alexander Kuzmenkov
dea446be2f Remove some redundant includes to speed up build 2020-12-11 02:56:57 +03:00
alexey-milovidov
7f4b5a0d1b
Merge pull request #17854 from weeds085490/dev/add_diag_info_when_circle_in_merge
add diagnostic information when two merge tables try to read each oth…
2020-12-10 22:56:34 +03:00
alexey-milovidov
c35c52be87
Merge pull request #17867 from ucasFL/mergetree-setting
Add settings `min_compress_block_size` and `max_compress_block_size` to MergeTreeSettings
2020-12-10 22:54:05 +03:00
alexey-milovidov
f1ee1ef16a
Update MergeTreeSettings.h 2020-12-10 22:50:54 +03:00
Alexander Kuzmenkov
88e7bc5b60 Merge origin/master into tmp (using imerge) 2020-12-10 22:12:42 +03:00
alesapin
1cb06bd975 Split one method 2020-12-10 19:29:10 +03:00
alesapin
90fa9a2073 Merge branch 'master' into try_rewrite_writer 2020-12-10 18:36:10 +03:00
alesapin
f3d1dc360c Fix style 2020-12-10 12:24:52 +03:00
alesapin
0704b478ee Less constuctors 2020-12-10 12:22:43 +03:00
Vladimir Chebotarev
39d867e56d
Added proper authentication for S3 client (#16856) 2020-12-10 12:19:42 +03:00
alesapin
2787b615b0 Make interface as simple as possible 2020-12-10 11:57:52 +03:00
alesapin
fef65b0cbd
Merge pull request #17919 from ClickHouse/additional_size_check
Add additional columns size check for MergeTree in debug mode
2020-12-09 22:40:06 +03:00
alesapin
7979b3655c Better formating 2020-12-09 21:22:07 +03:00
alesapin
3b88c077ed Mechanical refactoring 2020-12-09 21:19:49 +03:00
alesapin
af73db93e6 Mechanical refactoring 2020-12-09 21:10:09 +03:00
Pavel Kruglov
c8c543ca94 Add throwing exceptions 2020-12-09 18:07:58 +03:00
Nikolai Kochetov
32b38f389e Merge branch 'master' into async-read-from-socket 2020-12-09 17:15:36 +03:00
Nikolai Kochetov
088c128832 Fixing build and tests. 2020-12-09 17:11:20 +03:00
Pavel Kovalenko
db7a87089b Adaptive choose of single/multi part upload in WriteBufferFromS3. 2020-12-09 17:09:04 +03:00
alesapin
b307e545a9 Fix check 2020-12-09 14:46:04 +03:00
alesapin
0f4056fd95 Add additional size check in debug mode 2020-12-09 14:23:37 +03:00
alesapin
7783ddb3af
Revert "Fix index granularity calculation on block borders" 2020-12-09 14:05:48 +03:00
Vasily Nemkov
59fc301344 Fixed test to be less flaky
Also logging expanded list of columns passed from `DEDUPLICATE BY` to actual deduplication routines.
2020-12-08 19:44:34 +03:00
Alexander Tokmakov
04ceaa66f2 implement ATTACH TABLE name FROM 'path/to/data/ 2020-12-08 17:15:23 +03:00
Ivan
0ba712a2d3
Merge branch 'master' into allow_atomic_database_inside_materialize_mysql 2020-12-08 16:45:51 +03:00
Kruglov Pavel
e19eb6f17a
Merge branch 'master' into optimize-data-on-insert 2020-12-08 15:57:46 +03:00
alexey-milovidov
ab10cb4bf9
Merge pull request #17707 from ClickHouse/quota-by-x-forwarded-for
Allow quotas to be keyed by proxy-forwarded IP address; add support for PROXY protocol
2020-12-08 14:48:05 +03:00
Vasily Nemkov
8c5daf0925 Fixed building tests with GCC-10
Also a minor cleanup of the test code.
2020-12-08 13:15:18 +03:00
Nikolai Kochetov
7d77a7ba24
Merge pull request #16952 from Enmk/DateTime64_fixes_comparison
Fixed comparison of DateTime64 with different scales
2020-12-08 12:40:41 +03:00
alesapin
b5d2559626
Merge pull request #17709 from kssenii/better-startup
rabbitmq: fix startup with no connection
2020-12-07 19:08:18 +03:00
Alexey Milovidov
1ed329017b Merge branch 'master' into quota-by-x-forwarded-for 2020-12-07 18:22:19 +03:00
Vasily Nemkov
168155eeec Minor: cleanup 2020-12-07 18:07:40 +03:00
Vasily Nemkov
dbdc018ab8 Fixed and refined unite-test
* no more undefined values for attributes in ReplicatedMergeTreeLogEntry
* validation of string serialization format
2020-12-07 17:38:25 +03:00
feng lv
50b64ba1f8 fix 2020-12-07 13:18:31 +00:00
feng lv
d7b30f74d1 add min-max_compress_block_size to mergetree settings 2020-12-07 12:47:51 +00:00
root
e07374331a add diagnostic information when two merge tables try to read each other's data 2020-12-07 15:23:58 +08: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
feng lv
a634e4ed80 fix incorrect initialize MergeTreeWriterSettings 2020-12-06 08:57:02 +00:00
kssenii
8f1ed36897 Fix races 2020-12-06 00:24:49 +00:00
alesapin
27c3301083
Merge pull request #17800 from nvartolomei/nv/waitForAllReplicasToProcessLogEntry-foreign-shard
Update StorageReplicatedMergeTree::waitForAllReplicasToProcessLogEntry to support waiting on foreign shards / tables
2020-12-05 16:15:46 +03:00
alesapin
0eec52b1fd
Merge pull request #17737 from ClickHouse/fix_segfault_in_distributed_out_stream
Fix segfault when 'not enough space'
2020-12-05 16:14:30 +03:00
Anton Popov
d1ef6a897e
Merge pull request #17802 from detailyang/patch-1
hotfix:check in_memory_parts_enable_wal
2020-12-05 03:05:38 +03:00
Anton Popov
60b0cbb1c1
Merge pull request #15939 from Avogar/optimize_final_optimization
Optimize final optimization
2020-12-05 02:26:27 +03:00
Pavel Kruglov
5ae6c6dab9 Fix build error 2020-12-04 20:40:28 +03:00
Pavel Kruglov
4b58528b9e Rename getPos to getRow, change mergeBlock, pass setting instead of context 2020-12-04 19:25:30 +03:00
Pavel Kruglov
905ba78adc Merge branch 'master' of github.com:ClickHouse/ClickHouse into optimize-data-on-insert 2020-12-04 18:56:46 +03:00
detailyang
e7a151fd1e
hotfix:check in_memory_parts_enable_wal 2020-12-04 23:14:27 +08:00
kssenii
448463ebe0 Better 2020-12-04 14:50:42 +00:00
alesapin
42544a9833 Merge branch 'master' into fix_segfault_in_distributed_out_stream 2020-12-04 17:41:10 +03:00
Pavel Kruglov
9dbced0474 Pass setting instead of context 2020-12-04 17:01:59 +03:00
Nicolae Vartolomei
796aee032d Update StorageReplicatedMergeTree::waitForAllReplicasToProcessLogEntry to support waiting on foreign shards / tables
This is not used anywhere yet but needed for an upcoming PR for part movement between shards.
2020-12-04 13:01:12 +00:00
Nikolai Kochetov
f31610a2e1 Remove Wait status. 2020-12-04 13:55:01 +03:00
Ivan
315ff4f0d9
ANTLR4 Grammar for ClickHouse and new parser (#11298) 2020-12-04 05:15:44 +03:00
kssenii
f16d6a4128 Better 2020-12-03 14:11:35 +00:00
Anton Popov
cab9855dd1
Update StorageReplicatedMergeTree.cpp 2020-12-03 16:54:05 +03:00
Anton Popov
cd1917c7a6
Merge branch 'master' into optimize_final_optimization 2020-12-03 16:52:51 +03:00
kssenii
ebab21178e Fix, add test 2020-12-02 18:45:30 +00:00
Alexander Kuzmenkov
8ee86e35d2 debug 2020-12-02 21:16:31 +03:00
Azat Khuzhin
5365718f01
Fix optimize_distributed_group_by_sharding_key for query with OFFSET only (#16996)
* Fix optimize_distributed_group_by_sharding_key for query with OFFSET only

* Fix 01244_optimize_distributed_group_by_sharding_key flakiness
2020-12-02 20:11:39 +03:00
Alexander Tokmakov
a0ef3a113a Merge branch 'master' into allow_atomic_database_inside_materialize_mysql 2020-12-02 18:29:02 +03:00
Alexander Tokmakov
bfbf150c67 fix segfault when 'not enough space' 2020-12-02 17:49:43 +03:00
kssenii
8d3a538629 Better startup 2020-12-02 01:17:50 +00:00
Alexey Milovidov
c9aa412151 Allow quotas to be keyed by proxy-forwarded IP address 2020-12-02 00:09:16 +03:00
Vasily Nemkov
87945fb68b Merge branch 'master' into HEAD 2020-11-30 23:25:57 +03:00
Alexey Milovidov
6590fdfdd2 Fix logging 2020-11-30 11:44:01 +03:00
alesapin
25f40db2fb
Merge pull request #17499 from ClickHouse/concurrent_mutation_and_random_kill
Fix kill mutation on concurrent alter queries
2020-11-30 10:51:50 +03:00
Alexey Milovidov
2e6bedce91 Relax "Too many parts" threshold, part 1 2020-11-29 18:08:02 +03:00
Alexey Milovidov
4a66db1bf4 Fix #10976 2020-11-29 16:43:24 +03:00
alexey-milovidov
fabceebbce
Merge pull request #17145 from amosbird/cddt
Fix unmatched type comparison in KeyCondition
2020-11-29 14:29:35 +03:00
alexey-milovidov
f4a61ac3c3
Merge pull request #17527 from ucasFL/spelling
fix spelling errors
2020-11-29 13:45:42 +03:00
feng lv
7e3524caa1 fix spelling errors 2020-11-28 08:17:20 +00:00
alesapin
cc66e4fdd6
Merge pull request #17496 from ClickHouse/fix_mark_cache_size
More accurate mark cache size calculation
2020-11-28 10:42:56 +03:00
alexey-milovidov
c189f6405f
Merge pull request #16767 from azat/optimize_trivial_count_query-fix
Fix optimize_trivial_count_query with partition predicate
2020-11-28 08:43:12 +03:00
Nikita Mikhaylov
6f3db7ff50
Merge pull request #17330 from CurtizJ/move-to-prewhere
Allow to move conditions to prewhere with compact parts
2020-11-28 02:02:42 +03:00
tavplubix
aaaa7ad59f
Merge pull request #16806 from TCeason/add_test_for_materialize_mysql
add network partition integration test for MaterializeMySQL
2020-11-27 20:39:06 +03:00
alesapin
6567796014 Fix kill mutation on concurrent alter queries 2020-11-27 18:46:52 +03:00
alesapin
ba481e6665 Fix cache size calculation 2020-11-27 16:17:10 +03:00
Anton Popov
1a4ed07a98 add some more comments 2020-11-27 15:47:27 +03:00
Nikolai Kochetov
85283b3944
Merge pull request #17397 from ClickHouse/fix-types-for-read-from-join
Fix crash while reading from JOIN table with LowCardinality types
2020-11-27 13:37:05 +03:00
alexey-milovidov
dfae1efbbd
Merge pull request #17070 from fastio/master
Support multiple ZooKeeper clusters
2020-11-27 10:38:01 +03:00
alexey-milovidov
1cd09fa367
Merge pull request #15127 from ucasFL/add-mutation-for-storagememory
Add mutation support for StorageMemory
2020-11-26 22:22:59 +03:00
alexey-milovidov
ee80ee75de
Update StorageMemory.cpp 2020-11-26 22:22:26 +03:00
alesapin
6719fb3a1d
Merge pull request #17416 from ClickHouse/tavplubix-patch-2
Fix backoff in BackgroundJobExecutor
2020-11-26 16:43:15 +03:00
Nikita Mikhaylov
084c75fa6e
Merge pull request #17309 from nikitamikhaylov/merging-sequential-consistency
Merging #16309
2020-11-26 15:26:05 +03:00
Amos Bird
022ba2b0a9
Fix unmatched type comparison in KeyCondition 2020-11-26 16:15:50 +08:00
alesapin
960d077612 Better functions 2020-11-26 10:25:57 +03:00
alexey-milovidov
75a78e6c20
Update BackgroundJobsExecutor.h 2020-11-26 07:09:05 +03:00
Azat Khuzhin
0b47f4a9e9 Fix optimize_trivial_count_query with partition predicate
Consider the following example:

    CREATE TABLE test(p DateTime, k int) ENGINE MergeTree PARTITION BY toDate(p) ORDER BY k;
    INSERT INTO test VALUES ('2020-09-01 00:01:02', 1), ('2020-09-01 20:01:03', 2), ('2020-09-02 00:01:03', 3);

- SELECT count() FROM test WHERE toDate(p) >= '2020-09-01' AND p <= '2020-09-01 00:00:00'
  In this case rpn will be (FUNCTION_IN_RANGE, FUNCTION_UNKNOWN (due to strict), FUNCTION_AND)
  and for optimize_trivial_count_query we cannot use index if there is at least one FUNCTION_UNKNOWN.
  since there is no post processing and return count() based on only the first predicate is wrong.

  Before this patch FUNCTION_UNKNOWN was allowed for optimize_trivial_count_query, and the result was wrong.

And two examples above just to show the difference, the behaviour hadn't been changed with this patch:

- SELECT * FROM test WHERE toDate(p) >= '2020-09-01' AND p <= '2020-09-01 00:00:00'
  In this case will be (FUNCTION_IN_RANGE, FUNCTION_IN_RANGE (due to non-strict), FUNCTION_AND)
  so it will prune everything out and nothing will be read.

- SELECT * FROM test WHERE toDate(p) >= '2020-09-01' AND toUnixTimestamp(p)%5==0
  In this case will be (FUNCTION_IN_RANGE, FUNCTION_UNKNOWN, FUNCTION_AND)
  and all, two, partitions will be scanned, but due to filtering later none of rows will be matched.
2020-11-25 23:09:17 +03:00
tavplubix
6477251ea1
Update BackgroundJobsExecutor.h 2020-11-25 23:06:00 +03:00
nikitamikhaylov
72c7cd6693 replace Context& to Settings& 2020-11-25 16:47:32 +03:00
Nikolai Kochetov
89ee8aefd9 Cast columns to sample structure for StirageJoin::read 2020-11-25 15:41:12 +03:00
Alexander Kuzmenkov
edce1e636e
Merge pull request #16535 from ClickHouse/aku/opentelemetry
OpenTelemetry improvements
2020-11-25 14:10:17 +03:00
alesapin
3e1b2f515b
Merge pull request #17311 from ClickHouse/fix_integration_tests
Fix some flaky tests
2020-11-25 10:09:27 +03:00
alesapin
7e014967db Less broken ugly hack 2020-11-25 00:07:56 +03:00
Alexander Kuzmenkov
1d7dcef4a0 Merge remote-tracking branch 'origin/master' into HEAD 2020-11-24 21:45:10 +03:00
Alexander Kuzmenkov
8de415861f
Merge pull request #17206 from ClickHouse/aku/noescape
Remove escaping from toString(std::string)
2020-11-24 21:23:39 +03:00
alesapin
b28fc3d4f6 Ugly fix for dangling reference 2020-11-24 19:24:36 +03:00
tavplubix
085359c110
Merge pull request #17274 from ClickHouse/fix_ast_formatting_in_logs
Fix AST formatting in log messages
2020-11-24 19:00:56 +03:00
Alexander Kuzmenkov
9b0368ffa5
Merge pull request #16338 from ucasFL/union-distinct
Add UNION DISTINCT and setting `union_default_mode`
2020-11-24 17:30:24 +03:00
Alexander Tokmakov
dce0bf8efc Merge branch 'master' into allow_atomic_database_inside_materialize_mysql 2020-11-24 15:28:31 +03:00
nikitamikhaylov
5be300ff22 Merge branch 'master' of github.com:ClickHouse/ClickHouse into merging-sequential-consistency 2020-11-24 14:46:57 +03:00
alesapin
45f09fe293
Merge pull request #17220 from ianton-ru/s3_max_redirects
S3 max redirects
2020-11-24 12:13:10 +03:00
Anton Popov
2fb8717dfd
Merge pull request #17253 from amosbird/globalinfix
global in set index.
2020-11-24 03:06:00 +03:00
Anton Popov
852a08eacb allow to move conditions to prewhere with compact parts 2020-11-23 21:27:59 +03:00
Alexander Kuzmenkov
951a59eff7 Merge remote-tracking branch 'origin/master' into HEAD 2020-11-23 21:00:22 +03:00
alexey-milovidov
084cac5bd5
Update StorageMemory.cpp 2020-11-23 20:45:59 +03:00
Alexander Kuzmenkov
412c2fe079 Merge remote-tracking branch 'origin/master' into HEAD 2020-11-23 19:51:18 +03:00
Amos Bird
172b7e9ed1
global in set index. 2020-11-23 22:05:08 +08:00
feng lv
005f345139 Merge branch 'master' of github.com:ClickHouse/ClickHouse into add-mutation-for-storagememory 2020-11-23 13:56:19 +00:00
nikitamikhaylov
68bef22fda Merge branch 'master' of github.com:ClickHouse/ClickHouse into merging-sequential-consistency 2020-11-23 16:28:35 +03:00
Vasily Nemkov
c375dc6b14 Merge remote-tracking branch 'upstream/master' into DateTime64_fixes_comparison 2020-11-23 15:49:36 +03:00
Anton Ivashkin
aa208a9d9f Use only 's3_max_redirect' in params instead of all settings 2020-11-23 14:02:17 +03:00
Alexey Milovidov
9969a73d50 Merge branch 'master' into azat-merge-distributed-join-fix 2020-11-23 12:43:15 +03:00
taichong
5c3d4b2245 add network partition integration test for MaterializeMySQL 2020-11-23 15:47:44 +08:00
robot-clickhouse
dc19fba36f Auto version update to [20.13.1.1] [54444] 2020-11-23 10:29:26 +03:00
feng lv
18491d8920 fix 2020-11-23 05:30:36 +00:00
Alexey Milovidov
fbbf439338 Merge branch 'master' into Enmk-DateTime64_fixes_comparison 2020-11-23 05:46:17 +03:00
Alexander Tokmakov
60a5782c75 fix AST formatting in log messages 2020-11-22 20:23:12 +03:00
tavplubix
5cc9cb01cd
Merge pull request #16751 from amosbird/globalcontext
Make global_context consistent.
2020-11-22 18:46:17 +03:00
alesapin
9c8b0da382
Merge pull request #16033 from nvartolomei/nv/parts-uuid
Add unique identifiers IMergeTreeDataPart structure
2020-11-22 16:13:19 +03:00
Nikolai Kochetov
cf678b6092 Merge branch 'master' into order-inputs-in-action-dag 2020-11-21 13:54:50 +03:00