Commit Graph

88990 Commits

Author SHA1 Message Date
xiedeyantu
6338368a1c optimize file segment getCacheReadBuffer 2022-05-19 20:14:52 +08: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
Mikhail f. Shiryaev
ae0d64d8e1
Merge pull request #37249 from ClickHouse/changelog-script
Improve changelog script
2022-05-18 19:30:31 +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
Maksim Kita
df0cb06209
Merge pull request #37289 from kitaisreal/unary-arithmetic-functions-improve-performance-dynamic-dispatch
Improve performance of unary arithmetic functions
2022-05-18 19:16:30 +02:00
Mikhail f. Shiryaev
610328263c
Merge pull request #37306 from ClickHouse/release-without-prestable
Release minor and major versions without prestable
2022-05-18 15:44:42 +02:00
Nikolai Kochetov
a19d4c6f1f
Merge pull request #37138 from azat/integration-tests-iptables
tests/integration: fix possible race for iptables user rules inside containers
2022-05-18 14:36:33 +02:00
Mikhail f. Shiryaev
c6e2dd1c43
Create release without draft step 2022-05-18 14:34:41 +02:00
Mikhail f. Shiryaev
1c11823935
Get rid of intermediate prestable release 2022-05-18 14:34:40 +02:00
Mikhail f. Shiryaev
b93a4e2da3
Minor improvements on variables and comments 2022-05-18 14:34:40 +02:00
Mikhail f. Shiryaev
3b1c858bff
Rollback prestable part on failed testing 2022-05-18 14:34:38 +02:00
Mikhail f. Shiryaev
6cedd2f671
Catch all Exceptions in context managers 2022-05-18 14:32:49 +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
Nikolai Kochetov
508e64b7d0
Merge pull request #37322 from ClickHouse/typos
Fixed typos
2022-05-18 13:48: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
Anton Popov
4def736ecb
Merge pull request #37275 from ernado/fix/open-telemetry-span-log-fix-alias
Fix attribute.values alias for OTEL table
2022-05-18 13:18:07 +02:00
Nikolai Kochetov
64ecb3941c
Merge pull request #37259 from ClickHouse/clangtidies2
Activate more clangtidies
2022-05-18 13:01:40 +02:00
Alexander Gololobov
e9db3465e3 Fixed typos 2022-05-18 13:01:32 +02:00
Kruglov Pavel
3c33db5d8b
Merge pull request #36981 from Avogar/fix-external-tables-in-hedged-connections
Fix sending external tables data in HedgedConnections
2022-05-18 12:50:11 +02:00
Vladimir C
1779fb08ed
Merge pull request #36271 from yuuch/support_collation_in_create_query 2022-05-18 12:43:49 +02:00
Vladimir C
f979a03fbe
Merge pull request #37256 from vdimir/issue_37217 2022-05-18 12:42:47 +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
492de1076c
Merge pull request #37232 from zzsmdfj/fix-mysql-datatype-binary0
fix MySQL database engine to compatible with binary(0) dataType
2022-05-18 12:15:07 +02:00
Dmitry Novik
5f376995ea
Merge pull request #37299 from ClickHouse/fix-overcommit-deadlock
Fix possible deadlock in OvercommitTracker during logging
2022-05-18 12:01:32 +02:00
Mikhail f. Shiryaev
381dab1870
Merge pull request #37301 from ClickHouse/fix-check-labels
Update run-check.py to match PR template, add comments
2022-05-18 11:31:48 +02:00
Kseniia Sumarokova
f9b08ae5dd
Merge pull request #37281 from bigo-sg/hive_max_partition_query_check
Check max partitions to read for each hive table
2022-05-18 11:11:11 +02:00
Robert Schulze
6b2a72d451
Merge pull request #37228 from mrk-andreev/fix-rm-groupid-from-producer
Remove group.id from StorageKafka::createWriteBuffer
2022-05-18 11:04:40 +02:00
Kseniia Sumarokova
38c87ab9cd
Merge pull request #36493 from kssenii/fix-encrypted-buffer
Fix offset update ReadBufferFromEncryptedFile
2022-05-18 09:46:17 +02:00
Yakov Olkhovskiy
5b2d794460
Merge pull request #37142 from ClickHouse/system-certificates
system.certificates table is added
2022-05-17 23:21:46 -04:00
Dmitry Novik
a82239984c Remove include 2022-05-18 01:44:51 +00:00
Dmitry Novik
20c537addd Make noncopyable 2022-05-18 01:42:13 +00:00
mergify[bot]
c33ca1f392
Merge branch 'master' into system-certificates 2022-05-17 19:52:28 +00:00
Mikhail f. Shiryaev
e6e0f0589d
Update run-check.py to match PR template, add comments 2022-05-17 21:43:22 +02:00
mergify[bot]
05305811f8
Merge branch 'master' into fix-bool-eof 2022-05-17 19:28:11 +00:00
Robert Schulze
0c55ac76d2
A few clangtidy updates
Enable:

