Commit Graph

344 Commits

Author SHA1 Message Date
Eridanus
0a80d451d2 Rewrite countDistinctIf with count_distinct_implementation configuration. 2022-10-04 17:23:28 +08:00
Alexey Milovidov
0e3b9bf3ff Add more checkStackSize calls 2022-10-01 17:48:56 +02:00
Alexey Milovidov
9c5f9f1815
Merge pull request #41158 from den-crane/bug/trivial_count_optimization_with_array_join
Fix: trivial count optimization with array join. revert revert #39466
2022-09-12 08:56:10 +03:00
kssenii
2f3bfc5411 Fix 2022-09-11 13:54:25 +02:00
Denny Crane
be90cecbd2 Revert "Revert "Fix trivial count optimization with array join""
This reverts commit 17de7b2876.
2022-09-09 14:56:38 -03:00
luocongkai
56e4179cad fix bug when remove unneeded columns in subquery 2022-09-01 17:10:32 +08:00
Raúl Marín
32c63f43a1 Don't visit the AST for UDFs if none are registered 2022-08-10 17:54:56 +02:00
Nikolai Kochetov
658a269d56
Merge branch 'master' into use-dag-in-key-condition 2022-08-04 16:18:40 +02:00
Kruglov Pavel
6457c069a9
Merge pull request #39293 from kssenii/fix-positional-args-case
Fix positional arguments in case of unneeded columns pruning
2022-08-01 12:42:18 +02:00
Nikolai Kochetov
22fbfe19a4 Merge branch 'master' into use-dag-in-key-condition 2022-07-31 21:54:12 +02:00
kssenii
d66c108a04 Fix 2022-07-30 18:42:22 +03:00
kssenii
efff78819a Merge remote-tracking branch 'upstream/master' into fix-positional-args-case 2022-07-29 22:07:51 +03:00
Maksim Kita
8fc6bad4f4 Join enums refactoring 2022-07-29 18:35:05 +02:00
Nikolai Kochetov
59a11b32ad
Merge branch 'master' into use-dag-in-key-condition 2022-07-29 17:01:33 +02:00
Nikolai Kochetov
6919ae7c91 Fixing a test with indexHint 2022-07-28 12:24:16 +00:00
vdimir
96bcae419c
Cleanup logic around join_algorithm setting 2022-07-21 14:53:39 +00:00
kssenii
e6437f46b1 Fix 2022-07-16 22:23:49 +02:00
Vladimir C
db838f1343
Merge pull request #35796 from vdimir/full-sorting-merge-join 2022-07-07 19:16:49 +02:00
vdimir
4e88e8f5ec
full sort join: move block list to all join state 2022-07-06 14:26:17 +00:00
vdimir
fa8eb35599
Pipeline for full sorting merge join 2022-07-06 14:23:44 +00:00
Igor Nikonov
5a01c27eb1 Fix: clear children in order by element during rewriting
- remove unnecessary code for this PR
2022-07-05 22:48:48 +00:00
Igor Nikonov
fd62494a77 Fix: ORDER BY with braces inefficient execution 2022-07-05 22:48:48 +00:00
Azat Khuzhin
d98336ad83 Fix incorrect columns order in subqueries of UNION
Consider the following query:

    SELECT avgWeighted(x, y) FROM (SELECT NULL, 255 AS x, 1 AS y UNION ALL SELECT y, NULL AS x, 1 AS y)

Here is UNION from two SELECT queries
- `SELECT NULL, 255 AS x, 1 AS y`
- `SELECT y, NULL AS x, 1 AS y`

UNION queries matches columns by positions, not names, so the following
columns should be used by `avgWeighted()`:
- `255 AS x,  1 AS y`
- `NULL AS x, 1 AS y`

Result types of arguments should be:
- `x Nullable(UInt8)`
- `y UInt8`

And in case of UNION query is a subselect itself, it will return only
required columns, for the example above it needs only `x` and `y`.
For this it will get positions of these arguments from the first query,
and then use those positions to get required column names from the
second query (since there is no ability to get columns by positions
instead of names internally), and due to duplicated columns the second
query will return (`y`, `x`) not (`x`, `y`), and this will make the
result incorrect:

    EXPLAIN header = 1, optimize = 0, actions=1 SELECT avgWeighted(x, y) FROM (SELECT NULL, 255 AS x, 1 AS y UNION ALL SELECT y, NULL AS x, 1 AS y)

    Aggregates:
        avgWeighted(x, y)
          Function: avgWeighted(Nullable(UInt8), UInt8) → Nullable(Float64)
          Arguments: x, y
          Argument positions: 0, 1
      Expression (Before GROUP BY)
      Header: x UInt8
              y Nullable(UInt8)
      ...
      Union
      Header: x UInt8
              y Nullable(UInt8)
        Expression (Conversion before UNION)
        Header: x UInt8
                y Nullable(UInt8)
        Expression (Conversion before UNION)
        Header: x UInt8
                y Nullable(UInt8)

And the query itself fails with an error:

    Logical error: 'Bad cast from type DB::ColumnVector<char8_t> to DB::ColumnNullable'.

_NOTE: `avgWeighted()` here is required to trigger `LOGICAL_ERROR`_

