Commit Graph

11069 Commits

Author SHA1 Message Date
avogar
bb2fb48ad7 Fix tests 2022-05-20 10:53:20 +00:00
avogar
f69c3175af Fix comments 2022-05-19 10:13:44 +00:00
avogar
a71f9eb9e4 Merge branch 'fix-array-map-nothing' of github.com:Avogar/ClickHouse into fix-array-map-nothing 2022-05-19 09:02:02 +00:00
avogar
cb8646fbb4 Merge branch 'master' of github.com:ClickHouse/ClickHouse into fix-array-map-nothing 2022-05-19 07:18:48 +00:00
Azat Khuzhin
dea1706d4e
Fix GROUP BY AggregateFunction (#37093)
* Fix GROUP BY AggregateFunction

finalizeChunk() was unconditionally converting AggregateFunction to the
underlying type, however this should be done only if the aggregate was
applied.

So pass names of aggregates as an argument to the finalizeChunk()

Fuzzer report [1]:

    Logical error: 'Bad cast from type DB::ColumnArray to DB::ColumnAggregateFunction'. Received signal 6 Received signal Aborted (6)

For the following query:

    SELECT
        arraySort(groupArrayArray(grp_simple)),
        grp_aggreg,
        arraySort(groupArrayArray(grp_simple)),
        b,
        arraySort(groupArrayArray(grp_simple)) AS grs
    FROM data_02294
    GROUP BY
        a,
        grp_aggreg,
        b
    SETTINGS optimize_aggregation_in_order = 1

  [1]: https://s3.amazonaws.com/clickhouse-test-reports/37050/323ae98202d80fc4b311be1e7308ef2ac39e6063/fuzzer_astfuzzerdebug,actions//fuzzer.log

v2: fix conflicts in src/Interpreters/InterpreterSelectQuery.cpp
v3: Fix header for GROUP BY AggregateFunction WITH TOTALS
v4: Add sanity check into finalizeBlock()
v5: Use typeid_cast<&> to get more sensible error in case of bad cast (as suggested by @nickitat)
v6: Fix positions passed to finalizeChunk()
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>

* Core/ColumnNumbers.h: remove unused <string>

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>

* Optimize finalizeChunk()/finalizeBlock()

v2: s/ByPosition/Mask/ s/by_position/mask/
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-05-18 23:37:43 +02:00
Vitaly Baranov
7c8956ca8d
Merge pull request #36879 from tonickkozlov/tonickkozlov/lazy-marks-loading
Lazy marks loading
2022-05-18 22:56:46 +02:00
Vitaly Baranov
9ccddc44c6
Merge pull request #35767 from azat/ON_CLUSTER-grant
RFC: Add separate CLUSTER grant
2022-05-18 19:19:54 +02:00
Anton Popov
715d5b0173
Merge pull request #37270 from Avogar/fix-bool-eof
Fix Nullable(String) to Nullable(Bool/IPv4/IPv6) conversion
2022-05-18 14:08:52 +02:00
Vladimir C
7d88b81622
Merge pull request #37193 from azat/fix-limit-by-in-dist-queries
Fix "Cannot create column of type Set" for distributed queries with LIMIT BY
2022-05-18 13:28:19 +02:00
Vladimir C
1779fb08ed
Merge pull request #36271 from yuuch/support_collation_in_create_query 2022-05-18 12:43:49 +02:00
Kruglov Pavel
aaace46da2
Merge pull request #37266 from CurtizJ/fix-mutations-with-object
Fix mutations in tables with columns of type `Object`
2022-05-18 12:19:55 +02:00
mergify[bot]
c33ca1f392
Merge branch 'master' into system-certificates 2022-05-17 19:52:28 +00:00
mergify[bot]
05305811f8
Merge branch 'master' into fix-bool-eof 2022-05-17 19:28:11 +00:00
Alexander Gololobov
38f291c70d
Merge pull request #37030 from bharatnc/ncb/h3-missing-traversal-funcs
add remaining h3 traversal funcs
2022-05-17 18:19:56 +02:00
avogar
46f4f8a457 Fix use of unitialized memory 2022-05-17 12:59:46 +00:00
Vitaly Baranov
f34a5cdee2
Merge branch 'master' into ON_CLUSTER-grant 2022-05-17 13:21:20 +02:00
Kseniia Sumarokova
94683786dc
Merge branch 'master' into MeiliSearch 2022-05-16 22:42:09 +02:00
Alexander Gololobov
e2e3536a80 Fixed handling of gridPathCellsSize() errors 2022-05-16 21:23:45 +02:00
avogar
415aabd4d0 Fix Nullable(String) to Nullable(Bool/IPv4/IPv6) conversion 2022-05-16 19:15:18 +00:00
Anton Popov
b6c5ab4fcf fix mutations in tables with columns of type Object 2022-05-16 18:26:53 +00:00
Yakov Olkhovskiy
863c52f0f4 refactoring, test added 2022-05-16 13:31:28 -04:00
Dmitry Novik
dd1e7b55b8
Merge pull request #37050 from azat/fix-optimize_aggregation_in_order-prefix-Array
Fix optimize_aggregation_in_order with prefix GROUP BY and *Array aggregate functions
2022-05-16 17:17:56 +02:00
Anton Popov
9c3daf7e5b
Merge pull request #37245 from ClickHouse/CurtizJ-patch-4-1
Temporarily fix flaky test `01825_type_json_insert_select.sql`
2022-05-16 16:44:27 +02:00
Kruglov Pavel
5e34f48a18
Merge pull request #37021 from excitoon-favorites/fixtdigest
Fixed problem with infs in `quantileTDigest`
2022-05-16 15:21:59 +02:00
alesapin
1829256ae2
Merge pull request #37178 from ClickHouse/ignore_auto_increment_in_create_table_2
Ignore AUTO_INCREMENT in CREATE TABLE to simplify migration from MySQL
2022-05-16 13:29:22 +02:00
Anton Popov
848b762eb0 Update 01825_type_json_insert_select.sql 2022-05-16 11:18:31 +00:00
Azat Khuzhin
01e1c5345a Add separate CLUSTER grant
In case you have different roles for the same user on multiple clusters,
ON CLUSTER query can help to overcome some limitations.

Consider the following example:
- cluster_with_data, dev_user (readonly=2)
- stage_cluster, dev_user (readonly=0)

So when you will execute the following query from stage_cluster, it will
be successfully executed, since ON CLUSTER queries has different system
profile:

    DROP DATABASE default ON CLUSTER cluster_with_data

This is not 100% safe, but at least something.

Note, that right now only ON CLUSTER query it self is supported, but
separate clusters are not (i.e. GRANT CLUSTER some_cluster_name TO
default), since right now grants sticked to database+.

v2: on_cluster_queries_require_cluster_grant
v3: fix test and process flags as bit mask
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-05-16 13:57:45 +03:00
Vladimir C
75008d5903
Merge pull request #37166 from vdimir/issue_37141 2022-05-16 12:21:41 +02:00
Vladimir Chebotarev
5bbab401c4 Added test. 2022-05-15 22:49:52 +03:00
Dmitry Novik
a36f05d6b8
Merge pull request #32999 from ClickHouse/fix-gs-formating
Cleanup GROUPING SETS formating
2022-05-15 15:11:52 +02:00
Dmitry Novik
2259add1fa
Merge pull request #37197 from ClickHouse/overcommit-ratio-overflow
Fix possible overflow in OvercommitRatio
2022-05-15 15:09:19 +02:00
Alexey Milovidov
8334329dff
Merge pull request #37023 from ClickHouse/chained-or
Merging #34932.
2022-05-15 04:32:31 +03:00
Azat Khuzhin
40f3dbb448 Ignore harmful env variables in clickhouse binaries (reexec w/o them)
Some environments may really require LD_LIBRARY_PATH (and some other
variables), so rejecting running clickhouse binaries in such envs is a
backward incompatible change.

So instead of rejecting, let's ignore those env variables, i.e. reexec
binaries without them.

Also note, that there is no messages in stderr in case of some of
variables set anymore, since this message may break some scripts.

Refs: #36340
Follow-up for: #36342
2022-05-14 12:08:48 +03:00
Maksim Kita
3f18d7da33
Merge pull request #37189 from kitaisreal/function-h3-k-ring-add-cast
Function h3kRing added cast
2022-05-13 22:53:20 +02:00
Azat Khuzhin
b29a0f3c84 Fix "Cannot create column of type Set" for distributed queries with LIMIT BY
The problem was that after #36454 it requires too much columns.

Fixes: #36454
Fixes: #37045
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-05-13 20:03:19 +03:00
Dmitry Novik
75c5ae31f7 Fix shellcheck 2022-05-13 16:27:52 +00:00
Dmitry Novik
fb5766287c Cleanup GROUPING SETS formating 2022-05-13 16:14:41 +00:00
Dmitry Novik
45585f0e7f Fix possible overflow in OvercommitRatio 2022-05-13 15:39:05 +00:00
Alexander Gololobov
fe2aa1861f
Merge pull request #37033 from qieqieplus/array-distance-functions
Distance/ Norm functions for array
2022-05-13 17:28:19 +02:00
Igor Nikonov
74be0946ff Test fixes 2022-05-13 13:33:45 +00:00
mergify[bot]
603bd85fbe
Merge branch 'master' into function-h3-k-ring-add-cast 2022-05-13 13:26:09 +00:00
Maksim Kita
ef7e21ea46 Function h3kRing added cast 2022-05-13 15:20:04 +02:00
Igor Nikonov
8d5cabc8f7 Fix style warnings and review comments 2022-05-13 11:27:17 +00:00
mergify[bot]
756a8520e9
Merge branch 'master' into fix-array-map-nothing 2022-05-13 10:45:36 +00:00
vdimir
dc2a90a344
ApplyWithGlobalVisitor for WITH in subquery 2022-05-13 10:40:51 +00:00
Kseniia Sumarokova
6d5137879b
Merge pull request #37054 from kssenii/better-read-from-cache
Better read from cache buffer
2022-05-13 12:20:06 +02:00
Alexander Tokmakov
432f1d570c
Merge pull request #37153 from azat/fix-optimize_skip_unused_shards_rewrite_in
Fix implicit cast for optimize_skip_unused_shards_rewrite_in
2022-05-13 12:58:28 +03:00
Igor Nikonov
f423e9bf40 Ignore AUTO_INCREMENT in CREATE TABLE to simplify migration from MySQL
Issue #35893
2022-05-13 09:22:52 +00:00
mergify[bot]
2fdd305ef1
Merge branch 'master' into array-distance-functions 2022-05-13 07:56:57 +00:00
bharatnc
5cdd577153 fix tests 2022-05-12 12:13:37 -07:00