Commit Graph

11084 Commits

Author SHA1 Message Date
Alexander Tokmakov
12bbb7de87 fix race on TID allocation 2022-05-20 12:41:44 +02:00
Kseniia Sumarokova
8dcee2813d
Merge pull request #37219 from Vxider/wv-watch-limit
Add test for WATCH LIMIT query in WindowView
2022-05-19 13:52:38 +02:00
Kseniia Sumarokova
24d0899cb7
Merge pull request #36945 from Vxider/wv-populate
POPULATE support for WindowView
2022-05-19 13:47:52 +02:00
Kseniia Sumarokova
791cc5ced1
Merge pull request #37290 from azat/query-kind-client
Add ability to pass QueryKind via clickhouse-client/local (useful for debugging)
2022-05-19 13:22:42 +02:00
Kruglov Pavel
707f12a893
Merge pull request #37320 from ClickHouse/Avogar-patch-5
Speed up test 00157_cache_dictionary
2022-05-19 12:21:38 +02:00
Azat Khuzhin
29a8a00656 Add ability to pass QueryKind via clickhouse-client/local (useful for debugging)
v2: fix LocalConnection::sendQuery() for Suggest (comes w/o client_info) [1]
    [1]: https://s3.amazonaws.com/clickhouse-test-reports/37290/7c85175963226ff78eec542efafcff4e650aa0f0/stateless_tests__ubsan__actions_.html
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-05-19 07:19:27 +03: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
Kruglov Pavel
2b655ccb75
Speed up test 00157_cache_dictionary 2022-05-18 12:12:41 +02:00
mergify[bot]
4900d2249f
Merge branch 'master' into wv-populate 2022-05-18 01:56:52 +00: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
Vxider
f74c934a61 Merged with master 2022-05-17 02:53:59 +00: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
Vxider
d7dcb1f5d9 update test 2022-05-16 17:49:14 +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
mergify[bot]
753fac95ef
Merge branch 'master' into wv-watch-limit 2022-05-16 11:42:31 +00: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
Vxider
af3e13541a update test 2022-05-15 17:56:53 +00:00
Vxider
ea62dc4d0a use event time in test 2022-05-15 16:05:19 +00: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
Vxider
528e21ebf4 add test for windowview watch limit 2022-05-15 09:14:01 +00: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
Vxider
d1a9ebaaaf update code style 2022-05-14 03:59:23 +00: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
Vxider
3bdddea3cf update test 2022-05-13 17:45:28 +00: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