- bugprone-lambda-function-name: "Checks for attempts to get the name of
  a function from within a lambda expression. The name of a lambda is
  always something like operator(), which is almost never what was
  intended."

- bugprone-unhandled-self-assignment: "Finds user-defined copy
  assignment operators which do not protect the code against
  self-assignment either by checking self-assignment explicitly or using
  the copy-and-swap or the copy-and-move method.""

- hicpp-invalid-access-moved: "Warns if an object is used after it has
  been moved."

- hicpp-use-noexcept: "This check replaces deprecated dynamic exception
  specifications with the appropriate noexcept specification (introduced
  in C++11)"

- hicpp-use-override: "Adds override (introduced in C++11) to overridden
  virtual functions and removes virtual from those functions as it is
  not required."

- performance-type-promotion-in-math-fn: "Finds calls to C math library
  functions (from math.h or, in C++, cmath) with implicit float to
  double promotions."

Split up:

- cppcoreguidelines-*. Some of them may be useful (haven't checked in
  detail), therefore allow to toggle them individually.

Disable:

- linuxkernel-*. Obvious.
2022-05-17 20:56:57 +02:00
mergify[bot]
36b4ed19c5
Merge branch 'master' into unary-arithmetic-functions-improve-performance-dynamic-dispatch 2022-05-17 18:08:24 +00:00
Dmitry Novik
a97ba9741e Fix possible deadlock in OvercommitTracker during logging 2022-05-17 18:07:52 +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
Alexander Gololobov
7be959447d
Merge pull request #37291 from ClickHouse/tidy
tidy build fix
2022-05-17 18:12:01 +02:00
zzsmdfj
6a8913d2f6 to compatible with binary(0)-adjust code style 2022-05-17 23:08:40 +08:00
Maksim Kita
31a29d8315 Fixed dynamic dispatch macro 2022-05-17 16:59:11 +02:00
Maksim Kita
c8812bd38e
Merge pull request #37294 from den-crane/patch-8
Doc. Bool type
2022-05-17 16:49:44 +02:00
Maksim Kita
4c6224c1c6
Update boolean.md 2022-05-17 16:49:32 +02:00
Denny Crane
e7555e8a07
Update boolean.md 2022-05-17 10:51:41 -03:00
Denny Crane
f7ead85150
Update boolean.md 2022-05-17 10:49:21 -03:00
avogar
46f4f8a457 Fix use of unitialized memory 2022-05-17 12:59:46 +00:00
kssenii
b53ca506e6 Add unit test 2022-05-17 14:55:42 +02:00
Alexander Gololobov
8cc41521ad tidy build fix 2022-05-17 14:35:12 +02:00
zzsmdfj
60ef84bf4c to compatible with binary(0)-fix code style 2022-05-17 20:15:59 +08:00