Commit Graph

333 Commits

Author SHA1 Message Date
Ilya Golshtein
7f991bf6e7 merge_row_policy: a comment 2023-10-16 21:49:16 +00:00
Ilya Golshtein
ea95a49e86 merge_row_policy: some changes per code review 2023-10-16 21:22:43 +00:00
Anton Popov
a01acf5d2a remove projection from StorageSnapshot 2023-10-13 03:18:43 +00:00
Anton Popov
fb666e137c remove old code of projection analysis 2023-10-12 23:25:20 +00:00
Alexey Milovidov
2aaddcce18 Better exception messages 2023-10-08 22:54:33 +02:00
Ilya Golshtein
3480243fa3 merge_row_policy: per code review 2023-10-05 08:23:53 +00:00
Ilya Golshtein
9a561cff82 merge_row_policy: cleanup, verbose short messages in 00002_log ... 2023-10-05 08:23:53 +00:00
Ilya Golshtein
57f1e56276 merge_row_policy: cleanup, comments, new tests 2023-10-05 08:23:52 +00:00
Ilya Golshtein
6161116bf2 merge_row_policy: stylecheck again 2023-10-05 08:23:52 +00:00
Ilya Golshtein
f89a538f31 merge_row_policy: stylecheck 2023-10-05 08:23:52 +00:00
Ilya Golshtein
b39a201cd0 merge_row_policy: refactored with ReadFromMerge::RowPolicyData 2023-10-05 08:23:52 +00:00
Ilya Golshtein
b57d8bc4a9 merge_row_policy: works again with adding missed columns 2023-10-05 08:23:52 +00:00
Ilya Golshtein
f4c77c1f18 merge_row_policy: namesDifference, try to handle nonselected columns 2023-10-05 08:23:52 +00:00
Ilya Golshtein
e2ddf40cfd merge_row_policy: further cleanup 2023-10-05 08:23:52 +00:00
Ilya Golshtein
da5f607242 merge_row_policy: cleanup, remove some debug output 2023-10-05 08:23:52 +00:00
Ilya Golshtein
978a535849 merge_row_policy: addFilter(() together with FilterTransform 2023-10-05 08:23:52 +00:00
Ilya Golshtein
a19cd8089b merge_row_policy: add_filter() actually works 2023-10-05 08:23:52 +00:00
Ilya Golshtein
c457fa727e merge_row_policy: addFilter() instead of FilterTransform 2023-10-05 08:23:52 +00:00
Ilya Golshtein
359cd4d32a merge_row_policy: style fixes and back to storage->read 2023-10-05 08:23:52 +00:00
Ilya Golshtein
657c39c79e merge_row_policy: row_policy_storage_merge test 2023-10-05 08:23:52 +00:00
Ilya Golshtein
b6f682dc3f merge_row_policy: FilterTransform 2023-10-05 08:23:52 +00:00
Ilya Golshtein
eebdff472e merge_row_policy: original behavior restored + extra debug 2023-10-05 08:23:52 +00:00
Ilya Golshtein
2acc4c223d merge_row_policy - extra debug 2023-10-05 08:23:52 +00:00
Ilya Golshtein
0464b4fd06 merge_row_policy: with QueryProcessingStage::Complete 2023-10-05 08:23:52 +00:00
Ilya Golshtein
1e31859936 merge_row_policy: tiny cleanup 2023-10-05 08:23:52 +00:00
Ilya Golshtein
020d76a383 merge_row_policy: initial 2023-10-05 08:23:52 +00:00
Nikita Taranov
86f4f91573
Merge branch 'master' into fix_key_analysis_merge_engine 2023-09-27 16:13:14 +02:00
Nikita Taranov
595027b1c6 better 2023-09-26 11:51:34 +02:00
Nikita Taranov
694792fa5d fix for analyzer 2023-09-25 23:58:29 +02:00
Nikita Taranov
8d19566c7d impl 2023-09-25 23:58:20 +02:00
Robert Schulze
f5137dd0b4
More clang-tidy fixes 2023-09-21 14:40:57 +00:00
Azat Khuzhin
5611b2fff4 Add a note about not working _table filter for Merge with analyzer
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-07-27 16:35:17 +02:00
Dmitry Novik
97a1ea01ba Fix removeJoin 2023-06-22 15:10:53 +00:00
Dmitry Novik
47fafdc32c Code cleanup 2023-06-21 18:06:24 +00:00
Dmitry Novik
88fe30254a Small fixup 2023-06-21 17:55:14 +00:00
Dmitry Novik
118b84703b WIP on StorageMerge and distributed JOIN 2023-06-21 01:51:34 +02:00
Dmitry Novik
20c752fb78 Fix generated query 2023-06-19 15:44:01 +00:00
Dmitry Novik
6489922dc1 Fix for column aliases that use other aliases 2023-06-16 18:49:59 +00:00
Dmitry Novik
55b81a5a5e Fix style 2023-06-13 23:13:18 +00:00
Dmitry Novik
fc9ee3eb4e Correctly build the ActionsDAG 2023-06-13 15:01:31 +00:00
Dmitry Novik
26c9042ea0 Analyzer: support aliases in StorageMerge 2023-06-12 17:06:52 +00:00
Nikita Mikhaylov
1c3b6738f4
Fixes for parallel replicas (#50195) 2023-05-25 14:41:04 +02:00
Yakov Olkhovskiy
35e9e45249
Merge pull request #48062 from Algunenano/unnecessary_alter_checks
Only check MV on ALTER when necessary
2023-04-03 17:23:11 -04:00
Azat Khuzhin
907ed27ae2 Fix crash in EXPLAIN PIPELINE for Merge over Distributed
CI: https://s3.amazonaws.com/clickhouse-test-reports/48314/179450542879d11711cd2415c3fa7eeab18188be/fuzzer_astfuzzerasan/report.html
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-04-02 10:48:23 +02:00
vdimir
588fdcffdf
comment child_plans in ReadFromMerge 2023-03-29 09:42:32 +00:00
vdimir
7a85974c35
Fix crash in explain graph with StorageMerge 2023-03-28 11:04:07 +00:00
Raúl Marín
d1a6c1991a Only check MV on ALTER when necessary 2023-03-27 17:45:15 +02:00
Robert Schulze
348a40aa5d
Compile with C++23 2023-03-10 19:11:58 +00:00
Maksim Kita
51ee007e01 Fixed tests 2023-03-01 18:05:07 +01:00
Azat Khuzhin
86e9b131c7 Allow PREWHERE for Merge with different DEFAULT expression for column
It can be not that special to have Merge engine w/o default expression,
while MergeTree will have it. So improve PREWHERE for such kinds, and
also allow PREWHERE for DEFAULT and MATERIALIZED (since both are
physical columns on disk and this make sense).

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-02-24 16:33:49 +01:00
Maksim Kita
6dffe52e68
Merge pull request #46471 from kitaisreal/analyzer-planner-fixes-before-enable-by-default
Analyzer planner fixes before enable by default
2023-02-19 13:49:18 +03:00
Azat Khuzhin
beff5ac795 Fix PREWHERE for Merge with different default types
In case of underlying table has an ALIAS for this column, while in Merge
table it is not marked as an alias, there will NOT_FOUND_COLUMN_IN_BLOCK
error.

Further more, when underlying tables has different default type for the
column, i.e. one has ALIAS and another has real column, then you will
also get NOT_FOUND_COLUMN_IN_BLOCK, because Merge engine should take
care of this.

Also this patch reworks how PREWHERE is handled for Merge table, and now
if you use PREWHERE on the column that has the same type and default
type (ALIAS, ...) then it will be possible, and only if the type
differs, it will be prohibited and throw ILLEGAL_PREWHERE error.

And last, but not least, also respect this restrictions for
optimize_move_to_prewhere.

v2: introduce IStorage::supportedPrewhereColumns()
v3: Remove excessive condition for PREWHERE in StorageMerge::read()
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-02-16 17:21:53 +01:00
Maksim Kita
6b2adc1ec2 Analyzer storage Merge fixes 2023-02-16 12:17:03 +01:00
Maksim Kita
b1ab2af7ad Analyzer support storage Merge 2023-02-16 12:17:03 +01:00
Vladimir C
89cb55aa1f
whitespace 2023-02-13 12:19:31 +01:00
Vladimir C
ea670acb72
Add comment to requestReadingInOrder 2023-02-10 20:05:18 +01:00
vdimir
45f7ef6c8f
Do not apply read in reverse order for queries with final 2023-02-09 11:00:22 +00:00
flynn
2d1dd694c6 make _table LowCardinality 2023-02-02 16:33:31 +00:00
Alexander Tokmakov
70d1adfe4b
Better formatting for exception messages (#45449)
* save format string for NetException

* format exceptions

* format exceptions 2

* format exceptions 3

* format exceptions 4

* format exceptions 5

* format exceptions 6

* fix

* format exceptions 7

* format exceptions 8

* Update MergeTreeIndexGin.cpp

* Update AggregateFunctionMap.cpp

* Update AggregateFunctionMap.cpp

* fix
2023-01-24 00:13:58 +03:00
Alexander Tokmakov
910d6dc0ce
Merge pull request #45342 from ClickHouse/exception_message_patterns
Save message format strings for DB::Exception
2023-01-20 18:46:52 +03:00
Antonio Andelic
76eb3e3b3c Fix test 2023-01-17 07:34:39 +00:00
Alexander Tokmakov
522686f78b less empty patterns 2023-01-17 01:19:44 +01:00
Antonio Andelic
108b2384e7 Disable prewhere in storage merge if types don't match 2023-01-16 13:39:46 +00:00
Maksim Kita
fbba28b31e Analyzer aggregation without column fix 2023-01-10 16:49:55 +01:00
Vladimir C
75e9a45341
Merge pull request #44716 from ClickHouse/vdimir/merge_engine_nullable 2023-01-09 11:38:04 +01:00
Nikolai Kochetov
398ae6a216 Fix style. 2023-01-06 15:33:19 +00:00
Nikolai Kochetov
58c7547f51 Removed check and added a test. 2023-01-06 15:04:00 +00:00
Nikolai Kochetov
a0dad93a38 Check whatt if disable some checks in storage Merge. 2023-01-06 13:26:15 +00:00
Vladimir C
2ff0d7e942
Apply suggestion 2022-12-30 16:48:57 +01:00
vdimir
aa3ecbab0a
Fix bug with wring type in Merge table with PREWHERE 2022-12-29 15:22:31 +00:00
Maksim Kita
99de697ea2 Analyzer added indexes support 2022-12-08 17:30:32 +01:00
Nikolai Kochetov
9ffebf4a0c Fixing read-in-order for special storages. 2022-11-01 19:51:52 +00:00
Maksim Kita
ca93ee7479 Fixed tests 2022-10-24 10:22:20 +02:00
Maksim Kita
fed146e198 Added SAMPLE BY support. Added SAMPLE BY, FINAL support for JOINS. 2022-10-24 10:22:20 +02:00
Azat Khuzhin
4e76629aaf Fixes for -Wshorten-64-to-32
- lots of static_cast
- add safe_cast
- types adjustments
  - config
  - IStorage::read/watch
  - ...
- some TODO's (to convert types in future)

P.S. That was quite a journey...

v2: fixes after rebase
v3: fix conflicts after #42308 merged
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-10-21 13:25:19 +02:00
Alexey Milovidov
ab4db2d0c4 Fix 5/6 of trash 2022-09-19 08:50:53 +02:00
Duc Canh Le
24682556a4
Fix storage merge on view cannot use primary index (#40233)
* fix storage merge on view cannot use index

* minor fix code + tests

* fix view stage

* fix stage

* fix style

* fix tests
2022-08-19 14:24:22 +02:00
Amos Bird
fa8fab2e8f
Fix KeyCondition with other filters 2022-08-11 19:20:44 +08:00
Nikolai Kochetov
51c4c9c957 Fixing build. 2022-07-27 15:45:23 +00:00
Nikolai Kochetov
f9a8a4cd32 Fixing read-in-order for Merge 2022-07-27 12:00:55 +00:00
Nikolai Kochetov
1adb021df6 Fixing tests. 2022-07-26 18:42:27 +00:00
Nikolai Kochetov
d7cc3831ea Push predicate over StorageMerge. 2022-07-26 15:01:39 +00:00
Nikolai Kochetov
c5110bb164 Add a query plan step for StorageMerge 2022-07-26 14:43:05 +00:00
Nikolai Kochetov
be9c7ed52c Add ReadFromMerge step. 2022-07-25 19:41:43 +00:00
avogar
59c1c472cb Better exception messages on wrong table engines/functions argument types 2022-06-23 20:04:06 +00:00
Nikolai Kochetov
b80b1940ce Fix some tests. 2022-05-27 20:47:35 +00:00
Nikolai Kochetov
1b85f2c1d6 Merge branch 'master' into refactor-read-metrics-and-callbacks 2022-05-25 16:27:40 +02:00
Nikolai Kochetov
fd97a9d885 Move some resources 2022-05-23 19:47:32 +00:00
Nikolai Kochetov
9756b759c6 Move some resources 2022-05-23 13:46:57 +00:00
Nikolai Kochetov
56feef01e7 Move some resources 2022-05-20 19:49:31 +00:00
Anton Popov
e911900054 remove last mentions of data streams 2022-05-09 19:15:24 +00:00
Robert Schulze
330212e0f4
Remove inherited create() method + disallow copying
The original motivation for this commit was that shared_ptr_helper used
std::shared_ptr<>() which does two heap allocations instead of
make_shared<>() which does a single allocation. Turned out that
1. the affected code (--> Storages/) is not on a hot path (rendering the
performance argument moot ...)
2. yet copying Storage objects is potentially dangerous and was
   previously allowed.

Hence, this change

- removes shared_ptr_helper and as a result all inherited create() methods,

- instead, Storage objects are now created using make_shared<>() by the
  caller (for that to work, many constructors had to be made public), and

- all Storage classes were marked as noncopyable using boost::noncopyable.

In sum, we are (likely) not making things faster but the code becomes
cleaner and harder to misuse.
2022-05-02 08:46:52 +02:00
Amos Bird
e73d7fea31
Rename narrowBlockInputStream to narrowPipe 2022-04-24 18:33:48 +08:00
Maksim Kita
57444fc7d3
Merge pull request #36444 from rschu1ze/clang-tidy-fixes
Clang tidy fixes
2022-04-21 16:11:27 +02:00
Robert Schulze
b24ca8de52
Fix various clang-tidy warnings
When I tried to add cool new clang-tidy 14 warnings, I noticed that the
current clang-tidy settings already produce a ton of warnings. This
commit addresses many of these. Almost all of them were non-critical,
i.e. C vs. C++ style casts.
2022-04-20 10:29:05 +02:00
Robert Schulze
118e94523c
Activate clang-tidy warning "readability-container-contains"
This check suggests replacing <Container>.count() by
<Container>.contains() which is more speaking and in case of
multimaps/multisets also faster.
2022-04-18 23:53:11 +02:00
Alexey Milovidov
242919eddd Remove abbreviation 2022-04-18 01:02:49 +02:00
Alexander Tokmakov
07d952b728 use snapshots for semistructured data, durability fixes 2022-03-17 18:26:18 +01:00
Anton Popov
df3b07fe7c Merge remote-tracking branch 'upstream/master' into HEAD 2022-03-03 22:25:28 +00:00
Maksim Kita
b1a956c5f1 clang-tidy check performance-move-const-arg fix 2022-03-02 18:15:27 +00:00