Commit Graph

344 Commits

Author SHA1 Message Date
vdimir
30e112d6a6
Do not convert join key columns for storage/dict join 2021-08-31 15:27:43 +03:00
Anton Popov
61239343e3 Merge remote-tracking branch 'origin/sparse-serialization' into HEAD 2021-08-20 16:33:30 +03:00
Maksim Kita
01682a86b3 Updated user defined functions implementation 2021-08-19 00:54:55 +03:00
vdimir
910787c5b6
Improve aliased_column_distributed_bug, fix check 2021-08-16 18:04:20 +03:00
vdimir
db187c6b2d
Fix aliased_column_distributed_bug 2021-08-16 17:26:14 +03:00
Anton Popov
9a9aebc644 fix tests 2021-08-04 20:38:10 +03:00
Anton Popov
699a3d9031 implement legacy_column_name_of_tuple_literal in less intrusive way 2021-08-03 21:03:24 +03:00
Anton Popov
e36736b50c Merge remote-tracking branch 'origin/sparse-serialization' into HEAD 2021-08-02 22:52:02 +03:00
Vladimir
576b407804
Support conditions in JOIN ON section (#24420)
* Try to enforce table identification in CollectJoinOnKeysMatcher

* Support filtering conditions in JOIN ON for HashJoin

* Correct handle non equi join

* Update test 00878_join_unexpected_results

* Join on filters calculated as one row before join

* Do not lookup key in hash join if condition for row is not hold

* better

* Support filtering conditions in JOIN ON for MergeJoin

* Support Nullable mask in JOIN ON section

* Fix style in Interpreters/TableJoin.cpp

* Change return type of getColumnAsMask in join_common to ColumnPtr

* Handle Nullable(Nothing) type in JOIN ON section, add test cases

* Fix type cast JoinCommon::getColumnAsMask

* Check type if conditions in JOIN ON section, support functions

* Update tests with JOIN ON

* Style changes, add comments for conditions in JOIN ON section

* Add test cases for join on condtions

* JOIN ON key1 = key2 AND (cond1 OR cond2)

* Remove CollectJoinOnKeysVisitor has_join_keys

* Add test cases for join on nullable/lc conditions

* Fix style

* Change error code 48 to 403 in join on tests

* Fix whitespace
2021-07-21 20:03:33 +03:00
Anton Popov
f99374cca6 Merge remote-tracking branch 'origin/sparse-serialization' into HEAD 2021-07-20 18:20:21 +03:00
Amos Bird
d74aa64f6b
Fix column alias rewriting 2021-07-18 23:27:19 +08:00
Anton Popov
3ed7f5a6cc dynamic subcolumns: add snapshot for storage 2021-07-09 06:15:41 +03:00
vdimir
5d7fc61bd5
Merge branch 'master' into join-materialized-columns 2021-07-08 12:30:00 +03:00
Anton Popov
072e65b728 Merge remote-tracking branch 'origin/sparse-serialization' into HEAD 2021-07-07 17:20:38 +03:00
Azat Khuzhin
15a14d6da2 Fix "No available columns" for Merge() storage 2021-06-29 00:39:38 +03:00
vdimir
2949cd1e6f
Support ALIASed columns in JOIN ON expression 2021-06-25 14:50:02 +03:00
vdimir
241b64d02c
Support ALIASed columns for right joined table 2021-06-24 17:57:21 +03:00
vdimir
84e02911cf
Materialized columns for joined table, don't add to asterisk select 2021-06-24 17:14:36 +03:00
vdimir
b00efaf3d1
Add materialized columns to joined columns 2021-06-23 17:03:39 +03:00
Amos Bird
0f7728cd5e
Fix RBAC test again 2021-06-17 23:00:03 +08:00
Amos Bird
aaac231c6a
Record expanded aliases for RBAC 2021-06-15 18:28:13 +08:00
Amos Bird
e3ae2f6e7a
Rewrite more alias columns 2021-06-15 17:54:28 +08:00
alexey-milovidov
05d1af153c
Merge branch 'master' into rename-const-context-ptr 2021-06-12 03:25:09 +03:00
Anton Popov
bb6f0dfbb8
Merge pull request #24406 from CurtizJ/rewrite-functions-to-subcolumns
Optimize some functions to subcolumns
2021-06-09 11:07:09 +03:00
alesapin
11a1606c15 Less strict 2021-06-08 12:54:00 +03:00
Anton Popov
6a5daca135 dynamic subcolumns: new format and several fixes 2021-06-08 12:33:04 +03:00
alesapin
5284f192ee Ban loop aliases in table definitions 2021-06-07 23:59:38 +03:00
Nikolai Kochetov
dbaa6ffc62 Rename ContextConstPtr to ContextPtr. 2021-06-01 15:20:52 +03:00
Anton Popov
9f52362b81 Merge remote-tracking branch 'origin/sparse-serialization' into HEAD 2021-05-31 23:08:45 +03:00
Anton Popov
b24f65e1ad Merge remote-tracking branch 'upstream/master' into HEAD 2021-05-31 23:04:52 +03:00
Alexander Kuzmenkov
3f57fc085b remove mutable context references from functions interface
Also remove it from some visitors.
2021-05-28 19:45:37 +03:00
Anton Popov
0bdf9d207c Merge remote-tracking branch 'origin/sparse-serialization' into HEAD 2021-05-26 00:25:47 +03:00
Anton Popov
13cfedd188 optimize some functions to subcolumns 2021-05-21 21:48:19 +03:00
Amos Bird
ebaf42a448
Reformat and fix some tests 2021-05-11 18:12:27 +08:00
Amos Bird
264cff6415
Projections
TODO (suggested by Nikolai)

1. Build query plan fro current query (inside storage::read) up to WithMergableState
2. Check, that plan is simple enough: Aggregating - Expression - Filter - ReadFromStorage (or simplier)
3. Check, that filter is the same as filter in projection, and also expression calculates the same aggregation keys as in projection
4. Return WithMergableState if projection applies

3 will be easier to do with ActionsDAG, cause it sees all functions, and dependencies are direct (but it is possible with ExpressionActions also)

Also need to figure out how prewhere works for projections, and
row_filter_policies.

wip
2021-05-11 18:12:23 +08:00
Anton Popov
e44706911e dynamic columns: better getting of sample block 2021-05-05 02:02:54 +03:00
Amos Bird
8a3b5c1fab
Add _partition_value virtual column 2021-04-27 16:15:59 +08:00
Anton Popov
644df6be7d dynamic subcolumns: wip 2021-04-24 07:09:01 +03:00
Alexander Kuzmenkov
5e0fb440a5
Update TreeRewriter.cpp 2021-04-16 13:35:02 +03:00
Alexander Kuzmenkov
2489b6af96 cleanup 2021-04-15 19:40:49 +03:00
Alexander Kuzmenkov
3b95b637a5 Merge remote-tracking branch 'origin/master' into HEAD 2021-04-15 18:19:53 +03:00
Vladimir
8c7ffda676
Merge pull request #22753 from ClickHouse/revert-19685-dev_joinon 2021-04-15 12:42:50 +03:00
Nikolai Kochetov
e731dfe650
Merge pull request #22991 from ClickHouse/untuple-and-subquery
Fix subquery with untuple.
2021-04-13 09:53:13 +03:00
hexiaoting
77c460e8d1 Merge remote-tracking branch 'origin/master' into dev-sumcount 2021-04-13 11:14:14 +08:00
Nikolai Kochetov
0448e1415f Fix subquery with untuple. 2021-04-12 15:15:55 +03:00
Ivan
495c6e03aa
Replace all Context references with std::weak_ptr (#22297)
* Replace all Context references with std::weak_ptr

* Fix shared context captured by value

* Fix build

* Fix Context with named sessions

* Fix copy context

* Fix gcc build

* Merge with master and fix build

* Fix gcc-9 build
2021-04-11 02:33:54 +03:00
Vladimir
9fe20c1628
Revert "Move conditions from JOIN ON to WHERE" 2021-04-07 14:57:20 +03:00
vdimir
3f464595eb
Accurate removing 'join' part for queries to 'Merge' engine 2021-04-01 14:31:57 +03:00
alexey-milovidov
5c15b8a896
Merge branch 'master' into virtualutil 2021-03-30 23:59:44 +03:00
Amos Bird
69204e1d21
Add prefer_column_name_to_alias settings (#22044) 2021-03-30 16:51:45 +03:00
Alexey Milovidov
230b2930b7 Merge branch 'master' into virtualutil 2021-03-30 00:43:00 +03:00
hexiaoting
ab2aaa7fe7 Rewriter visitor and add performance test 2021-03-12 15:29:38 +08:00
hexiaoting
055073931a Fix build error 2021-03-09 17:03:24 +08:00
hexiaoting
9dab51698f Rewriter fuse logical 2021-03-08 11:58:18 +08:00
vdimir
b0f6f30298
Revert "Refactor join: make IJoin implementations independent from TableJoin"
This reverts commit e6406c3f4c.
2021-03-05 17:34:43 +03:00
vdimir
e6406c3f4c
Refactor join: make IJoin implementations independent from TableJoin 2021-03-05 16:38:49 +03:00
Amos Bird
93b661ad5a
partition id pruning 2021-03-04 19:43:03 +08:00
hexiaoting
4fe75ad168 fix error 2021-03-03 17:18:53 +08:00
hexiaoting
e116346cbb Merge remote-tracking branch 'origin/master' into dev-sumcount 2021-03-02 10:11:50 +08:00
hexiaoting
16333e9f3a Suppport fuse aggregate functions:sum/avg/count to sumCount 2021-03-01 18:04:34 +08:00
vdimir
b7c7c97d10
Merge branch 'master' into join-cast-types-v2 2021-03-01 11:42:21 +03:00
alexey-milovidov
0067a3beac
Merge pull request #19801 from ucasFL/ms
continue of #19487
2021-02-25 19:12:47 +03:00
vdimir
4c6cde4d53
Merge remote-tracking branch 'upstream/master' into join-cast-types-v2 2021-02-25 16:24:28 +03:00
vdimir
1e37d7c84f
Add comments to TableJoin::inferJoinKeyCommonType 2021-02-19 14:28:41 +03:00
vdimir
3a7eddcf3a
Remove addRequiredLeftColumn, some tests for join on different types 2021-02-19 14:28:40 +03:00
vdimir
a378bd08aa
Perform implicit type conversion for JOIN ON keys 2021-02-19 14:28:40 +03:00
vdimir
435f63f42b
Calculate common type for join using in TreeRewriter
Split before_join and converting_join_columns dags

Add more detailed comments for column type conversion for join using
2021-02-19 14:28:32 +03:00
Amos Bird
2c4bc43014
Backward compatible 2021-02-18 20:20:29 +08:00
Amos Bird
2dc7ba160a
Better 2021-02-18 20:20:28 +08:00
Amos Bird
77fd060665
Normalize function names 2021-02-18 20:20:28 +08:00
vdimir
3e2c9ad011
Merge remote-tracking branch 'origin/master' into dev_joinon 2021-02-16 17:08:10 +03:00
vdimir
e39215e38b
Fix has_some condition on CollectJoinOnKeysVisitor 2021-02-16 11:03:02 +03:00
vdimir
5273242f86
Minor changes move ON to WHERE for INNER JOIN 2021-02-15 23:26:29 +03:00
hexiaoting
28b981a76b Fix style error and test cases error 2021-02-09 18:08:55 +08:00
vdimir
241769ee7c
Handle syntax error for ARRAY JOIN with no args 2021-02-09 11:21:26 +03:00
hexiaoting
2c278f1e02 Restrict move JOINON to WHERE optimizer only to inner join 2021-02-08 13:44:50 +08:00
hexiaoting
45aee71fff Modified some implementation 2021-02-03 18:52:20 +08:00
hexiaoting
56de38ea6a Merge remote-tracking branch 'origin/master' into dev_joinon 2021-02-03 17:20:24 +08:00
feng lv
45cb78a67b continue of #19487
fix
2021-01-29 08:22:03 +00:00
hexiaoting
4a17f5c73a Move condistions from JOIN ON to WHERE 2021-01-27 11:24:17 +08:00
feng lv
9fdae60497 remove part of misleading exception message 2021-01-23 05:45:36 +00:00
Alexander Kuzmenkov
d0922e2985 Merge remote-tracking branch 'origin/master' into tmp 2021-01-18 23:23:49 +03:00
alexey-milovidov
15f4ae26c2
Merge pull request #17310 from CurtizJ/multiple-nested
Allow nested with multiple nesting and subcolumns of complex types
2021-01-17 15:00:26 +03:00
alexey-milovidov
d2366b5c6c
Merge pull request #18233 from vitlibar/fix-access-rights-for-select-count
Fix access rights for SELECT count()
2021-01-17 00:12:08 +03:00
alexey-milovidov
78fff6bc39
Merge branch 'master' into multiple-nested 2021-01-15 14:54:27 +03:00
Alexander Kuzmenkov
828dea83cb Merge remote-tracking branch 'origin/master' into tmp 2021-01-14 18:50:34 +03:00
Alexander Kuzmenkov
703731c547 something works 2021-01-13 22:29:52 +03:00
alexey-milovidov
aa6e827d8b
Update TreeRewriter.cpp 2021-01-12 16:54:11 +03:00
sundyli
f8815f233c
Merge branch 'master' into alias_column_partition_prune 2021-01-02 11:23:55 +08:00
Alexey Milovidov
4b3ae495d6 Merge branch 'master' into CurtizJ-multiple-nested 2021-01-02 00:25:16 +03:00
Vitaly Baranov
235ea220ec SELECT count() FROM table now requires at least one column to be accessible in the table. 2020-12-30 15:00:08 +03:00
Anton Popov
11283e3d81 Merge remote-tracking branch 'upstream/master' into HEAD 2020-12-25 21:25:59 +03:00
Alexander Kuzmenkov
a17f0b50ad Merge remote-tracking branch 'origin/master' into tmp 2020-12-25 10:34:28 +03:00
Yatsishin Ilya
ce1e2b18a3 Fix codespell warnings. Split style checks. Update style checks docker 2020-12-24 13:17:52 +03:00
Alexander Kuzmenkov
912995cbae some provision for aggregate fns as window fn args
(doesn't work yet)

also a perf test w/LIMIT BY
2020-12-24 11:49:55 +03:00
Anton Popov
57857dda63 Merge remote-tracking branch 'upstream/master' into HEAD 2020-12-23 15:16:43 +03:00
Alexander Kuzmenkov
51b2329295
Merge branch 'master' into aku/window-prototype 2020-12-23 09:26:11 +03:00
Nikita Mikhaylov
dae1e9ba31
Merge pull request #17857 from fastio/feature_hints_for_column_names
hints for column names
2020-12-23 04:55:41 +03:00
Nikita Mikhaylov
9d8948657c
Update TreeRewriter.cpp 2020-12-23 04:54:49 +03:00
Anton Popov
1be39fddac fix subcolumns with some storages 2020-12-22 19:42:37 +03:00
Anton Popov
b6ff6300b2 Merge remote-tracking branch 'upstream/master' into HEAD 2020-12-22 18:06:21 +03:00
hexiaoting
93d28ef5c9
Implement untuple field access (#18309) 2020-12-22 16:48:40 +03:00
Alexander Kuzmenkov
52ace7a3d1 one plan step per window 2020-12-22 04:37:45 +03:00
Peng Jian
69b40ffae5 fix nullptr 2020-12-21 21:46:55 +08:00
Alexander Kuzmenkov
132a0b42eb cleanup 2020-12-18 20:13:28 +03:00
Anton Popov
a42b00c9aa Merge remote-tracking branch 'upstream/master' into HEAD 2020-12-17 20:43:23 +03:00
sundy-li
84807e9791 rename settings 2020-12-17 02:17:59 +00:00
Alexander Kuzmenkov
fabb37d3c9 cleanup 2020-12-15 20:39:58 +03:00
fastio
e7bce63d3a hints for column names 2020-12-15 20:23:31 +08:00
sundy-li
d72d8ee7d8 apply review advices 2020-12-15 16:35:19 +08:00
Alexander Kuzmenkov
a75ca3cb79 Merge remote-tracking branch 'origin/master' into tmp 2020-12-15 03:36:43 +03:00
sundy-li
d2209a1460 trivial fix 2020-12-13 17:33:02 +08:00
sundyli
36ca21c24a
Merge branch 'master' into alias_column_partition_prune 2020-12-13 00:45:14 +08:00
sundy-li
9407028540 update 2020-12-13 00:42:15 +08:00
alexey-milovidov
0d6fe7121d
Merge pull request #17887 from sundy-li/trivial_count-fix
disable optimize_trivial_count in query with array join
2020-12-12 02:44:07 +03:00
feng lv
3ee6b6382b fix
fix
2020-12-11 02:00:18 +00:00
Alexander Kuzmenkov
88e7bc5b60 Merge origin/master into tmp (using imerge) 2020-12-10 22:12:42 +03:00
Alexander Kuzmenkov
eb0c817bf2 expression analyzer part 2020-12-09 14:14:40 +03:00
feng lv
91c3de9664 fix
fix

fix
2020-12-09 09:13:51 +00:00
feng lv
e95e443246 fix
fix
2020-12-09 04:32:28 +00:00
feng lv
9b2bb1820a Merge branch 'master' of github.com:ClickHouse/ClickHouse into agg-func-setting-null-for-empty 2020-12-09 02:28:49 +00:00
sundy-li
d9176263aa disable optimize_trivial_count in query with array join 2020-12-08 16:00:12 +08:00
Anton Popov
d7aad3bf79 Merge remote-tracking branch 'upstream/master' into HEAD 2020-12-07 19:13:01 +03:00
Ivan
315ff4f0d9
ANTLR4 Grammar for ClickHouse and new parser (#11298) 2020-12-04 05:15:44 +03:00
alexey-milovidov
49af4ff7c9
Merge pull request #16988 from CurtizJ/fix-perf-storage-merge
Fix performance with Merge table over huge number of MergeTree tables
2020-11-29 20:46:29 +03:00
Anton Popov
be493ed561 fix nested and subcolumns 2020-11-24 17:14:47 +03:00
Anton Popov
b384beb564 Merge remote-tracking branch 'upstream/master' into HEAD 2020-11-23 17:46:51 +03:00
Anton Popov
1e24d6085a fix performance with Merge table over huge number of MergeTree tables 2020-11-13 18:56:25 +03:00
Anton Popov
a03b6df897 fix order by optimization with monotonous functions 2020-11-13 02:58:33 +03:00
feng lv
eb46951e75 aggregate_functions_null_for_empty move OrNull ahead 2020-11-12 15:55:26 +00:00
tavplubix
058aa8f85e
Merge pull request #16824 from ClickHouse/replace_stringstreams_with_buffers
Replace std::*stringstreams with DB::*Buffers
2020-11-12 01:11:44 +03:00
Alexander Tokmakov
b94cc5c4e5 remove more stringstreams 2020-11-10 21:22:26 +03:00
Anton Popov
9b354be66f Merge remote-tracking branch 'upstream/master' into HEAD 2020-11-10 16:21:11 +03:00
fenglv
ca51cf9235 Make member function const to prevent -readability-make-member-function-const 2020-11-10 07:20:50 +00:00
Alexey Milovidov
fd84d16387 Fix "server failed to start" error 2020-11-07 03:14:53 +03:00
feng lv
269e96f17e fix 2020-11-04 12:15:31 +00:00
alexey-milovidov
6f004e4abd
Merge branch 'master' into agg-func-setting-null-for-empty 2020-11-04 13:24:39 +03:00
Anton Popov
a249f0c95e Merge remote-tracking branch 'upstream/master' into HEAD 2020-10-23 22:05:00 +03:00
feng lv
5254a5ded7 add setting aggregate_functions_null_for_empty 2020-10-18 20:18:31 +08:00
Amos Bird
867216103f
Extend trivial count optimization. 2020-10-08 18:08:17 +08:00
Anton Popov
cb4801e3be allow to read subcolumns of complex types 2020-09-18 02:12:43 +03:00
Alexey Milovidov
12f66fa82c Fix 99% of typos 2020-08-08 04:01:47 +03:00
Alexander Tokmakov
237accd154 Merge branch 'master' into database_atomic_improvements 2020-07-23 06:33:20 +03:00
Artem Zuikov
2afd123eda
Refactoring: extract TreeOptimizer from SyntaxAnalyzer (#12645) 2020-07-22 20:13:05 +03:00