Commit Graph

9380 Commits

Author SHA1 Message Date
sundy-li
685210e02b Merge branch 'master' into system-querylog-map 2021-01-23 11:28:22 +08:00
alexey-milovidov
feebf64cb1
Merge pull request #19397 from ClickHouse/aes-msan
Fix MSan report in AES functions
2021-01-23 04:47:36 +03:00
Alexey Milovidov
7d2108d4e9 Fix double whitespace 2021-01-23 02:57:35 +03:00
alexey-milovidov
25ea281297
Merge pull request #19360 from vdimir/issue-18197
Fix default value in join types with non-zero default (close #18197)
2021-01-22 23:51:56 +03:00
alesapin
7d4945a073
Merge pull request #19412 from ClickHouse/fix_one_more_tiny_race
Fix one more race in TestKeeper
2021-01-22 23:04:01 +03:00
tavplubix
49e1321df4
Merge pull request #19072 from ClickHouse/fix_19021
Fix checkpoint in PeekableReadBuffer over ConcatReadBuffer
2021-01-22 21:00:04 +03:00
tavplubix
1b832aa698
Merge pull request #19322 from ClickHouse/fix_18063
Fix segfault on aggregation when MV has unexpected structure
2021-01-22 20:15:09 +03:00
vdimir
ad73dc6c72
Check literal types in RewriteSumIfFunctionMatcher (#19406) 2021-01-22 19:21:45 +03:00
alexey-milovidov
b6822bfd04
Merge pull request #19365 from ClickHouse/tavplubix-patch-3
Better logging in MySQLHandler
2021-01-22 17:29:59 +03:00
alexey-milovidov
1fd500dfa4
Merge pull request #19378 from azat/pushing-to-view-logging
Add log message with elapsed time while pushing to view
2021-01-22 17:28:58 +03:00
tavplubix
9801bfc0ee
Merge branch 'master' into fix_18063 2021-01-22 17:28:05 +03:00
alexey-milovidov
f44f169aaa
Merge pull request #19385 from ClickHouse/sum-ubsan
Avoid UBSan report in aggregate function sum
2021-01-22 17:25:55 +03:00
alexey-milovidov
6e1d660e36
Merge pull request #19390 from ClickHouse/http_referer
Add http_referer to client info
2021-01-22 17:25:09 +03:00
alexey-milovidov
9818bd319a
Merge pull request #19381 from azat/parts-types-metrics
Add metrics for MergeTree parts (Wide/Compact/InMemory) types
2021-01-22 17:24:50 +03:00
alexey-milovidov
3431e39587
Merge pull request #19393 from ClickHouse/extract-all-groups-fail-fast
Fail fast in incorrect usage of extractAllGroups
2021-01-22 17:24:13 +03:00
alexey-milovidov
9add38f47b
Merge pull request #19394 from ClickHouse/quantile-weighted-overflow
Fix UBSan report in quantileExactWeighted
2021-01-22 17:18:01 +03:00
Kruglov Pavel
b2d5370b36
Merge pull request #17359 from ildus/tuple_arg_for_argMinMax
Add tuple argument support for argMin and argMax
2021-01-22 17:11:01 +03:00
alesapin
cc2788af88 Fix typo 2021-01-22 13:48:40 +03:00
Alexander Kuzmenkov
8b9105bf39
Merge pull request #18446 from azat/constant-folding
Fix constant folding when the result is unknown
2021-01-22 13:26:24 +03:00
Nikolai Kochetov
90e9c63fa4
Merge pull request #19316 from ClickHouse/fix-now64
Refactor now64
2021-01-22 13:21:16 +03:00
Alexander Kuzmenkov
b58a696b24
Merge pull request #19379 from azat/Buffer-less-lock-contention
Reduce lock contention for multiple layers of the Buffer engine
2021-01-22 13:17:34 +03:00
alesapin
b2a4921558 Fix style 2021-01-22 13:14:53 +03:00
alesapin
83862799cd Fix one more race in TestKeeper 2021-01-22 13:02:48 +03:00
sundy-li
339133f32a Support Map for OpenTelemetrySpanLog && improve docs update 2021-01-22 13:16:13 +08:00
Alexey Milovidov
56d09886e2 Fix MSan report in AES functions 2021-01-22 04:08:10 +03:00
alexey-milovidov
4e11e7cfa9
Merge pull request #18772 from azat/optimize-memory-tracking-fix
[RFC] Fix memory tracking for OPTIMIZE TABLE/merges
2021-01-22 03:48:06 +03:00
alexey-milovidov
52f570c28a
Merge pull request #19372 from davenger/posix_open_fix
Fix IDisk::open parameters to match posix open
2021-01-22 03:40:26 +03:00
Alexey Milovidov
14adc2d5f0 Fix UBSan report in quantileExactWeighted 2021-01-22 03:05:45 +03:00
Alexey Milovidov
e38ff3517d Fail fast in incorrect usage of extractAllGroups 2021-01-22 02:48:26 +03:00
Alexey Milovidov
afc6f2fd8e Add http_referer to client info 2021-01-22 01:55:45 +03:00
Alexey Milovidov
056b44b64f Add a test 2021-01-22 01:49:37 +03:00
Alexey Milovidov
960d149e0b More annotations 2021-01-22 01:05:04 +03:00
Alexey Milovidov
dcd03eb155 Remove useless file 2021-01-22 00:57:00 +03:00
alesapin
5037d3befd
Merge pull request #19355 from ClickHouse/fix_race_test_keeper
Fix race condition in TestKeeperHandler on session finish
2021-01-21 23:53:18 +03:00
alexey-milovidov
1883bc546a
Merge pull request #19357 from ClickHouse/values-ubsan
Fix potential nullptr dereference in table function VALUES
2021-01-21 23:34:41 +03:00
alexey-milovidov
37c345f55e
Merge pull request #19347 from ClickHouse/array-element-ubsan
Avoid UBSan report in arrayElement
2021-01-21 23:34:19 +03:00
Alexey Milovidov
d9cb1c1bdd Avoid UBSan report in aggregate function sum 2021-01-21 22:52:00 +03:00
Azat Khuzhin
b0a80af888 Reduce lock contention for multiple layers of the Buffer engine
Otherwise you can see something like this for the following query:

    ```sql
    WITH
        arrayMap(x -> demangle(addressToSymbol(x)), s.trace) AS trace_array,
        arrayStringConcat(trace_array, '\n') AS trace_string
    SELECT
        p.thread_id,
        p.query_id,
        p.query,
        trace_string
    FROM
    (
        SELECT
            query_id,
            query,
            arrayJoin(thread_ids) AS thread_id
        FROM system.processes
    ) AS p
    INNER JOIN system.stack_trace AS s ON p.thread_id = s.thread_id
    ORDER BY p.query_id ASC
    SETTINGS enable_global_with_statement = 0, allow_introspection_functions = 1
    FORMAT PrettyCompactNoEscapes
    ```

Lots of the following:

    ```sql
    INSERT INTO buffer (...) VALUES

    __lll_lock_wait
    pthread_mutex_lock
    std::__1::mutex::lock()
    DB::StorageBuffer::reschedule()
    DB::BufferBlockOutputStream::write(DB::Block const&)
    ```

That will wait one of this:

    ```
    INSERT INTO buffer (...) VALUES

    ...
    DB::PushingToViewsBlockOutputStream::write(DB::Block const&)
    DB::AddingDefaultBlockOutputStream::write(DB::Block const&)
    DB::SquashingBlockOutputStream::finalize()
    DB::SquashingBlockOutputStream::writeSuffix()
    DB::PushingToViewsBlockOutputStream::writeSuffix()
    DB::StorageBuffer::writeBlockToDestination(DB::Block const&, std::__1::shared_ptr<DB::IStorage>)
    DB::StorageBuffer::flushBuffer(DB::StorageBuffer::Buffer&, bool, bool, bool)
    ```

P.S. we cannot simply unlock the buffer during flushing, see comments in
the code
2021-01-21 22:09:24 +03:00
Azat Khuzhin
82e7e7d9cb Fix constant folding for expressions depends from subqueries result
Do not use subquery result, when value is unknown, for constant folding.

v2: fix simple subqueries, fixes 00597_push_down_predicate.
v3:
- use identity over introducing yet another cast analog (as suggested by @akuzm)
- simpler suitable_for_const_folding check
v4: use identity(cast()) since only cast() can provide corrent type (for
data types that does not have it's own type, i.e. DateTime)
v5: do not optimize consts if only_analyze isset, regardless the block
content
2021-01-21 21:26:50 +03:00
Azat Khuzhin
ea7528b853 identity: mark it as non suitable for constant folding 2021-01-21 21:22:23 +03:00
Azat Khuzhin
82f6c642ae identity: simple functions in oneline (coding style) 2021-01-21 21:22:23 +03:00
Azat Khuzhin
cb951c2116 Add metrics for MergeTree parts types
- PartsWide
- PartsCompact
- PartsInMemory
2021-01-21 21:17:00 +03:00
Azat Khuzhin
c68f7cd5b1 Measure time that spend during flush of the Buffer to the underlying 2021-01-21 21:11:39 +03:00
Azat Khuzhin
2c42600cf9 Add log message with elapsed time while pushing to view
Since right now theses queries are not logged and there is no way to
determine the time that it takes.

Proper fix will be to account them in system.processes (and all other
places), but this is not that easy.
2021-01-21 21:09:23 +03:00
Nikita Mikhaylov
dca0cbf4eb
Merge pull request #19313 from nikitamikhaylov/another-race-cache-dictionary
Fixed race between copy-constructor and addQueryAccessInfo
2021-01-21 21:02:36 +03:00
Nikita Mikhaylov
b93732e441
Merge pull request #18788 from hexiaoting/map_functions
Introduce mapContains, mapKeys, mapValues functions for Map data type
2021-01-21 21:02:03 +03:00
Nikita Mikhaylov
e8a9768bd0
Update map.cpp 2021-01-21 20:47:57 +03:00
Ildus Kurbangaliev
86db47de27 fix assert call 2021-01-21 22:23:49 +05:00
Alexander Gololobov
0a155ee2f1 Fix IDisk::open parameters to match posix open 2021-01-21 19:38:13 +03:00
tavplubix
600862f4a2
Better logging in MySQLHandler 2021-01-21 18:00:58 +03:00