Commit Graph

1339 Commits

Author SHA1 Message Date
Nikolai Kochetov
a21377cf51
Update src/Analyzer/Passes/QueryAnalysisPass.cpp
Co-authored-by: Dmitry Novik <n0vik@clickhouse.com>
2024-05-23 11:51:34 +02:00
Robert Schulze
f584807359
Merge remote-tracking branch 'rschu1ze/master' into redundant-inline 2024-05-22 21:05:27 +00:00
Alexey Milovidov
5a4633aa0e
Merge pull request #63962 from ClickHouse/analyzer-columns-list-fix
Analyzer: Fix COLUMNS resolve
2024-05-22 22:44:28 +02:00
Nikolai Kochetov
51afec4910 Fixing test. 2024-05-21 17:59:26 +00:00
Nikolai Kochetov
2bf5f0e0fd Fix style. 2024-05-21 16:13:29 +00:00
Dmitry Novik
d7ff8f6bc7 Merge remote-tracking branch 'origin/master' into analyzer-columns-list-fix 2024-05-21 16:57:22 +02:00
Nikolai Kochetov
23eaa0de40 Fix style. 2024-05-21 14:28:19 +00:00
Nikolai Kochetov
372acbd3fc Refactor aliases a bit. 2024-05-21 14:15:14 +00:00
Nikolai Kochetov
d1127bf119 Fix final=1 for distributed over non-mt table. 2024-05-21 08:54:11 +00:00
Zhiguo Zhou
844001779d Handle Nullable conversions in LowCardinality
For `k::LowCardinality(UInt8)`, the resolution of `k IN (1, NULL)`
results in type LowCardinality(UInt8). This commit converts the
return type to LowCardinality(Nullable(UInt8)).
2024-05-21 09:48:03 +08:00
Zhiguo Zhou
57ebb726e9 Analyzer: Optimize resolution of in(LowCardinality, ConstantSet)
When the FunctionIn applies to a LowCardinality and a constant
set, its return type is expected to be resolved as LowCardinality
also so that its argument of LowCardinality column would not be
converted to a full one and much computation cost for iterating
the rows in DB::Set::executeImplCase could be saved during the
execution phase.

This condition is fulfilled when FunctionNode::getArgumentColumns
returns a LowCardinality column for FunctionIn's 1st argument,and
a const column for the other. However, it's actually unfulfilled
as a null column is returned for the 2nd argument instead in the
Analyzer.

