Commit Graph

1830 Commits

Author SHA1 Message Date
alexey-milovidov
eb9ee723c3
Merge pull request #11913 from ClickHouse/compact-parts-by-default
Enable compact parts by default for small parts
2020-09-19 15:31:15 +03:00
Alexey Milovidov
4d06bc62b1 Allow concurrent reads while writing to TinyLog 2020-09-19 14:02:11 +03:00
Alexey Milovidov
111acdc63b Continuation 2020-09-19 14:02:11 +03:00
Alexey Milovidov
bc8fc3e280 Simplification 2020-09-19 14:02:11 +03:00
Alexey Milovidov
66ea3c0c43 Remove useless method 2020-09-19 14:02:11 +03:00
Alexey Milovidov
8193da847b Simplification 2020-09-19 14:02:11 +03:00
Alexey Milovidov
3bb0088c86 Whitespace 2020-09-19 14:02:11 +03:00
Alexey Milovidov
dc7e3b75d3 Whitespace 2020-09-19 14:02:11 +03:00
Alexey Milovidov
8a8284ce31 Avoid deadlocks in Log/TinyLog 2020-09-19 14:02:11 +03:00
alexey-milovidov
1fcebce926
Merge pull request #15000 from Jokser/disable-ttl-move-on-insert
Option to disable TTL move on data part insert
2020-09-19 13:45:02 +03:00
alexey-milovidov
3463d97f8c
Merge pull request #14973 from amosbird/bm2
Ignore key constraints when doing mutations.
2020-09-19 13:44:30 +03:00
Alexey Milovidov
ef5363b87f Fix terribly wrong code 2020-09-19 02:05:13 +03:00
alexey-milovidov
4e77c2e48e
Update MergeTreeDataMergerMutator.cpp 2020-09-19 01:29:31 +03:00
Alexey Milovidov
24b334258b Resolve review comment 2020-09-18 22:25:56 +03:00
Alexey Milovidov
e1ffa07a39 Resolve review comments 2020-09-18 22:08:53 +03:00
Alexey Milovidov
21ca9fce63 Merge branch 'master' into storages-small-improvements 2020-09-18 22:03:19 +03:00
Amos Bird
d842cb704f
Allow mutations to work with key constraints. 2020-09-19 02:40:02 +08:00
Alexander Tokmakov
1ca9a92b21 Merge branch 'master' into write_structure_of_table_functions 2020-09-18 21:09:23 +03:00
Pavel Kovalenko
da04a130ed Add option to disable ttl move on data part insert - minor fixes. 2020-09-18 20:45:30 +03:00
Pavel Kovalenko
6b4b5898a7 Renaming. 2020-09-18 18:41:14 +03:00
Pavel Kovalenko
0da19ab46d Add option to disable ttl move on data part insert 2020-09-18 18:30:00 +03:00
alesapin
e38b537017
Merge pull request #11684 from ClickHouse/manual-write-duplicate-parts-to-replicas
Don't ignore duplicate parts written to replicas
2020-09-18 16:50:00 +03:00
Alexander Kazakov
1ee2e3d2b3 Review fix 2020-09-18 16:03:48 +03:00
Vxider
c9249f77c7 rename persistency to persistent 2020-09-18 20:58:27 +08:00
Vxider
0c535062fc rename disable_persistency to persistency 2020-09-18 20:48:55 +08:00
alesapin
e96a3ac5f3 DataType in enumerate streams 2020-09-18 14:37:58 +03:00
Vitaly Baranov
f43714cd76
Merge pull request #14880 from vitlibar/fix-removing-live-view-after-watching
Fix removing a live view after watching and after timeout has passed.
2020-09-18 14:17:44 +03:00
Nikolai Kochetov
c7aff19937
Merge pull request #14221 from hagen1778/settings-leaf-limits
[settings]: introduce new query complexity settings for leaf-nodes
2020-09-18 14:05:10 +03:00
alesapin
96a693baec Better message 2020-09-18 10:46:23 +03:00
alesapin
e6914acb3b Fix check for merge tree settings on server startup 2020-09-18 10:44:17 +03:00
alesapin
3536ac1b17
Merge pull request #14926 from ClickHouse/better-drop-replicated-table
Better drop for Replicated tables
2020-09-18 09:51:39 +03:00
roman
ddca262fe6 fix review comments 2020-09-17 20:54:21 +01:00
Alexey Milovidov
7fb4dfea2c Small improvements for IStorage::rename 2020-09-17 22:50:43 +03:00
alesapin
447205c525 More comments 2020-09-17 22:30:45 +03:00
alesapin
dc677b93fb Comments and fix test 2020-09-17 22:30:17 +03:00
alexey-milovidov
7152fec241
Update JoinSettings.cpp 2020-09-17 21:24:14 +03:00
alesapin
b07c00ef7c Ugly, but probably working implementation 2020-09-17 18:33:50 +03:00
alexey-milovidov
84eece69ba
Merge pull request #14876 from amosbird/ns
Get rid of query settings after initialization.
2020-09-17 17:49:25 +03:00
Alexey Milovidov
c1e9ce2cf2 Remove questionable code 2020-09-17 17:38:06 +03:00
Alexander Kuzmenkov
fb64cf210a straighten the protocol version 2020-09-17 17:37:29 +03:00
Vitaly Baranov
3356d75b23
Merge pull request #13156 from azat/cluster-secure
Secure inter-cluster query execution (with initial_user as current query user) [v3]
2020-09-17 17:11:00 +03:00
alesapin
d09fd8ca8b Add comment 2020-09-17 17:01:17 +03:00
alesapin
6601f4f786 Better errors, fix merge 2020-09-17 15:10:06 +03:00
alesapin
6c369c8dc6 Fix merge error 2020-09-17 15:01:03 +03:00
Alexey Milovidov
a5560cd62d Better drop replicated tables 2020-09-17 14:27:17 +03:00
alesapin
40b2f203b6 Merge branch 'master' into manual-write-duplicate-parts-to-replicas 2020-09-17 13:21:00 +03:00
roman
b41421cb1c [settings]: introduce new query complexity settings for leaf-nodes
The new setting should allow to control query complexity on leaf nodes
excluding the final merging stage on the root-node. For example, distributed
query that reads 1k rows from 5 shards will breach the `max_rows_to_read=5000`,
while effectively every shard reads only 1k rows. With setting `max_rows_to_read_leaf=1500`
this limit won't be reached and query will succeed since every shard reads
not more that ~1k rows.
2020-09-17 10:37:05 +01:00
alesapin
f104c382f8
Merge pull request #14887 from azat/StorageFile-write-to-fd
Fix SIGSEGV for an attempt to INSERT into StorageFile(fd)
2020-09-17 10:25:02 +03:00
alesapin
5f9e7ed169
Merge pull request #14834 from ClickHouse/fix_compression_codec_perf
Fix performance degradation during parts selection for merge
2020-09-17 10:09:41 +03:00
alesapin
73544a3781
Merge pull request #14845 from ClickHouse/fix_alias_array
Fix recursive column defaults
2020-09-17 10:02:39 +03:00
Azat Khuzhin
138e953429 Fix SIGSEGV for an attempt to INSERT into StorageFile(fd) 2020-09-17 01:26:34 +03:00
Anton Popov
8e9828d2ff Merge remote-tracking branch 'upstream/master' into HEAD 2020-09-16 21:07:35 +03:00
Alexey Milovidov
26eb49b48d Fix typo 2020-09-16 20:02:55 +03:00
Amos Bird
96a202c0fb
Get rid of query settings after initialization. 2020-09-16 22:35:39 +08:00
alesapin
cbe85327e2 Check stack size 2020-09-16 16:24:07 +03:00
Vitaly Baranov
d99a011d07 Fix removing a live view after watching and after timeout has passed. 2020-09-16 15:53:58 +03:00
alesapin
97baa67f2b
Merge pull request #14839 from Jokser/distributed-storage-multiple-volumes
Don't throw exception if Distributed storage has multi-volume storage policy configuration
2020-09-16 10:13:14 +03:00
Nikolai Kochetov
13edfeea1f Fix build. 2020-09-15 20:23:49 +03:00
Nikolai Kochetov
e29f27e333
Merge pull request #14815 from ClickHouse/storage-read-query-plan
Return query plan from storage.
2020-09-15 18:34:11 +03:00
Vitaly Baranov
74d5b43fe6
Merge pull request #14828 from vitlibar/change-columns-of-system-user-directories
Add 'params' column to system.user_directories table.
2020-09-15 18:25:50 +03:00
Alexander Kazakov
7465e00163 Optimized marks selection algorithm for continuous marks ranges 2020-09-15 17:22:32 +03:00
alesapin
e20c54998c Better exception on non physical columns 2020-09-15 16:29:11 +03:00
Anton Popov
3e855daefd Merge remote-tracking branch 'upstream/master' into HEAD 2020-09-15 15:31:29 +03:00
alesapin
8828a78174 Fix alias on default columns 2020-09-15 14:17:58 +03:00
Vxider
e136eba3f8 fix style check 2020-09-15 18:58:16 +08:00
Nikolai Kochetov
6eac433c55 Review fixes. 2020-09-15 13:40:39 +03:00
Artem Zuikov
51ba12c2c3
Try speedup build (#14809) 2020-09-15 12:55:57 +03:00
Nikolai Kochetov
c1f61984e5
Merge pull request #14513 from amosbird/mf1
Binary operator monotonicity
2020-09-15 12:45:23 +03:00
Pavel Kovalenko
01ab28a182 Don't throw exception if Distributed storage has multi-volume storage policy configuration. 2020-09-15 12:26:56 +03:00
Nikolai Kochetov
8c2aa7ce8c Added comment. 2020-09-15 12:22:45 +03:00
Vxider
1c82d2eb23 use table-level setting 2020-09-15 17:16:10 +08:00
alesapin
6f8da7dfdf Merge branch 'master' into fix_compression_codec_perf 2020-09-15 09:59:45 +03:00
Vitaly Baranov
0f53b449fd Add 'params' column to system.user_directories table. 2020-09-15 01:51:53 +03:00
Azat Khuzhin
0159c74f21 Secure inter-cluster query execution (with initial_user as current query user) [v3]
Add inter-server cluster secret, it is used for Distributed queries
inside cluster, you can configure in the configuration file:

  <remote_servers>
      <logs>
          <shard>
              <secret>foobar</secret> <!-- empty -- works as before -->
              ...
          </shard>
      </logs>
  </remote_servers>

And this will allow clickhouse to make sure that the query was not
faked, and was issued from the node that knows the secret. And since
trust appeared it can use initial_user for query execution, this will
apply correct *_for_user (since with inter-server secret enabled, the
query will be executed from the same user on the shards as on initator,
unlike "default" user w/o it).

v2: Change user to the initial_user for Distributed queries if secret match
v3: Add Protocol::Cluster package
v4: Drop Protocol::Cluster and use plain Protocol::Hello + user marker
v5: Do not use user from Hello for cluster-secure (superfluous)
2020-09-15 01:36:28 +03:00
Alexander Tokmakov
da6beb1a91 Merge branch 'master' into enable_some_tests_with_database_atomic 2020-09-14 23:00:14 +03:00
alesapin
e96256d367 Trying to improve performance 2020-09-14 22:15:25 +03:00
Nikita Mikhaylov
ddea62211d
Merge pull request #11948 from CurtizJ/fsync-parts
Experiment. Allow to turn on fsync on inserts, merges and fetches.
2020-09-14 22:37:14 +04:00
Nikolai Kochetov
bcfc83022a Return query plan from storage. 2020-09-14 17:13:58 +03:00
Vxider
407bccdefa Support default arguments for Replicated engine 2020-09-14 15:46:27 +08:00
alesapin
06575970aa
Merge pull request #14705 from amosbird/misc1
Add merge_algorithm to system.merges
2020-09-14 09:58:30 +03:00
Vxider
b5498e6ed2 update code style 2020-09-14 09:39:32 +08:00
Vxider
cbf8282701 add disable_set_and_join_persistency 2020-09-13 23:11:18 +08:00
Amos Bird
5cc8fd395c
Fix empty key segfault 2020-09-13 21:55:16 +08:00
Amos Bird
34b9547ce1
Binary operator monotonicity 2020-09-13 21:55:12 +08:00
Amos Bird
c2d79bc5cc
Add merge_algorithm to system.merges 2020-09-13 10:00:03 +08:00
Vitaly Baranov
70b0fe88b1
Merge pull request #14604 from vitlibar/no-detach-threads-2
Use join() instead of detach() for threads #2
2020-09-12 02:07:46 +03:00
alesapin
2c4047b280 Revert accident changes 2020-09-11 20:07:00 +03:00
alesapin
6dd75182f0 Better 2020-09-11 20:04:55 +03:00
alesapin
a4c43e51b9 Add a test 2020-09-11 20:04:55 +03:00
alesapin
a5f8899874 First implementation 2020-09-11 20:04:55 +03:00
Anton Popov
a64331d79f fix syncing of WAL 2020-09-11 16:09:26 +03:00
tavplubix
1f47b1ff6b
Merge pull request #14704 from ClickHouse/fix_misleading_message_uuid_macro
Fix misleading exception message about uuid macro
2020-09-11 12:45:32 +03:00
Anton Popov
f2a5216e97 add waiting for fsync in WAL 2020-09-11 02:28:50 +03:00
Anton Popov
af4089c606 Merge remote-tracking branch 'upstream/master' into HEAD 2020-09-11 00:39:21 +03:00
tavplubix
4581e3a18a
Merge pull request #14563 from bharatnc/ncb/zk-conn-fail-do-cleanup
ReplicatedMergeTree - cleanup data directory after Zookeeper exceptions
2020-09-10 19:19:57 +03:00
bharatnc
3b3b7bd5e7 minor changes to comment 2020-09-10 09:09:48 -07:00
tavplubix
a6c9dd0465
Merge pull request #14664 from ClickHouse/fix_missed_database_when_altering_mv
Fix missed database name when altering MaterializedView
2020-09-10 17:55:31 +03:00
Alexander Tokmakov
f19f02028b fix misleading exception message about uuid macro 2020-09-10 17:50:10 +03:00
Alexander Tokmakov
20b3823770 do not remove directory on attach 2020-09-10 13:21:13 +03:00
Anton Popov
b9bf67b6ac allow to randomize part type in MergeTree 2020-09-10 04:27:36 +03:00
Alexander Tokmakov
7080d56470 fix missed database name when altering mv 2020-09-09 22:59:34 +03:00
Vitaly Baranov
2a9ab48279 Use join() instead of detach() for the no_users_thread in StorageLiveView. 2020-09-09 22:39:27 +03:00
Alexander Tokmakov
dee1fefeb4 add more tests 2020-09-09 20:39:49 +03:00
bharatnc
fe6d6f16ea Merge remote-tracking branch 'upstream/master' into ncb/zk-conn-fail-do-cleanup 2020-09-09 09:25:34 -07:00
alesapin
bd14c79b0b
Merge pull request #14494 from ClickHouse/recompression_in_background
Recompression TTL
2020-09-09 17:46:01 +03:00
Alexander Tokmakov
d278d849e4 Merge branch 'master' into write_structure_of_table_functions 2020-09-09 17:12:35 +03:00
Alexander Tokmakov
b68782d285 enable more tests with Atomic database 2020-09-09 16:32:50 +03:00
Winter Zhang
3d1d64ec60
Fix currentDatabase function cannot be used in ON CLUSTER ddl query. (#14211) 2020-09-09 12:58:59 +03:00
Anton Popov
32135d96f9
Merge pull request #12183 from CurtizJ/polymorphic-parts-2
Support codecs in compact parts
2020-09-09 12:34:13 +03:00
alesapin
485b104898 Use max ttl and add introspection to system parts about recompression 2020-09-09 12:15:42 +03:00
alesapin
a696cf12f6 Merge branch 'master' into recompression_in_background 2020-09-09 10:12:03 +03:00
bharatnc
f37814b367 Merge remote-tracking branch 'upstream/master' into ncb/zk-conn-fail-do-cleanup 2020-09-08 23:45:20 -07:00
alexey-milovidov
f2e9a09b11
Merge pull request #14585 from ClickHouse/join-processor
Remove Join from ExpressionActions
2020-09-08 23:56:09 +03:00
Anton Popov
a419267dc6 minor fixes 2020-09-08 19:28:49 +03:00
robot-clickhouse
8def718661 Auto version update to [20.10.1.1] [54440] 2020-09-08 17:04:41 +03:00
alesapin
f0f7f2b5d2 Merge branch 'master' into recompression_in_background 2020-09-08 15:43:37 +03:00
alesapin
6ad91d1018
Merge pull request #14490 from ClickHouse/control_ttl_merges_in_pool
Control ttl merges in pool
2020-09-08 15:42:20 +03:00
Nikolai Kochetov
39aad9979a Remove Join from ExpressionActions. 2020-09-08 13:40:53 +03:00
Ilya Yatsishin
11a247d2f4
Merge pull request #14556 from ClickHouse/fix-arcadia-2
Lower binary size in "Arcadia" build
2020-09-08 12:08:35 +03:00
Nikolai Kochetov
c3eeb8f71e
Merge pull request #14412 from ClickHouse/pipes-and-creating-sets
Pipes and creating sets
2020-09-08 10:47:56 +03:00
alesapin
4364bff3bc
Merge pull request #12761 from kssenii/rabbitmq-improvements
RabbitMQ improvements
2020-09-08 09:38:25 +03:00
alesapin
8ff0aedebe Merge branch 'control_ttl_merges_in_pool' into recompression_in_background 2020-09-08 09:34:03 +03:00
alesapin
405a204514 Lower timeout for TTL merges 2020-09-08 09:33:00 +03:00
alesapin
f4846e2ef1
Update src/Storages/MergeTree/ReplicatedMergeTreeQueue.cpp
Co-authored-by: Anton Popov <pad11rus@gmail.com>
2020-09-08 09:30:54 +03:00
bharatnc
0c00b992d5 StorageReplicatedMergeTree - cleanup data dir after Zk exceptions
It's possible for `getZooKeeper()` to timeout if  zookeeper host(s) can't
be reached. In such cases `Poco::Exception` is thrown after a connection
timeout - refer to `src/Common/ZooKeeper/ZooKeeperImpl.cpp:866` for more info.

Side effect of this is that the CreateQuery gets interrupted and it exits.
But the data Directories for the tables being created aren't cleaned up.
This unclean state will hinder table creation on any retries and will
complain that the Directory for table already exists.

To achieve a clean state on failed table creations, catch this error if
the exception is of type Poco::Exception and call `dropIfEmpty()` method,
then proceed throwing the exception. Without this, the Directory for the
tables need to be manually deleted before retrying the CreateQuery.
2020-09-07 18:09:09 -07:00
Alexey Milovidov
e3924b8057 Fix "Arcadia" 2020-09-08 01:14:13 +03:00
alexey-milovidov
e1104135c8
Merge pull request #13939 from fastio/master
Multithreading implementation of Kafka engine
2020-09-07 20:12:06 +03:00
kssenii
40c8290dde Tiny fixes, better tests 2020-09-07 14:48:50 +00:00
alesapin
17650e803f Tiny improvements 2020-09-07 14:08:53 +03:00
alesapin
f6237dc334 Better name 2020-09-07 12:32:45 +03:00
alesapin
4ce975c512 Merge branch 'master' into kssenii-rabbitmq-improvements 2020-09-07 11:36:08 +03:00
alesapin
f274ffc9d1 Add comments 2020-09-07 10:59:14 +03:00
alesapin
ba70de63f8 Fix diff 2020-09-07 10:28:04 +03:00
alesapin
7f301eab63 Merge branch 'master' into recompression_in_background 2020-09-07 09:31:16 +03:00
Dmitry
9639846ca9 Merge branch 'master' into system_events_show_zero_values 2020-09-06 14:55:14 +03:00
Peng Jian
fd82272cfe Fix code style, and update docs for Kafka engine 2020-09-06 11:17:19 +08:00
Peng Jian
e6bfd9d586 1. Add new setting for Kafka engine, named kafka_thread_per_consumer which default value is false. 2. Create separate thread pool for Kafka engine. 2020-09-06 11:17:19 +08:00
Peng Jian
de0a40aedc fix code style 2020-09-06 11:17:19 +08:00
Peng Jian
61ac52cf29 Multithreading implementation of Kafka engine 2020-09-06 11:17:18 +08:00
Anton Popov
3b9be70c8c Merge remote-tracking branch 'upstream/master' into HEAD 2020-09-05 18:53:55 +03:00
Nikolai Kochetov
499405504f Merge branch 'master' into pipes-and-creating-sets 2020-09-04 23:41:20 +03:00
Anton Popov
c73bb98002 fix clang-tidy 2020-09-04 19:50:40 +03:00
Anton Popov
f1cf03f1bb Merge remote-tracking branch 'upstream/master' into HEAD 2020-09-04 17:40:22 +03:00
alesapin
37a2bd0bfd less debug 2020-09-04 17:23:32 +03:00
alesapin
de911aaabe Merge branch 'master' into recompression_in_background 2020-09-04 17:21:27 +03:00
alesapin
2d1042614e Less comments 2020-09-04 17:19:41 +03:00
alesapin
79ef72178e Less garbage 2020-09-04 17:18:49 +03:00
alesapin
f48d654d35 Less garbage 2020-09-04 17:15:34 +03:00
alesapin
fecb2f1311 Less copypaste 2020-09-04 17:08:43 +03:00
alesapin
ea7168580b Fixes 2020-09-04 16:55:07 +03:00
Alexander Tokmakov
ed5f827708 Merge branch 'master' into write_structure_of_table_functions 2020-09-04 16:38:57 +03:00
Anton Popov
68913eab62 better reading from compact parts with differents codecs 2020-09-04 15:48:55 +03:00
alesapin
f8aa6cfe8a
Merge pull request #14438 from ClickHouse/apply_ttl_if_not_calculated
Apply TTL if it's not calculated for part
2020-09-04 15:32:50 +03:00
alesapin
f9dd4cc98d Merge branch 'control_ttl_merges_in_pool' into recompression_in_background 2020-09-04 14:32:25 +03:00
alesapin
e42d0f60da Fix several bugs 2020-09-04 14:27:27 +03:00
alesapin
4079636f81 Merge 2020-09-04 13:52:51 +03:00
alesapin
6f5ba4d8e5 Fix ya.make 2020-09-04 13:31:29 +03:00
alesapin
69b31ab90d More comments 2020-09-04 13:29:55 +03:00
alesapin
82c56349a5 Some comments 2020-09-04 13:08:09 +03:00
Alexander Tokmakov
b840d741d0 Merge branch 'master' into write_structure_of_table_functions 2020-09-04 13:00:07 +03:00
Nikolai Kochetov
c761970bc5 Merge branch 'master' into pipes-and-creating-sets 2020-09-04 11:38:35 +03:00
Nikolai Kochetov
b7e53208d1 Fix tests. 2020-09-04 11:36:47 +03:00
alesapin
c96a2b4f22
Merge pull request #14444 from ClickHouse/fix_select_parts_for_merge
Fix select parts for merge
2020-09-04 09:55:48 +03:00
alesapin
61ecaebcb1 Simplify settings for TTL merges 2020-09-04 09:55:19 +03:00
Anton Popov
6883ee7eea create less compressed streams while writing compact parts 2020-09-04 01:38:17 +03:00
Anton Popov
d5da58918e create less compressed streams while writing compact parts 2020-09-04 01:04:46 +03:00
Anton Popov
98011f6fc3 Merge remote-tracking branch 'upstream/master' into HEAD 2020-09-03 17:53:05 +03:00
alesapin
0dab4d9485 Merge branch 'fix_select_parts_for_merge' into control_ttl_merges_in_pool 2020-09-03 17:41:23 +03:00
alesapin
bd24c3a059 Fix build useless binary 2020-09-03 17:38:56 +03:00
Kseniia Sumarokova
4b7c303eaf
Merge branch 'master' into rabbitmq-improvements 2020-09-03 17:26:04 +03:00
alesapin
15a02321bf Merge branch 'fix_select_parts_for_merge' into control_ttl_merges_in_pool 2020-09-03 17:16:29 +03:00
alesapin
55adb6f9f2
Update src/Storages/MergeTree/MergeSelector.h
Co-authored-by: Nikita Mikhaylov <mikhaylovnikitka@gmail.com>
2020-09-03 16:55:34 +03:00
alesapin
e48e4309b2 Better names 2020-09-03 16:29:18 +03:00
alesapin
565555e55c Fix bug in parts selection 2020-09-03 16:04:28 +03:00
alesapin
13248a744b Fix bug in parts selection 2020-09-03 16:02:24 +03:00
alesapin
f4c7ff0376 Add fixed size of Merge TTLS 2020-09-03 16:00:13 +03:00
alesapin
aa47d0aabc Merge branch 'apply_ttl_if_not_calculated' into recompression_in_background 2020-09-03 12:07:03 +03:00
alesapin
acc0ee0657 Apply TTL if it's not calculated for part 2020-09-03 11:59:41 +03:00
kssenii
e1ef558a2d Fixes 2020-09-03 06:50:20 +00:00
alexey-milovidov
edea940e17
Update StorageDistributed.cpp 2020-09-03 04:39:36 +03:00
Azat Khuzhin
fffeeeba06 Force WithMergeableStateAfterAggregation via distributed_group_by_no_merge (convert to UInt64)
Possible values:
- 1 - Do not merge aggregation states from different servers for distributed query processing - in case it is for certain that there are different keys on different shards.
- 2 - same as 1 but also apply ORDER BY and LIMIT stages
2020-09-03 00:52:51 +03:00
Azat Khuzhin
10b4f3b41f Optimize queries with LIMIT/LIMIT BY/ORDER BY for distributed with GROUP BY sharding_key
Previous set of QueryProcessingStage does not allow to do this.
But after WithMergeableStateAfterAggregation had been introduced the
following queries can be optimized too under
optimize_distributed_group_by_sharding_key:
- GROUP BY sharding_key LIMIT
- GROUP BY sharding_key LIMIT BY
- GROUP BY sharding_key ORDER BY

And right now it is still not supports:
- WITH TOTALS (looks like it can be supported)
- WITH ROLLUP (looks like it can be supported)
- WITH CUBE
- SETTINGS extremes=1 (looks like it can be supported)
But will be implemented separatelly.

vX: fixes
v2: fix WITH *
v3: fix extremes
v4: fix LIMIT OFFSET (and make a little bit cleaner)
v5: fix HAVING
v6: fix ORDER BY
v7: rebase against 20.7
v8: move out WithMergeableStateAfterAggregation
v9: add optimize_distributed_group_by_sharding_key into test names
2020-09-03 00:52:51 +03:00
Azat Khuzhin
4043be3121 Add new query processing stage WithMergeableStateAfterAggregation
Process query until the stage where the aggregate functions were
calculated and finalized.

It will be used for optimize_distributed_group_by_sharding_key.

v2: fix aliases
v3: Fix protocol ABI breakage due to WithMergeableStateAfterAggregation
    Conditions >= for QueryProcessingStage::Enum has been verified, and they
    are ok (in InterpreterSelectQuery).
2020-09-03 00:51:08 +03:00
Alexander Tokmakov
b1d6ac0d14 Merge branch 'master' into write_structure_of_table_functions 2020-09-02 20:04:50 +03:00
alesapin
dcbddbb8d0 Add recompression ttls tests and fix bugs 2020-09-02 19:15:41 +03:00
Alexander Tokmakov
4bf3f9e4a3 use StorageProxy for StorageMaterializeMySQL 2020-09-02 18:56:21 +03:00
Alexander Tokmakov
ee7b8a797a better code, fix Distributed format of StorageFile 2020-09-02 18:07:53 +03:00
alexey-milovidov
8e2fba5be1
Merge pull request #12567 from amosbird/fmi
table function view
2020-09-02 17:07:57 +03:00
Nikolai Kochetov
92c937db8b Remove CreatingSetsBlockInputStream 2020-09-02 16:13:13 +03:00
alexey-milovidov
c009ace7a2
Update StorageSystemEvents.cpp 2020-09-02 15:28:29 +03:00
alesapin
128cb7ce22 Don't select already selected parts 2020-09-02 15:16:12 +03:00
alesapin
aac466ab1c Merge branch 'better_ttl_merges_selection' into recompression_in_background 2020-09-02 13:30:04 +03:00
Dmitry
6f18cd772c fixes 2020-09-02 13:07:23 +03:00
Dmitry
2180cdc400 system_events_show_zero_values setting added 2020-09-02 13:00:49 +03:00
alesapin
fbb37c37df Simplier interface 2020-09-02 11:28:46 +03:00
alesapin
b08056fa8c Better selection of Merges with TTL 2020-09-02 11:18:50 +03:00
Amos Bird
6bd753d85d
TableFunction view. 2020-09-02 16:02:10 +08:00
Anton Popov
4fe57fc169 Merge remote-tracking branch 'upstream/master' into HEAD 2020-09-02 01:29:44 +03:00
Anton Popov
26d75f7602 do fsync for WAL 2020-09-02 01:25:10 +03:00
kssenii
6682c62a90 Fixes 2020-09-01 20:07:34 +00:00
Alexander Tokmakov
41dd393824 fixes 2020-09-01 20:55:35 +03:00
Alexander Tokmakov
56695727b2 Merge branch 'master' into write_structure_of_table_functions 2020-09-01 20:15:13 +03:00
bharatnc
f0d1c6c794 Merge remote-tracking branch 'upstream/master' into ncb/fix-alter-live-lock 2020-09-01 09:06:10 -07:00
Anton Popov
3cadc9033a fsyncs for metadata files of part 2020-09-01 18:53:22 +03:00
Alexander Tokmakov
c7f355a8f3 add test 2020-09-01 18:24:21 +03:00
Alexander Tokmakov
3a9779adb4 slightly better code 2020-09-01 17:41:49 +03:00
alesapin
c37a19f7b0 Better 2020-09-01 14:23:38 +03:00
kssenii
15f735bb24 Merge branch 'master' of https://github.com/ClickHouse/ClickHouse into rabbitmq-improvements 2020-09-01 10:51:34 +00:00
alesapin
f0dc5a3085 First working test 2020-09-01 13:49:53 +03:00
Alexander Tokmakov
b6093d9a86 fix query header 2020-09-01 13:37:42 +03:00
kssenii
c2fb72abf8 Better mv, more comments 2020-09-01 07:58:41 +00:00
alesapin
b751319f9e Merge branch 'master' into recompression_in_background 2020-09-01 10:31:10 +03:00
alesapin
05b10048a6
Merge pull request #14116 from ClickHouse/parts_default_compression
Save parts default compression
2020-09-01 09:43:42 +03:00
alesapin
e28b477f79
Merge pull request #14263 from bharatnc/ncb/disallow-codec-for-alias
Disallow codec for ALIAS columns types
2020-09-01 09:42:53 +03:00
bharatnc
c3dd968931 fix ALTER LIVE VIEW lock issue
This PR fixes a lock issue that happens while executing
`ALTER LIVE VIEW` query with the `REFRESH` command that
results in a exception. The problem is that lock is currently
being acquired in `InterpreterALterQuery.cpp`
in the `InterpreterAlterQuery::execute()` method and lock
is again being reacquired in `StorageLiveView.cpp` in the
` StorageLiveView::refresh` method. This removes that extra
lock.

Before fix:

```sql
--create table

CREATE TABLE test0 (
    c0 UInt64
) ENGINE = MergeTree() PARTITION BY c0 ORDER BY c0;

-- enable experimental_live_view

:) SET allow_experimental_live_view=1

-- create live view;

:) CREATE LIVE VIEW live1 AS SELECT * FROM table0;

-- alter live view results in exception

:) ALTER LIVE VIEW live1 REFRESH;

...
...

Received exception from server (version 20.8.1):
Code: 49. DB::Exception: Received from localhost:9000. DB::Exception: RWLockImpl::getLock(): RWLock is already locked in exclusive mode.

```

After fix:

```sql
:)  ALTER LIVE VIEW live1 REFRESH;

ALTER LIVE VIEW live1
    REFRESH

Ok.

0 rows in set. Elapsed: 0.016 sec.
```
2020-08-31 22:17:58 -07:00
Anton Popov
25140b9bd5 fsync MergeTree format file 2020-09-01 04:39:36 +03:00
robot-clickhouse
e2fa0eae2f Auto version update to [20.9.1.1] [54439] 2020-08-31 23:07:41 +03:00
alesapin
46f833b7df Some changes 2020-08-31 22:50:42 +03:00
Alexander Tokmakov
f0a5f19dae try use another wrapper for table functions 2020-08-31 22:03:26 +03:00
bharatnc
c377c228ef fix tests 2020-08-31 10:22:53 -07:00
bharatnc
c4e235b000 Merge remote-tracking branch 'upstream/master' into ncb/disallow-codec-for-alias 2020-08-31 09:01:07 -07:00
bharatnc
caed8cd474 change error code to BAD_ARGUMENTS (36) 2020-08-31 09:00:32 -07:00
Alexander Kuzmenkov
bc8765d5ad
Merge pull request #14095 from azat/DistributedFilesToInsert-fix
Fix DistributedFilesToInsert metric (zeroed when it should not)
2020-08-31 18:58:30 +03:00
alexey-milovidov
f5a38fa78d
Merge pull request #14203 from donge/master
fix issue #14202
2020-08-31 17:48:39 +03:00
alesapin
b20a0bc254 Add recompression flag in ReplicatedEntry 2020-08-31 16:42:42 +03:00
alesapin
067eb4599d Fix empty columns case 2020-08-31 16:39:27 +03:00
alesapin
adc18f4d3f Write with recompression TTL 2020-08-31 16:29:31 +03:00
alesapin
42c210fcba Recompress TTLs in memory metadata 2020-08-31 15:12:51 +03:00
alesapin
4834bed35b Add recompression TTL parser 2020-08-31 14:35:53 +03:00
kssenii
e57d1c827f Better shutdown 2020-08-31 10:00:28 +00:00
kssenii
647cf5718e Better settings 2020-08-31 09:27:42 +00:00
alesapin
034f1a895d Merge branch 'master' into recompression_in_background 2020-08-31 11:10:14 +03:00
alesapin
5b0822902b
Merge pull request #14155 from amosbird/fzk
Allow FETCH PARTITION from other zookeepers
2020-08-31 09:54:51 +03:00
bharatnc
5c83b09a2f disallow CODEC setting for column type ALIAS
This commit adds checks in place during table creation
and updates to ensure that we don't allow `CODEC` for
ALIAS (`default_type` column) like:

```sql
CREATE TABLE compression_codec_on_alias
(
    `c0` ALIAS c1 CODEC(ZSTD),
    `c1` UInt64
)
ENGINE = MergeTree()
PARTITION BY c0
ORDER BY c1;
```

After these safeguards in place, when trying to create/update column
codec, we will get excaptions like this:

```sql

-- create

CREATE TABLE compression_codec_on_alias
(
    `c0` ALIAS c1 CODEC(ZSTD),
    `c1` UInt64
)
ENGINE = MergeTree()
PARTITION BY c0
ORDER BY c1

Received exception from server (version 20.8.1):
Code: 377. DB::Exception: Received from localhost:9000. DB::Exception: Cannot specify codec for column type ALIAS.

0 rows in set. Elapsed: 0.006 sec.

-- modify

ALTER TABLE compression_codec_on_alias
    ADD COLUMN `c3` ALIAS c2 CODEC(ZSTD) AFTER c2

Received exception from server (version 20.8.1):
Code: 377. DB::Exception: Received from localhost:9000. DB::Exception: Cannot specify codec for column type ALIAS.

0 rows in set. Elapsed: 0.005 sec.

```
2020-08-30 23:45:53 -07:00
alexey-milovidov
b1efc5df01
Merge pull request #14225 from amosbird/bf1
Fix bug in mark inclusion search.
2020-08-30 02:58:22 +03:00
alesapin
2d33a4029b
Merge pull request #14220 from ClickHouse/remove_redundant_flag
Disable force TTL on optimize final
2020-08-29 10:40:36 +03:00
Amos Bird
591a4d60d4
Fix bug in mark inclusion search. 2020-08-29 09:46:46 +08:00
alesapin
ebc163c924 Merge branch 'master' into parts_default_compression 2020-08-28 23:11:42 +03:00
alesapin
10c7a6c45e
Add ability to specify Default codec for columns (#14049)
* Add ability to specify DefaultCompression codec which correspond to settings specified in config.xml

* Fix style

* Rename DefaultCompression to simple Default

* Fix compression codec

* Better codec description representation

* Less strange code and one method

* Fix delta
2020-08-28 20:40:45 +03:00
alesapin
65c33f0802
Merge pull request #13280 from amosbird/as
ALTER MODIFY SAMPLE BY
2020-08-28 19:32:09 +03:00
alesapin
232c264d7d Disable force TTL on optimise 2020-08-28 16:45:42 +03:00
alesapin
1ea00d5e7a Fix test and better messages 2020-08-28 14:12:51 +03:00
alesapin
b599d0a1ff Simplify function 2020-08-28 13:47:29 +03:00
alesapin
0896b49533 Small fixes 2020-08-28 13:18:56 +03:00
kssenii
4e0c619721 Global refactoring 2020-08-28 10:03:54 +00:00
alesapin
77faf9587f Better interface 2020-08-28 12:07:20 +03:00
Dongdong Yang
7e48edf42c fix issue #14202 2020-08-28 13:29:15 +08:00
Alexey Milovidov
5763737d97 Fixups 2020-08-28 03:53:22 +03:00
Alexey Milovidov
ed1d120de0 Added another test; fixup 2020-08-28 03:28:37 +03:00
Alexey Milovidov
c4e8aaac16 Fixups 2020-08-28 03:07:51 +03:00