Commit Graph

352 Commits

Author SHA1 Message Date
Vladimir C
db2aad6f59
Apply suggestions from code review
Co-authored-by: Dmitry Novik <n0vik@clickhouse.com>
2022-11-28 15:47:32 +01:00
Maksim Kita
c46a659ad9
Merge pull request #43543 from kitaisreal/analyzer-sum-if-to-count-if-fix
Analyzer SumIfToCountIfPass fix
2022-11-25 21:02:20 +03:00
Nikolai Kochetov
8d3ccf1c52
Merge pull request #43636 from ClickHouse/fix-43478
Fix #43478
2022-11-25 14:49:41 +01:00
Maksim Kita
fbb404a4c6
Merge pull request #43547 from kitaisreal/analyzer-uniq-injective-functions-elimination-pass-fix
Analyzer UniqInjectiveFunctionsEliminationPass
2022-11-25 13:14:33 +03:00
Smita Kulkarni
60ec65eb21 Fixed style check issues - Support scalar subqueries cache 2022-11-25 07:35:10 +01:00
Smita Kulkarni
aa35df7098 Support scalar subqueries cache
Implementation:
* Added a map with hash of the node (without alias) and the evaluated value to Context.
Testing:
* Added a test-case with new analyser in 02174_cte_scalar_cache.sql
2022-11-24 21:44:26 +01:00
Nikolai Kochetov
bb98a7b433 Fix #43478 2022-11-24 17:28:01 +00:00
vdimir
6241ed65e5
Fixes for FuseFunctionsPass 2022-11-23 15:32:02 +00:00
vdimir
5791d8d0af
FuseFunctionsPass: do not add same node into mapping twice 2022-11-23 15:30:27 +00:00
Maksim Kita
ee9a18f0d9 Analyzer table functions untuple fix 2022-11-23 16:03:06 +01:00
Maksim Kita
0bc3ff1ba3 Analyzer UniqInjectiveFunctionsEliminationPass 2022-11-23 14:55:34 +01:00
Maksim Kita
d2d44c5e54 Analyzer SumIfToCountIfPass fix 2022-11-23 14:55:12 +01:00
Maksim Kita
43a451d55e
Merge pull request #43321 from kitaisreal/analyzer-small-fixes
Analyzer small fixes
2022-11-23 13:19:32 +03:00
Maksim Kita
1e1492e480 Fixed build 2022-11-22 14:35:44 +01:00
Maksim Kita
04f597c29c Fixed style check 2022-11-22 11:14:55 +01:00
Maksim Kita
0fe17c2c7b Fixed code review issues 2022-11-22 11:14:55 +01:00
Maksim Kita
cdc2fb0b59 Analyzer small fixes 2022-11-22 11:14:55 +01:00
taofengliu
a529943d9f Merge remote-tracking branch 'upstream/master' into group_by_all 2022-11-19 21:11:23 +08:00
Dmitry Novik
40adaeef92 Fix aggregate functions optimization 2022-11-18 16:15:37 +00:00
Vitaly Baranov
a348332eab
Merge pull request #43227 from vitlibar/improve-masking-sensitive-info
Improve masking sensitive info
2022-11-18 15:37:50 +01:00
Vladimir C
2d265523bb
Update src/Analyzer/Passes/QueryAnalysisPass.cpp 2022-11-16 12:45:54 +01:00
Vladimir C
981e6e2c24
Update src/Analyzer/Passes/QueryAnalysisPass.cpp 2022-11-16 12:44:54 +01:00
Alexey Milovidov
1ec21e5890
Merge branch 'master' into group_by_all 2022-11-16 06:14:04 +01:00
Vitaly Baranov
8d72f75556 Make the password wiping an option of IAST::format(). 2022-11-16 01:35:06 +01:00
Dmitry Novik
a7ea30179e Optimize keys of GROUPING SETS 2022-11-15 16:56:45 +00:00
Dmitry Novik
b2eca5c703 Support optimize_group_by_function_keys on top of QueryTree 2022-11-15 16:42:21 +00:00
vdimir
d7c882951f
Fix nullptr dereference in collectScopeValidIdentifiersForTypoCorrection 2022-11-15 12:36:28 +00:00
Maksim Kita
a7f0a2255f Analyzer aggregation crash fix 2022-11-11 10:51:49 +01:00
Maksim Kita
057cef469d Fixed comments 2022-11-10 19:21:51 +01:00
Maksim Kita
9398b96dde Fixed style check 2022-11-10 19:21:51 +01:00
Maksim Kita
8adc4c8163 Updated tests 2022-11-10 19:21:51 +01:00
Maksim Kita
7fb3f8f7c5 Updated tests 2022-11-10 19:21:51 +01:00
Maksim Kita
a6d2069c2b Added compound types typo corrections 2022-11-10 19:21:51 +01:00
Maksim Kita
66683dd175 Added function typo corrections 2022-11-10 19:21:51 +01:00
Maksim Kita
c627251f9e Added tests 2022-11-10 19:21:51 +01:00
Maksim Kita
e220906c9e Analyzer added identifier typo corrections 2022-11-10 19:21:51 +01:00
Maksim Kita
8c333817e8
Merge pull request #42689 from ClickHouse/vdimir/identifier-resolver-fuse-sum
Support optimize_syntax_fuse_functions for sum/count/avg via analyzer
2022-11-10 13:05:12 +03:00
Maksim Kita
ba8e7fde3f
Merge pull request #43048 from kitaisreal/analyzer-array-join-with-join-improvements
Analyzer improve ARRAY JOIN with JOIN
2022-11-10 12:42:16 +03:00
Maksim Kita
5a8c62ee01 Analyzer improve aliases support for table expressions 2022-11-09 18:09:24 +01:00
vdimir
6ec2074d8a
Fix check for count arguments number in FuseFunctionsPass 2022-11-09 14:25:43 +00:00
vdimir
5f5fbcee0c
Style fixes for FuseFunctionsPass 2022-11-09 11:48:02 +00:00
vdimir
d6da9f53f2
quantiles function in FuseFunctionsPass 2022-11-09 11:47:59 +00:00
vdimir
f732c97cf6
fixes for FuseFunctionsPass 2022-11-09 11:47:46 +00:00
vdimir
5de29257e6
Restore 02244_issue_35598_fuse 2022-11-09 11:47:46 +00:00
vdimir
14e8daf078
revert removing fuse_sum_count ast optimization 2022-11-09 11:47:43 +00:00
vdimir
7daf5200f0
better code in FuseFunctionsPass.cpp 2022-11-09 11:47:17 +00:00
vdimir
97e7c505ad
Support optimize_syntax_fuse_functions for sum/count/avg via analyzer 2022-11-09 11:47:15 +00:00
Maksim Kita
e0f1fd93f3 Updated tests 2022-11-08 18:25:13 +01:00
Maksim Kita
4defe90d89
Merge pull request #42879 from ClickHouse/query-validation
Validate Query Tree in debug
2022-11-08 16:31:09 +03:00
Maksim Kita
583c65d377 Analyzer subquery in JOIN TREE with aggregation 2022-11-08 14:29:17 +01:00
Maksim Kita
3b3e27f22a Analyzer improve ARRAY JOIN with JOIN 2022-11-08 14:25:23 +01:00
Dmitry Novik
8fa5cae01a Fix style check 2022-11-07 14:11:02 +00:00
taofengliu
ac385ff29a remove unneeded code 2022-11-05 22:20:53 +08:00
Nikolay Degterinsky
c6ea55403e Merge remote-tracking branch 'upstream/master' into better_asterisk_parser 2022-11-04 22:37:59 +00:00
Dmitry Novik
a860b25249 Improve ValidationChecker readability 2022-11-02 15:24:09 +00:00
taofengliu
7a38115e81 fix fuzzer bug 2022-11-02 21:09:35 +08:00
Nikolay Degterinsky
88d815c63e Improve Asterisk and ColumnMatcher parser 2022-11-02 06:21:02 +00:00
Dmitry Novik
e06572cc27 Validate Query Tree in debug 2022-11-01 23:03:07 +00:00
taofengliu
c43dd96f14 Merge remote-tracking branch 'upstream/master' into group_by_all
# Conflicts:
#	src/Analyzer/QueryNode.h
2022-11-01 22:53:44 +08:00
Maksim Kita
27a72f096c
Merge pull request #42705 from kitaisreal/analyzer-small-improvements
Analyzer improve subqueries representation
2022-11-01 13:54:12 +03:00
taofengliu
d0767cab1d GROUP BY ALL in Analyzer 2022-11-01 16:18:56 +08:00
Maksim Kita
d760c78754 Fixed code review issues 2022-10-31 11:45:12 +01:00
Maksim Kita
275d076cb7 Fixed style check 2022-10-27 11:26:53 +02:00
Maksim Kita
5fcbc26800 OrderByLimitByDuplicateEliminationPass improve performance 2022-10-27 11:23:30 +02:00
Maksim Kita
6a0e3fc31d Subqueries remove unnecessary table expression modifiers 2022-10-26 17:19:29 +02:00
Maksim Kita
2b44a00fbc UNION node remove unnecessary union modes 2022-10-26 16:47:40 +02:00
Maksim Kita
a28d1f01fd Analyzer IQueryTreeNode remove getName method 2022-10-25 12:54:17 +02:00
Maksim Kita
d0e64eb15b Fixed tests 2022-10-24 16:14:05 +02:00
Maksim Kita
9a02d25c0b Fixed tests 2022-10-24 10:22:38 +02:00
Maksim Kita
3862dd96fe Fixed tests 2022-10-24 10:22:38 +02:00
Maksim Kita
d083200d65 Fixed code review issues 2022-10-24 10:22:38 +02:00
Maksim Kita
561d585100 Fixed tests 2022-10-24 10:22:38 +02:00
Maksim Kita
39b2d25a43 Added tests 2022-10-24 10:22:38 +02:00
Maksim Kita
90048ce75d Fixed code review issues 2022-10-24 10:22:38 +02:00
Maksim Kita
dbc0870eb5 Fixed tests 2022-10-24 10:22:38 +02:00
Maksim Kita
1410befbe1 Added AggregateFunctionsArithmeticOperationsPass 2022-10-24 10:22:38 +02:00
Maksim Kita
144b33c75d Fixed tests 2022-10-24 10:22:38 +02:00
Maksim Kita
852dd8c2bb Updated UnionNode documentation 2022-10-24 10:22:37 +02:00
Maksim Kita
8610feb06d Added UniqInjectiveFunctionsEliminationPass 2022-10-24 10:22:37 +02:00
Maksim Kita
fe3eda4c2b Added SumIfToCountIfPass 2022-10-24 10:22:37 +02:00
Maksim Kita
43ec5c830c Added FunctionToSubcolumnsPass 2022-10-24 10:22:37 +02:00
Maksim Kita
b50e2ce470 Added SETTINGS support 2022-10-24 10:22:37 +02:00
Maksim Kita
5a0298ea34 Fixed tests 2022-10-24 10:22:37 +02:00
Maksim Kita
da85af7e44 Added OrderByLimitByDuplicateEliminationPass 2022-10-24 10:22:37 +02:00
Maksim Kita
7851dfc324 Fixed tests 2022-10-24 10:22:37 +02:00
Maksim Kita
eba9607696 Analyzer move passes into separate folder 2022-10-24 10:22:37 +02:00
Maksim Kita
3a22e37691 Fix normalization of UNION inside DESCRIBE query 2022-10-24 10:22:37 +02:00
Maksim Kita
77ea9a11cd Fixed code review issues 2022-10-24 10:22:21 +02:00
Maksim Kita
6ec5474466 Updated IQueryTreeNode interface with weak pointers array 2022-10-24 10:22:21 +02:00
Maksim Kita
2f282eeec9 Updated InDepthQueryTreeVisitor implementation 2022-10-24 10:22:21 +02:00
Maksim Kita
49a129008b Fixed code review issues 2022-10-24 10:22:21 +02:00
Maksim Kita
239f1855aa Updated projection names implementation 2022-10-24 10:22:21 +02:00
Maksim Kita
048e776c48 Fixed tests 2022-10-24 10:22:21 +02:00
Maksim Kita
400de59a37 Fixed style check 2022-10-24 10:22:21 +02:00
Maksim Kita
86896b76c5 Fix GROUP BY validation for subqueries 2022-10-24 10:22:21 +02:00
Maksim Kita
0892f485bb Fix lambda tests 2022-10-24 10:22:21 +02:00
Maksim Kita
f2d801be2c Added CustomizeFunctionsPass 2022-10-24 10:22:21 +02:00
Maksim Kita
b1471bdedf Added CountDistinctPass 2022-10-24 10:22:21 +02:00
Maksim Kita
2aff015d29 Added NormalizeCountVariantsPass 2022-10-24 10:22:21 +02:00
Maksim Kita
54e2b6d28a Added EXISTS support 2022-10-24 10:22:21 +02:00
Maksim Kita
f5ee7e0bee Added IfChainToMultiIfPass 2022-10-24 10:22:21 +02:00
Maksim Kita
7c96c0afbd Added OrderByTupleEliminationPass 2022-10-24 10:22:21 +02:00
Maksim Kita
11324aa4b4 Added IfConstantConditionPass 2022-10-24 10:22:21 +02:00
Maksim Kita
3d5b209861 Added support for dictGet, joinGet functions to handle identifier as first argument 2022-10-24 10:22:21 +02:00
Maksim Kita
7f26bcc275 Added unqualified matcher support for JOIN with USING 2022-10-24 10:22:21 +02:00
Maksim Kita
b7d0fd6bae Added validation for subqueries and table functions in JOINs 2022-10-24 10:22:21 +02:00
Maksim Kita
d62bd792ac Added positional arguments support 2022-10-24 10:22:21 +02:00
Maksim Kita
a0d9251f3a Added ASOF join support 2022-10-24 10:22:21 +02:00
Maksim Kita
c7d51ca83d Rename InterpolateColumnNode into InterpolateNode 2022-10-24 10:22:20 +02:00
Maksim Kita
2b2a70082e Rename SortColumnNode into SortNode 2022-10-24 10:22:20 +02:00
Maksim Kita
fe84e871f8 Fixed build 2022-10-24 10:22:20 +02:00
Maksim Kita
8cadb1b318 Added WINDOW functions support 2022-10-24 10:22:20 +02:00
Maksim Kita
85ac02c9db Planner improve action names 2022-10-24 10:22:20 +02:00
Maksim Kita
890d9678b9 Fixed tests 2022-10-24 10:22:20 +02:00
Maksim Kita
4f68305dbe Fixed tests 2022-10-24 10:22:20 +02:00
Maksim Kita
ca93ee7479 Fixed tests 2022-10-24 10:22:20 +02:00
Maksim Kita
1844673aa8 Updated 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
Maksim Kita
64c60718f8 Updated SORT COLUMN with fill 2022-10-24 10:22:20 +02:00
Maksim Kita
4110460bcd Added LIMIT BY support 2022-10-24 10:22:20 +02:00
Maksim Kita
81e4c67f17 Added INTERPOLATE support 2022-10-24 10:22:20 +02:00
Maksim Kita
504cb2b38f Added GROUPING function support 2022-10-24 10:22:20 +02:00
Maksim Kita
a5ce4d7823 Added GROUPING SETS support 2022-10-24 10:22:20 +02:00
Maksim Kita
63e48bd869 Added GROUP BY CUBE, ROLLUP, TOTALS support 2022-10-24 10:22:20 +02:00
Maksim Kita
80b77f4ccc Added HAVING support 2022-10-24 10:22:20 +02:00
Maksim Kita
c087eff470 Perform GROUP BY and aggregates validation during analysis stage 2022-10-24 10:22:20 +02:00
Maksim Kita
ea44b4be5e Added subquery_depth support 2022-10-24 10:22:20 +02:00
Maksim Kita
2b571004f3 Added support for projection names 2022-10-24 10:22:19 +02:00
Maksim Kita
efc2433347 Added IN function Set table support 2022-10-24 10:22:19 +02:00
Maksim Kita
1cbf96d165 Added LIMIT, OFFSET support 2022-10-24 10:22:19 +02:00
Maksim Kita
6aa166f366 Added ORDER BY support 2022-10-24 10:22:19 +02:00
Maksim Kita
03864790ad Added DISTINCT support 2022-10-24 10:22:19 +02:00
Maksim Kita
5c6d175028 Added GROUP BY support 2022-10-24 10:22:19 +02:00
Maksim Kita
2995fb7944 Added support for building sets for IN function 2022-10-24 10:22:19 +02:00
Maksim Kita
44ada63a97 Added Planner 2022-10-24 10:22:19 +02:00
Maksim Kita
85193ede42 Added UNION support 2022-10-24 10:22:19 +02:00
Maksim Kita
0da0019634 Added ARRAY JOIN support 2022-10-24 10:22:19 +02:00
Maksim Kita
89e5b09e7f Updated JOIN tests 2022-10-24 10:22:19 +02:00
Maksim Kita
b32092f24a JOIN support join_use_nulls, USING 2022-10-24 10:22:19 +02:00
Maksim Kita
40cb904a3d Added support for JOIN, ARRAY JOIN 2022-10-24 10:22:19 +02:00
Maksim Kita
1717d16fa4 Improved lambda matcher support 2022-10-24 10:22:19 +02:00
Maksim Kita
062e17052f Added support for IN function 2022-10-24 10:22:19 +02:00
Maksim Kita
a9e1f74696 Added support for grouping function 2022-10-24 10:22:19 +02:00
Maksim Kita
635bd44413 Added support for table functions 2022-10-24 10:22:18 +02:00
Maksim Kita
569fb36097 Added support for table ALIAS columns 2022-10-24 10:22:18 +02:00
Maksim Kita
603c4febc3 Update explain query tree representation 2022-10-24 10:22:18 +02:00
Maksim Kita
dd28b58864 Added support for subqueries 2022-10-24 10:22:18 +02:00
Maksim Kita
6a5276e45e Updated tests 2022-10-24 10:22:18 +02:00
Maksim Kita
2d61c45f94 Added support for multiple expressions with same alias 2022-10-24 10:22:18 +02:00
Maksim Kita
d835f70fdc Added support for STRICT column transformers 2022-10-24 10:22:18 +02:00
Maksim Kita
9d4c508b39 Added lambda tests 2022-10-24 10:22:18 +02:00
Maksim Kita
75885ce2e1 Added Analyzer 2022-10-24 10:22:18 +02:00