CI: https://s3.amazonaws.com/clickhouse-test-reports/37796/e637489f81768df582fe7389e57f7ed12893087c/fuzzer_astfuzzerdebug,actions//report.html
Fixes: 02227_union_match_by_name
v2: fix untuple() (reserve space for output_columns_positions too)
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-06-28 22:53:03 +03:00
Azat Khuzhin
ee0f2651ee Revert "Fix converting types for UNION queries (may produce LOGICAL_ERROR)"
This fix is incorrect, and it introduce new issues, in particular it
may breaks UNION queries w/o column aliases, i.e.:

    SELECT a, b, c FROM (SELECT 3 AS a, 2147483647 AS b, 1048575 AS c UNION ALL SELECT -2, NULL, -2) AS js1 ORDER BY a

CI: https://s3.amazonaws.com/clickhouse-test-reports/37796/e637489f81768df582fe7389e57f7ed12893087c/fuzzer_astfuzzerdebug,actions//report.html
Reverts: #37593/#34775 (2613149f6b)
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-06-28 22:50:01 +03:00
Anton Kozlov
5f81bcd84f
CLICKHOUSE-1331 Rewrite tuple functions as literals in backwards-compatibility mode (#38096)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-06-27 14:13:21 +02:00
mergify[bot]
670a63865e
Merge branch 'master' into window-function-expression 2022-06-19 22:14:54 +00:00
Dmitry Novik
376412e417 Small refactoring 2022-06-16 15:41:04 +00:00
Dmitry Novik
0663f07e67 Rework expressions with window functions 2022-06-16 13:29:56 +00:00
Maksim Kita
98a89b50ff Use pdqsort instead of standard sort 2022-06-13 15:31:08 +02:00
Alexander Tokmakov
58f8c87265
Merge pull request #36937 from bigo-sg/fix_settings
Fix overrided settings: normalize_function_names
2022-06-02 17:45:17 +03:00
Vladimir C
2a38fdb796
Merge pull request #37653 from vdimir/cross_join_dup_col_names 2022-05-31 17:50:19 +02:00
Dmitry Novik
b41fe00f31
Merge pull request #37542 from azat/grouping-sets-fix-optimize_aggregation_in_order
Prohibit optimize_aggregation_in_order with GROUPING SETS (fixes LOGICAL_ERROR)
2022-05-31 15:31:45 +02:00
vdimir
8a3f4bda62
Fix columns number mismatch in cross join 2022-05-30 15:40:15 +00:00
Azat Khuzhin
1f29b0a901 Rewrite queries GROUPING SETS (foo, bar) to GROUP BY foo, bar
This is better then introducing separate
SelectQueryExpressionAnalyzer::useGroupingSetKey(), since for
optimize_aggregation_in_order that method will not be enough, because
size of ManyExpressionActions will not match size of SortDescription, in
ReadInOrderOptimizer::ReadInOrderOptimizer()

And plus it is cleaner.

v2: fix clang-tidy
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-05-27 17:44:51 +03:00
Azat Khuzhin
2613149f6b 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
v3: add no-backward-compatibility-check for the test
Fixes: #37569
Resubmit: #34775
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
(cherry picked from commit a813f5996e)
2022-05-27 14:11:57 +03:00
Dmitry Novik
3a9239b79f
Revert "RFC: Fix converting types for UNION queries (may produce LOGICAL_ERROR)" 2022-05-27 04:05:32 +02:00
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
taiyang-li
c7e68d664d fix building 2022-05-24 10:58:45 +08:00
taiyang-li
c120b19802 fix building 2022-05-23 17:42:20 +08:00
taiyang-li
9f3dadf17c Merge branch 'master' into fix_settings 2022-05-17 16:19:29 +08:00
vdimir
9b24e0d260
Apply optimizeCountConstantAndSumOne before JOINs 2022-05-10 14:30:33 +00:00
taiyang-li
fd878f7e7b change as requested 2022-05-10 12:06:50 +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
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
vdimir
a1463d5719
Merge remote-tracking branch 'origin/master' into fuse_quantile 2021-09-14 15:23:06 +03:00
vdimir
5a1aeeb044
Use optimize_syntax_fuse_aggregate instead of optimize_fuse_sum_count_avg and optimize_fuse_quantile 2021-09-14 15:21:16 +03:00
vdimir
a3db56f056
Revert "fuse multi setting options into one when Optimize"
This reverts commit bbd7799375.
2021-09-14 15:12:21 +03:00
vdimir
3d2d994c5d
Skip JOIN OR/USING sections in replaceAliasColumnsInQuery 2021-09-14 14:13:19 +03:00
hexiaoting
bbd7799375 fuse multi setting options into one when Optimize 2021-09-14 18:51:13 +08:00
vdimir
a7f770ecb7
Do not replaceAliasColumnsInQuery for JOIN OR/USING sections 2021-09-14 13:08:20 +03:00
Anton Popov
4c388e3d84 Merge remote-tracking branch 'origin/sparse-serialization' into HEAD 2021-09-09 14:10:16 +03:00
vdimir
c4ffc2879f
Perform join type inference for USING at ExpressionAnalyzer instead of TreeRewriter 2021-09-01 15:05:47 +03:00
vdimir
e8e26463bf
Change signature of ASTSelectQuery::arrayJoinExpressionList 2021-08-31 15:27:44 +03:00
vdimir
3443b3b5c4
Separate functoin buildJoinedPlan, minor refactoring 2021-08-31 15:27:44 +03:00
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