Azat Khuzhin
a813f5996e
Fix converting types for UNION queries (may produce LOGICAL_ERROR)
...
CI founds [1]:
2022.02.20 15:14:23.969247 [ 492 ] {} <Fatal> BaseDaemon: (version 22.3.1.1, build id: 6082C357CFA6FF99) (from thread 472) (query_id: a5187ff9-962a-4e7c-86f6-8d48850a47d6) (query: SELECT 0., round(avgWeighted(x, y)) FROM (SELECT toDate(toDate('214748364.8', '-922337203.6854775808', '-0.1', NULL) - NULL, 10.000100135803223, '-2147483647'), 255 AS x, -2147483647 AS y UNION ALL SELECT y, NULL AS x, 2147483646 AS y)) Received signal Aborted (6)
[1]: https://s3.amazonaws.com/clickhouse-test-reports/0/26d0e5438c86e52a145aaaf4cb523c399989a878/fuzzer_astfuzzerdebug,actions//report.html
The problem is that subqueries returns different headers:
- first query -- x, y
- second query -- y, x
v2: Make order of columns strict only for UNION
https://s3.amazonaws.com/clickhouse-test-reports/34775/9cc8c01a463d18c471853568b2f0af659a4e643f/stateless_tests__address__actions__[2/2].html
Fixes: 00597_push_down_predicate_long
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-05-25 20:31:47 +03:00
vdimir
9b24e0d260
Apply optimizeCountConstantAndSumOne before JOINs
2022-05-10 14:30:33 +00: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
Yakov Olkhovskiy
7dbe8bc2dc
major bugs fixed, tests added, docs updated
2022-04-07 01:21:24 -04:00
vdimir
1122db89db
Use float devision for avg after optimize_fuse_sum_count_avg
2022-03-28 11:26:42 +00:00
Anton Popov
fcdebea925
Merge remote-tracking branch 'upstream/master' into HEAD
2022-02-25 13:41:30 +03:00
mergify[bot]
dd947f964c
Merge branch 'master' into mv_cacheable_scalars
2022-02-07 10:07:26 +00:00
Anton Popov
78b9f15abb
Merge remote-tracking branch 'upstream/master' into HEAD
2022-01-30 03:24:37 +03:00
Raúl Marín
4b5ab80e3b
Better scalar cache handling
...
- Fixes global CTE scalar cache.
- Adds MVs back (views dependent on the source are cached locally and others globally
2022-01-26 17:36:45 +01:00
Anton Popov
e8ce091e68
Merge remote-tracking branch 'upstream/master' into HEAD
2022-01-21 20:11:18 +03:00
Azat Khuzhin
97acf190ed
Replace old _shard_num implementation with shardNum() function
...
_shard_num via constant identifier (from #7624 ) has too much issues,
take a look at #16947 for example.
shardNum() function (from #27020 ) should works better.
This changes the behaviour of _shard_num slightly, now it returns nested
shard number in case of nested distributed tables (Distributed over
Distributed), but this should be minor.
v2: Rewrite _shard_num to shardNum() in TreeRewriter
2022-01-10 21:21:24 +03:00
Maksim Kita
ebff389701
Merge pull request #32972 from kitaisreal/containers-iteration-fix-erase
...
Containers iteration fix erase
2021-12-20 16:47:19 +03:00
Nikolai Kochetov
2e62f086a1
Merge pull request #32751 from ClickHouse/fix-32668
...
Apply some more optimizations to NO_QUERY ast.
2021-12-20 15:47:25 +03:00
Maksim Kita
3feab5a975
Containers iteration fix erase
2021-12-20 13:42:31 +03:00
Nikolai Kochetov
93a33d52dc
Merge branch 'fix-32668' of github.com:yandex/ClickHouse into fix-32668
2021-12-17 20:37:29 +03:00
Nikolai Kochetov
c8a92c046f
Another try
2021-12-17 20:36:37 +03:00
Anton Popov
99ebabd822
Merge remote-tracking branch 'upstream/master' into HEAD
2021-12-17 19:02:29 +03:00
Nikolai Kochetov
20b88d9b4c
Always apply const if optimixation.
2021-12-17 15:31:30 +03:00
mergify[bot]
3a7179756f
Merge branch 'master' into fix-32668
2021-12-15 08:31:10 +00:00
Nikolai Kochetov
d394f0e753
Allpy some more optimizations to NO_QUERY ast.
2021-12-14 17:19:18 +03:00
dongyifeng
9df664e1c9
fix bug when remove unneeded columns in subquery ( #32289 )
2021-12-07 11:09:39 +03:00
Anton Popov
6f4d9a53b2
Merge remote-tracking branch 'origin/sparse-serialization' into HEAD
2021-12-01 15:54:33 +03:00
Raúl Marín
7781fc12ed
Reduce dependencies on ASTSelectWithUnionQuery.h
...
521 -> 77 files requiring changes
2021-11-26 19:27:16 +01:00
Anton Popov
a20922b2d3
Merge remote-tracking branch 'origin/sparse-serialization' into HEAD
2021-11-09 15:36:25 +03:00
vdimir
56bc802ee2
Support join on constant
2021-11-08 15:44:13 +03:00
vdimir
08545795b5
Separate option for enabling fuse syntax for sum, avg, count
2021-11-03 15:13:09 +03:00
vdimir
039af96b61
Set execute_scalar_subqueries in MutationsInterpreter only for MergeTree and prepareInterpreterSelectQuery
2021-10-21 18:05:46 +03:00
vdimir
ed0bb2cec2
Fix deadlock on ALTER with scalar subquery to the same table
2021-10-21 14:02:51 +03:00
Amos Bird
635783fb66
Only do TreeOptimizer for initial queries
2021-10-11 20:47:35 +08:00
Kseniia Sumarokova
438a981e76
Update TreeRewriter.cpp
2021-10-05 11:25:50 +03:00
kssenii
f1ea186bff
Exists
2021-10-04 13:12:30 +00:00
Ilya Golshtein
7ebc16c1b3
get rid of DNF and related features in ORs in JOIN
2021-09-28 14:11:33 +03:00
Ilya Golshtein
626bfdf23c
compatible filter conditions, fixes and new tests in ORs in JOIN
2021-09-28 14:11:33 +03:00
Ilya Golshtein
bbd548e81d
bypass filer conditions in DNF in ORs in JOIN (part 2)
2021-09-28 14:11:33 +03:00
Ilya Golshtein
336b2a4c68
bypass filer conditions in DNF in ORs in JOIN (part 1)
2021-09-28 14:11:33 +03:00
Ilya Golshtein
17e6cfbefb
DNF bugfix in ORs in JOIN
2021-09-28 14:11:32 +03:00
Ilya Golshtein
aa4751a632
checkStackSize moved to the top of DNF::distributed in ORs in JOIN
2021-09-28 14:11:32 +03:00
Ilya Golshtein
78ad6bf529
MAX_ORS, checkStackSize and beautification per review in ORs in JOIN
2021-09-28 14:11:32 +03:00
Ilya Golshtein
637ff19f79
optimizeDisjuncts in ORs in JOIN
2021-09-28 14:11:31 +03:00
vdimir
3b35ab6e8c
Not implemented for asof and auto join with multiple ORs
2021-09-28 14:11:31 +03:00
vdimir
71b6c9414c
Minor changes related to JOIN ON ORs
2021-09-28 14:11:31 +03:00
vdimir
0a9a028c6f
fix
2021-09-28 14:11:31 +03:00
vdimir
46187a73ee
wip
2021-09-28 14:11:31 +03:00
Ilya Golshtein
db50015eed
review changes 1 - ASTPtr, some comments
2021-09-28 14:11:29 +03:00
Ilya Golshtein
3766d47f31
ORs in JOINs
2021-09-28 14:11:28 +03:00
Vladimir C
bc7c41efff
Merge pull request #26657 from hexiaoting/fuse_quantile
2021-09-21 12:33:07 +03:00
Maksim Kita
de20e04dfd
Added executable user defined functions
2021-09-17 18:42:59 +03:00
vdimir
a3304a87a4
Rename optimize_syntax_fuse_aggregate -> optimize_syntax_fuse_functions
2021-09-14 15:27:12 +03:00