This commit revised FunctionNode::getArgumentColumns to return a
ColumnConst(ColumnSet) in such cases in order to turn on the opti-
mization of LowCardinality. A significant performance gain of 1.39x
is observed in query 3.3 of Star Schema Benchmark on the Intel ICX
server with 160 vcpus.
2024-05-21 09:48:03 +08:00
Robert Schulze
113bb00005
Fix clang-tidy "-readability-redundant-inline-specifier" 2024-05-19 10:23:58 +00:00
vdimir
e5ad196317
Merge pull request #62346 from ClickHouse/vdimir/analyzer_comapre_columns
Analyzer: Fix validateAggregates for tables with different aliases
2024-05-17 20:00:04 +00:00
Nikolai Kochetov
83a7e136e8 Merge branch 'master' into experiment-do-not-add-identifiers-to-expr-map 2024-05-17 10:07:10 +00:00
vdimir
aeca94105b
Merge branch 'master' into vdimir/analyzer_comapre_columns 2024-05-17 11:32:17 +02:00
Alexey Milovidov
26501178e6 Fix analyzer 2024-05-17 10:23:32 +02:00
Alexey Milovidov
f9fa5ba32f
Merge pull request #63930 from ClickHouse/fix-analyzer-mv
Fix analyzer: there's turtles all the way down...
2024-05-17 03:46:02 +00:00
Nikolai Kochetov
d314568b93
Merge pull request #63791 from ClickHouse/fix-duplicating-sucling-alias
Fix a query with duplicating cycling alias.
2024-05-16 18:21:25 +00:00
Nikolai Kochetov
b82eeeee88 Check what would be broken if do not add all the identifiers to functions map. 2024-05-16 17:43:59 +00:00
Dmitry Novik
d5b6903393 Cleanup and add test 2024-05-16 18:45:07 +02:00
Dmitry Novik
e4eaf256b1 Analyzer: Fix COLUMNS resolve 2024-05-16 18:45:07 +02:00
Yakov Olkhovskiy
bdfabc1d40 better comment 2024-05-16 15:44:19 +00:00
Nikolai Kochetov
5debc4af38 Fixing style. 2024-05-16 11:07:13 +00:00
Nikolai Kochetov
17346ad394 Cleanup. 2024-05-16 10:41:19 +00:00
Yakov Olkhovskiy
df90cb79b8 process nested subqueries 2024-05-16 06:48:24 +00:00
Nikolai Kochetov
c93f363be8 Another attempt. 2024-05-15 13:56:56 +00:00
Michael Kolupaev
ab636fd7b4
Merge pull request #63734 from ClickHouse/neg
Fix insignificant UBSAN error in QueryAnalyzer::replaceNodesWithPositionalArguments()
2024-05-14 19:41:30 +00:00
Nikolai Kochetov
1601115ff0
Merge pull request #63744 from ClickHouse/fix-resolve-matcher-in-array-join-lambda
Fix a bug in resolving matcher inside lambda inside ARRAY JOIN
2024-05-14 17:57:13 +00:00
Nikolai Kochetov
6a6688169a
Merge branch 'master' into fix-duplicating-sucling-alias 2024-05-14 19:56:03 +02:00
Nikolai Kochetov
b27c529548 Fix a query with duplicating cycling alias. 2024-05-14 17:51:21 +00:00
Anton Popov
0a1daa00e0 fix functions with if 2024-05-14 14:40:38 +00:00
Dmitry Novik
7de852fccc
Merge pull request #63694 from ClickHouse/analyzer-small-fix
Analyzer: Forbid WINDOW redefinition
2024-05-14 12:43:43 +00:00
Nikolai Kochetov
7a7002529b Fix a bug in resolving matcher inside lambda inside ARRAY JOIN 2024-05-14 09:54:22 +00:00
vdimir
6f74bebb48
Merge pull request #63405 from ClickHouse/vdimir/group_by_use_nulls_fixes
Small fixes for group_by_use_nulls
2024-05-14 08:45:20 +00:00
Michael Kolupaev
710ceae903 Fix insignificant ubsan error in QueryAnalyzer::replaceNodesWithPositionalArguments() 2024-05-14 08:37:27 +00:00
Nikolai Kochetov
ebd0865fb0
Merge pull request #62922 from ClickHouse/more-cases-for-group-by-use-nulls
group_by_use_nulls strikes back
2024-05-13 18:00:33 +00:00
Anton Popov
d7de2ae0c9 remove optimization for old analyzer 2024-05-13 16:54:43 +00:00
Anton Popov
12ea2fc4bf Merge remote-tracking branch 'upstream/master' into HEAD 2024-05-13 16:24:34 +00:00
Dmitry Novik
2458defd01 Analyzer: Forbid WINDOW redefinition 2024-05-13 15:16:35 +02:00
Nikolai Kochetov
bb9652998b Another attemtp. 2024-05-13 12:26:10 +00:00
Alexey Milovidov
23cf6d0d8b Useless changes 2024-05-11 22:51:57 +02:00
Alexey Milovidov
eff0d7cb8b Merge branch 'master' of github.com:ClickHouse/ClickHouse into clang-18-ci 2024-05-11 14:15:38 +02:00
Michael Kolupaev
c1ea1726b4 Remove weird special case in if() return type inference, to match multiIf() 2024-05-10 22:37:35 +00:00
Alexey Milovidov
426a51b624 Useless changes 2024-05-10 04:53:29 +02:00
Alexey Milovidov
1d69518c4d Useless changes 2024-05-09 02:07:04 +02:00
Alexey Milovidov
95f12ef274 Useless changes 2024-05-09 01:08:33 +02:00
Nikolai Kochetov
b2828fc852 Search nullable GB keys from all the parent scopes. 2024-05-08 16:06:38 +00:00
Nikolai Kochetov
880314fa08 Another case. 2024-05-08 11:49:15 +00:00
Nikolai Kochetov
134b468d91 Another case. 2024-05-07 18:14:32 +00:00
vdimir
c67a43e3a7
better 2024-05-07 14:37:39 +00:00
vdimir
fd75522ea8
analyzer: fix select * with grouping sets 2024-05-07 14:20:49 +00:00
Raúl Marín
d5b8d9b7b2
Merge pull request #63162 from kitaisreal/query-analysis-pass-improve-qualify-validation
QueryAnalysisPass improve QUALIFY validation
2024-05-07 12:18:36 +00:00
Nikolai Kochetov
b821f17f69 Merge branch 'master' into more-cases-for-group-by-use-nulls 2024-05-06 17:03:13 +00:00
vdimir
1016d2e0d3
Merge pull request #62995 from ClickHouse/vdimir/array_join_alias_resolve_fix
Analyzer: prefer column name to alias from array join
2024-05-06 10:33:10 +00:00
vdimir
2c22593205
fix style 2024-05-03 18:34:14 +02:00
vdimir
a8c931ac98
fix typo 2024-05-03 15:16:40 +02:00
Raúl Marín
e4c99ed1d5 Merge remote-tracking branch 'blessed/master' into untuple_crash 2024-05-02 15:24:57 +02:00
vdimir
b057b54d24
ValidateGroupByColumnsVisitor::areColumnSourcesEqual 2024-05-02 11:24:33 +00:00
Maksim Kita
a50c41c617 QueryAnalysisPass improve QUALIFY validation 2024-05-02 13:36:23 +03:00
Raúl Marín
89fe970cd2
Merge pull request #62929 from Algunenano/optimize_rewrite_sum_if_to_count_if
Enable optimize_rewrite_sum_if_to_count_if by default
2024-04-30 12:07:24 +00:00
Raúl Marín
10fb28c6ea Fix crash with untuple and unresolved lambda 2024-04-30 13:36:20 +02:00
vdimir
5f75e9847a
revert 2024-04-30 10:52:59 +00:00
Raúl Marín
97774571f1 Merge remote-tracking branch 'blessed/master' into 03132_rewrite_aggregate_function_with_if_implicit_cast 2024-04-29 14:54:23 +02:00
vdimir
d076479097
t 2024-04-29 10:14:41 +00:00
vdimir
3a8ca9a68b
bind only full identifier 2024-04-29 10:01:08 +00:00
Raúl Marín
8df67eb7ed
Merge branch 'master' into optimize_rewrite_sum_if_to_count_if 2024-04-29 11:51:09 +02:00
Maksim Kita
f5cfe597f2 Fixed tests 2024-04-28 12:52:17 +03:00
Maksim Kita
bd1189de70 Fixed tests 2024-04-28 12:52:17 +03:00
Maksim Kita
85dc0cf20a Fixed tests 2024-04-28 12:52:17 +03:00
Maksim Kita
06d2c18f26 Analyzer support recursive CTEs 2024-04-28 12:52:17 +03:00
Raúl Marín
09ff42de0f Remove optimize_monotonous_functions_in_order_by 2024-04-25 21:46:15 +02:00
Raúl Marín
052713db3b Fix order and reference files 2024-04-25 21:14:40 +02:00
Raúl Marín
3941d69c6b Fix optimize_rewrite_aggregate_function_with_if implicit cast 2024-04-25 20:25:40 +02:00
vdimir
64dba76afe
Analyzer: prefer column name to alias from array join 2024-04-25 16:54:49 +00:00
Nikolai Kochetov
34dd0a229f Another one case of aliases with group_by_use_null 2024-04-25 15:46:29 +00:00
Nikolai Kochetov
e1da9114fb
Merge pull request #62811 from canhld94/fix_cte_final
Fix FINAL modifier is not respected in CTE with analyzer
2024-04-25 14:37:50 +00:00
vdimir
02239dd9f9
Compare aliases for TableNode 2024-04-25 11:21:22 +00:00
Raúl Marín
70135abe70 Disable optimize_rewrite_aggregate_function_with_if for sum(nullable) 2024-04-24 15:51:11 +02:00
Maksim Kita
0e28d20791 Fixed code review issues 2024-04-22 14:37:04 +03:00
Maksim Kita
f1660fa8bb Analyzer support QUALIFY clause 2024-04-22 12:12:02 +03:00
Duc Canh Le
de5b0dab32 Fix FINAL modifier is not respected in CTE with analyzer
Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
2024-04-20 02:18:19 +00:00
Dmitry Novik
69cc3c9e8e
Analyzer: Fix exception message 2024-04-18 13:02:55 +02:00
Dmitry Novik
951fa6720f Merge remote-tracking branch 'origin/master' into analyzer-fix-param-view-alias 2024-04-17 12:41:06 +02:00
Dmitry Novik
14a49f804b
Merge pull request #62558 from ClickHouse/analyzer-fix-string-enum-optimization
Try to fix if_transform_strings_to_enum performance test
2024-04-16 10:57:27 +00:00
Nikolai Kochetov
6fa57b9d7d
Merge pull request #62567 from ClickHouse/fix-scalars-in-limit-offset
Fix scalar subquery in LIMIT
2024-04-12 15:03:45 +00:00
vdimir
602e17f3e6
Merge pull request #62142 from ClibMouse/fixes_in_with_pk_ft_scan
Fix primary index not being used when a redundant equals exists
2024-04-12 09:27:19 +00:00
Joshua Hildred
8f4f3aaf14 Small code cleanup 2024-04-11 12:56:50 -07:00
Nikolai Kochetov
61d4d9a46e
Update QueryAnalysisPass.cpp 2024-04-11 19:39:44 +02:00
Nikolai Kochetov
3e16309e99 Allow constant folding throught __getScalar 2024-04-11 15:25:52 +00:00
Joshua Hildred
dd49b09902 Address review comments 2024-04-11 06:58:35 -07:00
Dmitry Novik
5985a0d10b
Try to fix if_transform_strings_to_enum perf test 2024-04-11 15:40:53 +02:00
vdimir
fe4373fa53
Merge pull request #62387 from ClickHouse/vdimir/join_on_expression_optimizer_fix
Use function isNotDistinctFrom only in join key
2024-04-11 10:34:28 +00:00
Joshua Hildred
13774d897b Add additional tests for queries with toLowCardinality and toNullable 2024-04-10 19:09:03 -07:00
Joshua Hildred
dfa7a9704a Fix an isssue with constants being wrapped in nullables 2024-04-10 12:16:06 -07:00
Nikolai Kochetov
e87b5daa2d
Merge pull request #62236 from ClickHouse/group-by-use-nulls-another-fix
Fix another logical error in group_by_use_nulls.
2024-04-10 14:37:15 +00:00
flynn
eeeb8f3473 Merge branch 'master' of github.com:ClickHouse/ClickHouse into analyzer-position-arguments 2024-04-10 11:12:34 +00:00
vdimir
ecebeefabe
Merge branch 'master' into vdimir/join_on_expression_optimizer_fix 2024-04-10 12:18:21 +02:00
Dmitry Novik
443d3175af
Merge pull request #62433 from kitaisreal/optimize-group-by-injective-functions-pass-remove-unused-constant
OptimizeGroupByInjectiveFunctionsPass remove unused constant
2024-04-10 10:10:37 +00:00
Nikolai Kochetov
25d64d490a
Merge pull request #62409 from ClickHouse/fix-global-in-table-with-analyzer
Fix GLOBAL IN table queries with analyzer.
2024-04-10 07:04:21 +00:00
Joshua Hildred
626b7b1253 Fix style 2024-04-09 14:12:13 -07:00
Joshua Hildred
9d4f1d890e Add an optimization that removes redundant equality
checks on boolean functions. This fixes a bug in
which the primary index is not used for queries like
SELECT * FROM <table> WHERE <pk> in (<n>) = 1
2024-04-09 12:08:31 -07:00
flynn
6feb274467 Fix 2024-04-09 15:18:57 +00:00
Nikolai Kochetov
814de46e13 Another one case. 2024-04-09 15:08:03 +00:00
Dmitry Novik
728ed2eee3
Simplify the change 2024-04-09 16:44:38 +02:00
Nikolai Kochetov
3900b95faf Another one case with aliases. 2024-04-09 13:01:38 +00:00
Nikolai Kochetov
bba66eb05a Review fixes. 2024-04-09 12:30:07 +00:00
Robert Schulze
4035334634
Merge remote-tracking branch 'rschu1ze/master' into static-instance2 2024-04-09 11:45:27 +00:00
Maksim Kita
0543fc3263 OptimizeGroupByInjectiveFunctionsPass remove unused constant 2024-04-09 13:17:42 +03:00
Nikolai Kochetov
e5282bf39f I ♥ group_by_use_nulls. 2024-04-08 16:39:55 +00:00
flynn
f9402f3584 Fix 2024-04-08 15:15:45 +00:00
Nikolai Kochetov
3421135ff1
Merge pull request #62281 from ClickHouse/analyzer-fix-resolve-from-parent-scopes
Analyzer: Fix name resolution from parent scopes
2024-04-08 15:06:57 +02:00
vdimir
35be12c184
Merge pull request #62325 from ClickHouse/vdimir/fix_optimize_uniq_to_count
Fix optimize_uniq_to_count when only prefix of key is matched
2024-04-08 14:11:39 +02:00
vdimir
f3e1132136
Merge pull request #62273 from ClickHouse/vdimir/analyzer_limit_constant_folding
Analyzer: limit maximal size of column in constant folding
2024-04-08 12:49:48 +02:00
vdimir
b8f6217168
Use function isNotDistinctFrom only in join key 2024-04-08 09:57:33 +00:00
Robert Schulze
97281203b8
Don't access static members through instance, pt. II
clang-tidy rightfully complains
(-readability-static-accessed-through-instance) that static member
functions are accessed through non-static members
2024-04-07 11:09:35 +00:00
flynn
39df144107 Merge branch 'master' of github.com:ClickHouse/ClickHouse into analyzer-position-arguments 2024-04-07 04:22:52 +00:00
flynn
b6dd55827f Fix analyzer with positional arguments in distributed query 2024-04-06 14:23:45 +00:00
Nikolai Kochetov
d1c42668bd Another attempt. 2024-04-05 16:22:57 +00:00
Raúl Marín
7df11b1852
Merge pull request #62264 from Algunenano/nested_includes_Ñ
Remove more nested includes
2024-04-05 17:00:28 +02:00
Nikolai Kochetov
07893fab63 Revert "Fixing 02535_analyzer_group_by_use_nulls"
This reverts commit 3b6ea659df.
2024-04-05 12:01:39 +00:00
vdimir
ce1f514417
Fix optimize_uniq_to_count when only prefix of key is matched 2024-04-05 10:39:05 +00:00
Robert Schulze
7ce2a47ba5
Merge pull request #62265 from rschu1ze/static-instance
Don't access static members through instance
2024-04-04 14:36:03 +02:00
Dmitry Novik
33aee0f599 Analyzer: Fix name resolution from parent scopes 2024-04-04 13:00:51 +02:00
Raúl Marín
276246ee97 Introduce IAggregateFunction_fwd to reduce header dependencies 2024-04-04 12:29:54 +02:00
Dmitry Novik
7aab28bcc8 Analyzer: Fix alias to parametrized view resolution 2024-04-04 11:53:41 +02:00
vdimir
e516bef844
Annalyzer: limit maximal size of column in constant folding 2024-04-04 09:52:58 +00:00
Dmitry Novik
d86eae3dd9
Merge pull request #62186 from ClickHouse/analyzer-query-param
Analyzer: Fix query parameter resolution
2024-04-04 11:26:12 +02:00
vdimir
b4ae81ee00
Merge pull request #62253 from ClickHouse/vdimir/analyzer_legacy_lambda_syntax
Fix lambda(tuple(x), x + 1) syntax in analyzer
2024-04-04 11:21:03 +02:00
Robert Schulze
de2a0be025
Don't access static members through instance
- clang-tidy rightfully complains (-readability-static-accessed-through-instance)
- not going to enable the warning for now to avoid breaking the build
2024-04-03 18:50:33 +00:00
Nikolai Kochetov
04445b30ef Fix another logical error in group_by_use_nulls. 2024-04-03 11:50:14 +00:00
vdimir
71450c909a
Fix lambda(tuple(x), x + 1) syntax in analyzer 2024-04-03 10:39:43 +00:00
Dmitry Novik
40b9f39c00 Analyzer: Fix query parameters 2024-04-02 17:47:00 +02:00
Raúl Marín
c35a436435 Remove nested dependency on DateLutImpl 2024-04-02 14:45:48 +02:00
Raúl Marín
b2e764f633 Revert "Merge pull request #61564 from liuneng1994/optimize_in_single_value"
This reverts commit 20a45b4073, reversing
changes made to a642f4d3ec.
2024-04-01 13:51:56 +02:00
Nikolai Kochetov
697e72c13d
Merge pull request #61933 from ClickHouse/gb-use-null-analyzer-crashes
Fix some crashes with analyzer and group_by_use_nulls.
2024-03-29 19:29:55 +01:00
Nikolai Kochetov
c59961e980
Merge pull request #62046 from ClickHouse/fix-optimize_arithmetic_operations_in_aggregate_functions-function-type
Fix optimize_arithmetic_operations_in_aggregate_functions
2024-03-29 19:28:23 +01:00
Nikolai Kochetov
dc45666b4f
Merge pull request #62059 from ClickHouse/fix-type-after-IfChainToMultiIfPass
Ignore IfChainToMultiIfPass if returned type changed.
2024-03-29 19:26:55 +01:00
Nikolai Kochetov
45cac7e5c2
Merge pull request #62066 from ClickHouse/fix-convert-in-to-equals-type
Fix type for ConvertInToEqualPass
2024-03-29 19:26:28 +01:00
Nikolai Kochetov
fd01a12276 Fixing another case with grouping set 2024-03-28 18:26:15 +00:00
Nikolai Kochetov
8758d7f3a8 Fixing test. 2024-03-28 18:19:40 +00:00
Nikolai Kochetov
54d7a6041e Fix type for ConvertInToEqualPass 2024-03-28 17:35:38 +00:00
Nikolai Kochetov
9c411a2503 Merge branch 'master' into gb-use-null-analyzer-crashes 2024-03-28 16:44:08 +00:00
Nikolai Kochetov
482400cd28
Merge pull request #61998 from ClickHouse/fix-scalars-create-as-select
Fix scalars create as select
2024-03-28 17:35:50 +01:00
Nikolai Kochetov
c834a11b65 Ignore IfChainToMultiIfPass if returned type changed. 2024-03-28 16:32:12 +00:00
Nikolai Kochetov
fb235c0840 Fix optimize_arithmetic_operations_in_aggregate_functions optimization which could change result type. 2024-03-28 14:44:45 +00:00
Kruglov Pavel
facde7541f
Merge pull request #61567 from Avogar/fix-analyzer-group-by-use-nulls
Fix logical error in group_by_use_nulls + grouping set + analyzer + materialize/constant
2024-03-28 14:38:11 +01:00
Nikolai Kochetov
ce2e5a7d13 Fixing tests. 2024-03-27 19:25:07 +00:00
Nikolai Kochetov
3ce122ef20 Fixing tests. 2024-03-27 19:23:16 +00:00
Nikolai Kochetov
920ba121fe Fix scalars for CREATE AS SELECT for analyzer. 2024-03-27 19:17:41 +00:00
Nikolai Kochetov
dc52b81f5d Merge branch 'master' into gb-use-null-analyzer-crashes 2024-03-27 18:37:27 +00:00
Nikolai Kochetov
6127b0b899 Revert "Fix broken only_analyze in QueryAnalysisPass"
This reverts commit c88cb6be9d.
2024-03-27 17:43:27 +00:00
Nikolai Kochetov
6a7d48b932 Fix aliases. 2024-03-27 17:26:12 +00:00
Nikolai Kochetov
3b6ea659df Fixing 02535_analyzer_group_by_use_nulls 2024-03-26 19:10:34 +00:00
Dmitry Novik
65121b712e Merge remote-tracking branch 'origin/master' into enable-analyzer 2024-03-26 19:02:30 +01:00
Dmitry Novik
c88cb6be9d Fix broken only_analyze in QueryAnalysisPass 2024-03-26 17:46:38 +01:00
Nikolai Kochetov
2dee605d52 Merge branch 'master' into gb-use-null-analyzer-crashes 2024-03-26 13:05:03 +01:00
Nikolai Kochetov
277df60dc4 Fix some crashes with analyzer and group_by_use_nulls. 2024-03-26 12:01:17 +00:00
Nikolai Kochetov
f2e9ea2417
Merge pull request #61875 from ClickHouse/try-to-fix-02901_parallel_replicas_rollup-with-analyzer
Try to fix 02901_parallel_replicas_rollup with analyzer.
2024-03-26 11:12:29 +01:00
vdimir
802d6a2dac
Merge pull request #59007 from ClickHouse/vdimir/using_alias_followup
Analyzer: fixes for JOIN columns resolution
2024-03-26 10:36:50 +01:00
Nikolai Kochetov
3752b13753 See what would happen if constant fold _CAST for scalar subqueries properly. 2024-03-25 15:36:01 +00:00
Anton Popov
ef759ecdc2 Merge remote-tracking branch 'upstream/master' into HEAD 2024-03-25 14:56:50 +00:00
avogar
192d59e1ff Disable optimize_group_by_function_keys when group_by_use_nulls=1 2024-03-25 14:00:40 +00:00
Yarik Briukhovetskyi
20a45b4073
Merge pull request #61564 from liuneng1994/optimize_in_single_value
New analyzer pass to optimize in single value
2024-03-25 12:53:01 +01:00
Igor Nikonov
54c3bde6a7 Fix: DISTINCT in subquery with analyzer
RemoveUnusedProjectionColumnsPass incorrectly removed columns,
unused in outer query, from subqueries with DISTINCT
2024-03-24 21:20:51 +00:00
Dmitry Novik
64301191b1 Merge remote-tracking branch 'origin/master' into enable-analyzer 2024-03-24 21:07:26 +00:00
vdimir
0e7bedc671
Fix resolvedIdenfiersFromJoinAreEquals function visibility 2024-03-24 17:30:51 +00:00
Nikolai Kochetov
e6242891be Merge branch 'master' into fix-analyzer-group-by-use-nulls 2024-03-24 11:41:14 +00:00
vdimir
adbc9c66e9
fix infinite loop in ReplaceColumnsVisitor #ci_set_analyzer 2024-03-23 18:34:20 +00:00
vdimir
44f1f62904
fix ReplaceColumnsVisitor #ci_set_analyzer 2024-03-23 15:20:01 +00:00
vdimir
ee7d1cf7d9
another fix prewhere on join using column that changed type to supertype
tag: #ci_set_analyzer
2024-03-23 11:05:20 +00:00
vdimir
a1036075e0
Merge branch 'master' into vdimir/using_alias_followup 2024-03-22 20:16:26 +00:00
vdimir
5b7a3c276b
fix prewhere on join using column that changed type to supertype 2024-03-22 20:15:08 +00:00
Nikolai Kochetov
dd87e5793f Merge branch 'master' into fix-analyzer-group-by-use-nulls 2024-03-22 18:24:02 +00:00
Nikolai Kochetov
897f58e5dd Merge branch 'master' into fix-00223_shard_distributed_aggregation_memory_efficient-analyzer 2024-03-22 16:40:37 +01:00
Dmitry Novik
d43a1a1984 Merge remote-tracking branch 'origin/master' into enable-analyzer 2024-03-22 14:15:57 +01:00
Nikolai Kochetov
ec134d2642 Another attempt. 2024-03-22 10:51:01 +00:00
liuneng
6a550bc754 add test case and support constant expression 2024-03-22 11:23:59 +08:00
Nikolai Kochetov
89d80a4d65 Redo fix. 2024-03-21 18:16:31 +00:00
Alexey Milovidov
8670f1dc91
Merge pull request #61543 from ClickHouse/fix-regexp-recompilation-in-parser
Fix recompilation of regexps during backtracking in the parser
2024-03-21 21:15:17 +03:00
Anton Popov
fbd2273dd4 Merge remote-tracking branch 'upstream/master' into HEAD 2024-03-21 16:44:16 +00:00
Dmitry Novik
e4209218d4
Merge pull request #60497 from ClickHouse/analyzer-distr-json
Analyzer: Support different ObjectJSON on shards
2024-03-21 16:25:30 +01:00
vdimir
46ab53ef79
fix 2024-03-21 14:03:43 +00:00
Dmitry Novik
466cfe29b2 Fix tests with clickhouse-local #ci_set_analyzer 2024-03-21 15:01:08 +01:00
vdimir
15bf6d1d5f
Merge branch 'master' into vdimir/using_alias_followup 2024-03-21 10:39:18 +00:00
vdimir
e002e42805
remove old nodes from node_to_projection_name when node become nullable 2024-03-21 10:38:50 +00:00
vdimir
33169e72df
Fix AMBIGUOUS_IDENTIFIER with join_use_nulls
https://github.com/ClickHouse/ClickHouse/issues/59067#issuecomment-1912500556
2024-03-21 10:37:52 +00:00
vdimir
42d59a8fd1
Update after refactoring ALIAS columns computation 2024-03-21 09:16:58 +00:00
vdimir
add1613a50
Merge pull request #61631 from ClickHouse/vdimir/analyzer_join_using_unresolved_error_msg
Verbose error message about analyzer_compatibility_join_using_top_level_identifier
2024-03-21 10:12:25 +01:00
Antonio Andelic
5f067c16be
Merge pull request #61656 from ClickHouse/another-fix-for-sum-if-to-count-if-pass
Another fix for `SumIfToCountIfPass`
2024-03-21 08:49:19 +01:00
liuneng
ada4384deb fix ut failed 2024-03-21 10:38:51 +08:00
Alexey Milovidov
4d6709579b Fix error 2024-03-21 02:28:14 +01:00
Alexey Milovidov
99ed82d561 Merge branch 'master' into fix-regexp-recompilation-in-parser 2024-03-21 02:21:09 +01:00
avogar
355909eb3a Clean up 2024-03-20 14:54:07 +00:00
avogar
01c0af07aa Disable optimize_injective_functions_in_group_by when group_by_use_nulls=1 2024-03-20 14:49:43 +00:00
Antonio Andelic
a343406da4 Another fix for SumIfToCountIfPass 2024-03-20 15:33:45 +01:00
Yarik Briukhovetskyi
5ed895dbf5
remove whitespace before coma 2024-03-20 14:12:33 +01:00
Raúl Marín
c98634ad8c Merge remote-tracking branch 'blessed/master' into nested_includes 2024-03-20 14:08:10 +01:00
Nikolai Kochetov
624b3a6dbe Fixing 00223_shard_distributed_aggregation_memory_efficient with analyzer. 2024-03-20 12:08:46 +00:00
vdimir
25bae3e0a5
Verbose error medssage about analyzer_compatibility_join_using_top_level_identifier 2024-03-20 10:58:43 +00:00
liuneng
d2d5f3b323 add not in 2024-03-20 17:46:07 +08:00
liuneng
45bbef689a fix error for in Null 2024-03-20 12:29:48 +08:00
liuneng
862abf2f6e remove config 2024-03-20 10:40:22 +08:00
liuneng
a29d4f5db2 fix bug 2024-03-20 10:24:57 +08:00
Alexey Milovidov
cfab620f49 Fix bad code 2024-03-20 01:11:53 +01:00
Alexey Milovidov
82b18670a2 Fix error 2024-03-19 22:31:26 +01:00
avogar
bd7c13c1b6 Merge branch 'master' of github.com:ClickHouse/ClickHouse into fix-analyzer-group-by-use-nulls 2024-03-19 19:29:49 +00:00
Alexey Milovidov
a996155e83 Merge branch 'master' of github.com:ClickHouse/ClickHouse into fix-regexp-recompilation-in-parser 2024-03-19 19:56:11 +01:00
Dmitry Novik
221b74c77f Fix #ci_set_analyzer 2024-03-19 19:44:15 +01:00
Raúl Marín
de855ca917 Reduce header dependencies 2024-03-19 17:04:29 +01:00
Dmitry Novik
a8885e361e
Merge branch 'master' into vdimir/analyzer/join_using_parent_scope 2024-03-19 15:51:53 +01:00
avogar
462445c2c2 Fix logical error in group_by_use_nulls + analyzer + materialize/constant 2024-03-19 10:41:23 +00:00
liuneng
761c612295 fix style 2024-03-19 18:29:07 +08:00
liuneng
532d72a7d8 add test case 2024-03-19 17:30:16 +08:00
liuneng
a742b235a4 add pass covert in single value to equal 2024-03-19 17:12:13 +08:00
Alexey Milovidov
613c31038a Fix recompilation of regexps during backtracking in the parser 2024-03-18 18:40:47 +01:00
vdimir
dbed5d1902
Add analyzer_compatibility_join_using_top_level_identifier 2024-03-18 11:11:21 +00:00
vdimir
fbad9b799c
fix PREWHERE with join_use_nulls 2024-03-18 11:11:06 +00:00
vdimir
e27e6fb2f5
Analyzer: support join using column from select list 2024-03-18 11:11:00 +00:00
Robert Schulze
c17536c3b3
Enable clang-tidy in headers 2024-03-18 08:00:09 +00:00
Antonio Andelic
060f79862d Fix 2024-03-15 10:49:36 +00:00
Antonio Andelic
b000849529 Better 2024-03-14 18:21:21 +00:00
Anton Popov
7a0b8e27af Merge remote-tracking branch 'upstream/master' into HEAD 2024-03-14 16:58:14 +00:00
Antonio Andelic
22ca96cf8d Disable optimize_rewrite_sum_if_to_count_if if return is nullable 2024-03-14 16:05:01 +00:00
Nikolai Kochetov
6f31a77f70 Fix test 02174_cte_scalar_cache_mv 2024-03-08 15:33:45 +00:00
Nikolai Kochetov
00557a9c6c Merge branch 'master' into use-global-scalars-cache-analyzer 2024-03-08 12:30:04 +00:00
Dmitry Novik
526af77f4a
Merge pull request #60313 from ClickHouse/analyzer-refactor-constant-name
Analyzer: Refactor execution name for ConstantNode
2024-03-08 12:08:05 +01:00
Nikolai Kochetov
4c3fa4e864 Use global scalars cache in analyzer. 2024-03-08 09:43:57 +00:00
Anton Popov
f740afe71e Merge remote-tracking branch 'upstream/master' into HEAD 2024-03-07 18:36:42 +00:00
Nikolai Kochetov
97607f1031 Fix style 2024-03-07 17:06:45 +00:00
Nikolai Kochetov
2b8cf8b6e9 Merge branch 'master' into constant-folding-scalar-subqueries 2024-03-07 16:06:55 +00:00
Nikolai Kochetov
2db1876750 Fixing analyzer. 2024-03-07 15:42:45 +00:00
vdimir
de33af8e1a
Merge pull request #60875 from ZhiguoZh/20240305-analyzer-refactor
Refactor OptimizeDateOrDateTimeConverterWithPreimageVisitor
2024-03-07 15:58:31 +01:00
Dmitry Novik
23b33e5e32 Merge remote-tracking branch 'origin/master' into analyzer-refactor-constant-name 2024-03-07 14:18:44 +01:00
vdimir
21609a91e6
Merge pull request #60655 from ClickHouse/vdimir/analyzer/join_use_nulls_prewhere
Analyzer: Fix bug with join_use_nulls and PREWHERE
2024-03-07 13:28:00 +01:00
Dmitry Novik
71dc34074b
Merge pull request #60386 from ClickHouse/imp-analyzer-mask
Analyzer - improve hiding secret arguments.
2024-03-07 12:01:48 +01:00
Dmitry Novik
d92538ced2
Merge branch 'master' into analyzer-refactor-constant-name 2024-03-06 17:55:52 +01:00
vdimir
4dede601ef
fix 2024-03-06 12:10:26 +00:00
vdimir
d9f7ac8815
Analyzer: Fix bug with join_use_nulls and PREWHERE 2024-03-06 12:10:25 +00:00
Anton Popov
73d78e8ec2 Merge remote-tracking branch 'upstream/master' into HEAD 2024-03-05 16:18:44 +00:00
Dmitry Novik
55c028322d
Fix typo 2024-03-05 16:59:22 +01:00
Yakov Olkhovskiy
34f01c4a02 Merge branch 'master' into imp-analyzer-mask 2024-03-05 15:30:34 +00:00
Zhiguo Zhou
c4009a16f9 Refactor OptimizeDateOrDateTimeConverterWithPreimageVisitor
The generateOptimizedDateFilter function is refactored to enhance
the code readability. And this commit also fixes the duplicate
creations of ColumnNode.
2024-03-05 23:18:54 +08:00
Dmitry Novik
5524f5901f Cleanup code 2024-03-05 16:18:03 +01:00
Anton Popov
1da258bfda better functions to subcolumns optimization 2024-03-04 15:35:03 +00:00
Anton Popov
ba4d7c48af Merge remote-tracking branch 'upstream/master' into HEAD 2024-03-04 13:58:06 +00:00
Dmitry Novik
01829450fb Merge remote-tracking branch 'origin/master' into analyzer-refactor-constant-name 2024-03-04 14:12:15 +01:00
Yakov Olkhovskiy
aa42d5a88d separate FunctionSecretArgumentsFinder for AST and TreeNode to avoid binary bloat due to linkage dependencies 2024-03-01 20:58:22 +00:00
vdimir
47aa33408b
Resubmit "Analyzer: compute ALIAS columns right after reading"
This reverts commit 8141e1c3d1, reversing
changes made to fb099bbd62.
2024-03-01 14:53:02 +00:00
Alexander Tokmakov
2dedfd6cf9
Revert "Analyzer: compute ALIAS columns right after reading" 2024-02-29 14:22:07 +01:00
Dmitry Novik
814691bf78
Merge pull request #52230 from JackyWoo/optimize_aggregators_of_group_by_keys
New analyzer: add eliminate min/max/any/anyLast aggregators  pass
2024-02-29 11:46:26 +01:00