Commit Graph

82374 Commits

Author SHA1 Message Date
cnmade
47c123de3c Fixed zh...statements/exists: rename old file 2022-01-29 16:35:18 +08:00
lgbo-ustc
5f1969c6c5 fixed code styles 2022-01-29 09:46:00 +08:00
Maksim Kita
aff7bc3e31
Merge pull request #34049 from cnmade/PF202201271450
Translate zh/sql-reference/statements/use: fix last bug of the translate
2022-01-28 23:47:48 +01:00
Anton Popov
b950a12cb3
Merge pull request #34068 from CurtizJ/fix-async-insert-native
Fix asynchronous inserts with `Native` format
2022-01-29 01:24:53 +03:00
Anton Popov
7c3d6f5fda
Update 02187_async_inserts_all_formats.sh 2022-01-29 01:24:30 +03:00
alexey-milovidov
379f8d3d7e
Update use.md 2022-01-29 01:09:46 +03:00
alexey-milovidov
6535b75322
Merge pull request #34001 from azat/memory-tracker-fix
Fix memory accounting for queries that uses < max_untracker_memory
2022-01-29 00:59:53 +03:00
Amos Bird
2b3ce910c6
Fix collation check 2022-01-29 04:49:58 +08:00
Maksim Kita
7ef2f82707
Merge pull request #34128 from fedrod/subqueries-visitor-missing-static-const
ExecuteScalarSubqueriesVisitor missing static const
2022-01-28 21:36:53 +01:00
Federico Rodriguez
c0a5bd187a ExecuteScalarSubqueriesVisitor missing static const
Added string_view
2022-01-28 15:00:04 -05:00
Amos Bird
09a3ab79b7
Fix all const 2022-01-29 01:37:39 +08:00
Ramazan Polat
66cb64393b
Make clickhouse-diagnostics also work for altinity release
Because altinity release has `altinitystable` at the end of version number, `parse_version` function throws parse error.
2022-01-28 18:57:56 +03:00
Maksim Kita
b618febdec
Merge pull request #33970 from amosbird/fixwerror
Fix missing -Werror flag
2022-01-28 16:53:09 +01:00
Maksim Kita
0465d6b15c
Merge pull request #34079 from cnmade/PF202201281523
translate zh...statements/set
2022-01-28 16:10:03 +01:00
Maksim Kita
e2de0dff8f
Merge pull request #34074 from azat/array-optimization
Slightly optimize ColumnArray::get()/operator[] (by using reserve over resize)
2022-01-28 16:09:44 +01:00
Maksim Kita
60129aaecb
Merge pull request #34052 from kitaisreal/remove-decimal-padded-pod-array
Remove DecimalPaddedPODArray
2022-01-28 15:54:41 +01:00
Sergei Trifonov
6d55a685cd
Merge pull request #34112 from ClickHouse/add-cppexpr-examples
add c++expr script examples
2022-01-28 17:27:35 +03:00
Sergei Trifonov
5295adb83d add c++expr script examples 2022-01-28 16:43:25 +03:00
Azat Khuzhin
0e1c6b6b9c Make 01810_max_part_removal_threads_long more accurate
v0: After parts removing stop attach/detach for each remove, there are only
    11 threads, primary query and 10 for removal.

    CI: https://s3.amazonaws.com/clickhouse-test-reports/34001/8cace291d17fa9553a98b2a1e8bf15b30fe5a1bd/stateless_tests__debug__actions__[3/3].html

v2: Make 01810_max_part_removal_threads_long more deterministic

    Sometimes, if removing parts will be too fast (like in [1]), then it may
    use less threads, since thread pool will reuse existing, so increase
    number of rows per part and compare threads directly w/o throwIf().

      [1]: https://s3.amazonaws.com/clickhouse-test-reports/34001/e74b6379a58c4607bdb54cd4c457410166e869ca/stateless_tests_flaky_check__address__actions_.html

v3: Less flaky 01810_max_part_removal_threads_long
v4: Make check not strict in 01810_max_part_removal_threads_long

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-01-28 16:25:33 +03:00
Azat Khuzhin
162f96f8e1 Get back detachQueryIfNotDetached() into ExternalLoader
ExternalLoader from ThreadPool (async loading) is done from the server
context, not from the query context, and the context will already go
away, so we should detachQueryIfNotDetached() to avoid trigger assertion
in ThreadStatus.

CI: https://s3.amazonaws.com/clickhouse-test-reports/34001/8cace291d17fa9553a98b2a1e8bf15b30fe5a1bd/stateless_tests__debug__actions__[3/3].html

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-01-28 16:25:33 +03:00
Azat Khuzhin
1519985c98 Fix possible "Can't attach query to the thread, it is already attached"
After detachQueryIfNotDetached() had been removed it is not enough to
use attachTo() for ThreadPool (scheduleOrThrowOnError()) since the query
may be already attached, if the thread doing multiple jobs, so
CurrentThread::attachToIfDetached() should be used instead.

This should fix all the places from the failures on CI [1]:

    $ fgrep DB::CurrentThread::attachTo -A1 ~/Downloads/47.txt  | fgrep -v attachTo | cut -d' ' -f5,6 | sort | uniq -c
         92 --
          2 /fasttest-workspace/build/../../ClickHouse/contrib/libcxx/include/deque:1393: DB::ParallelParsingInputFormat::parserThreadFunction(std::__1::shared_ptr<DB::ThreadGroupStatus>,
          4 /fasttest-workspace/build/../../ClickHouse/src/Storages/MergeTree/MergeTreeData.cpp:1595: void
         87 /fasttest-workspace/build/../../ClickHouse/src/Storages/MergeTree/MergeTreeDataSelectExecutor.cpp:993: void

  [1]: https://github.com/ClickHouse/ClickHouse/runs/4954466034?check_suite_focus=true

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-01-28 16:25:33 +03:00
Azat Khuzhin
b0c862c297 Fix memory accounting for queries that uses < max_untracker_memory
MemoryTracker starts accounting memory directly only after per-thread
allocation exceeded max_untracker_memory (or memory_profiler_step).

But even memory under this limit should be accounted too, and there is
code to do this in ThreadStatus dtor, however due to
PullingAsyncPipelineExecutor detached the query from thread group that
memory was not accounted.

So remove CurrentThread::detachQueryIfNotDetached() from threads that
uses ThreadFromGlobalPool since it has ThreadStatus, and the query will
be detached using CurrentThread::defaultThreadDeleter.

Note, that before this patch memory accounting works for HTTP queries
due to it had been accounted from ParallelFormattingOutputFormat, but
not for TCP.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-01-28 16:25:33 +03:00
Nikolai Kochetov
1c9f026178 Merge branch 'master' into add-pool-to-s3-write-buffer 2022-01-28 16:01:42 +03:00
Alexander Tokmakov
b3ddc601a5 fix race between mergeSelectingTask and queue reinitialization 2022-01-28 15:50:58 +03:00
mergify[bot]
c9a1c9a896
Merge branch 'master' into system_on_cluster 2022-01-28 10:42:26 +00:00
tavplubix
277fe4e1c4
Merge pull request #34090 from ClickHouse/tavplubix-patch-1
Fix builds
2022-01-28 13:41:02 +03:00
tavplubix
b92958815a
Update LineReader.cpp 2022-01-28 13:38:36 +03:00
lgbo-ustc
c576393143 fixed code styles 2022-01-28 18:34:54 +08:00
alexey-milovidov
f6684dbc62
Merge pull request #32304 from devcrafter/deduplication_token_7461
insert_deduplication_token setting for INSERT statement
2022-01-28 13:03:55 +03:00
zhangxiao871
7b51e0b8b6 Better test 2022-01-28 18:00:52 +08:00
Vitaly Baranov
484743edff
Merge pull request #33201 from azat/client-interactive-suggest
Client interactive suggest (extract info from CREATE queries)
2022-01-28 16:30:16 +07:00
Kruglov Pavel
842de427d8
Merge pull request #33984 from Avogar/fix-orc
Fix segfault while parsing corrupted ORC file
2022-01-28 12:03:38 +03:00
Kruglov Pavel
efa8775ea6
Merge pull request #33960 from Avogar/autodetect-format
Detect format and schema from stdin in clickhouse-local
2022-01-28 12:02:15 +03:00
lgbo-ustc
f5ffdaac21 fixed code styles 2022-01-28 16:55:17 +08:00
Azat Khuzhin
42ddf4d2b8 Fix negative StorageBufferBytes by proper accounting of empty blocks
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-01-28 11:10:00 +03:00
Azat Khuzhin
d77790182d Tiny cleanup in StorageBuffer::flushBuffer()
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-01-28 11:10:00 +03:00
Azat Khuzhin
d621e63782 Update reference for 01881_total_bytes_storage_buffer
Since now Buffer does not store empty Block

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-01-28 11:10:00 +03:00
Azat Khuzhin
9948525816 Simplify different block sturcture (i.e. after ALTER) support for Buffer
v2: fix empty block in case of flush

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-01-28 11:09:56 +03:00
Azat Khuzhin
1fc29d704d Update documentation regardless ALTER for Buffer
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-01-28 11:07:57 +03:00
Nikolai Kochetov
94999e86c2
Merge pull request #33392 from azat/_shard_num
Replace old _shard_num implementation with shardNum() function
2022-01-28 11:02:19 +03:00
alexey-milovidov
510ec8803e
Merge pull request #34075 from azat/agg-func-cleanup
Tiny cleanup of AggregateFunctionSimpleState/AggregateFunctionState
2022-01-28 10:37:32 +03:00
alexey-milovidov
ad69f6c3df
Merge pull request #34072 from ramazanpolat/patch-3
Add commands to download clickhouse-diagnostics folder
2022-01-28 10:35:48 +03:00
cnmade
f469df6076 Fixed zh...statements/set: translate to zh and remove bak file 2022-01-28 15:32:11 +08:00
cnmade
438e0ab001 Fixed zh...statements/set: rename old file to bak 2022-01-28 15:25:52 +08:00
zhangxiao871
78e2794ada Fix START MERGES and add test 2022-01-28 14:30:57 +08:00
lgbo-ustc
7a3324b29a add expire() in PoolBase 2022-01-28 14:03:34 +08:00
Azat Khuzhin
bfef9663ca Tiny cleanup of AggregateFunctionSimpleState/AggregateFunctionState
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-01-28 08:10:08 +03:00
Azat Khuzhin
4e07122079 Slightly optimize ColumnArray::get()/operator[] (by using reserve over resize)
Note, that simple "SELECT range(100)" will execute
ColumnArray::operator[] 14 times (most of them from
DB::checkColumnStructure())

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-01-28 08:08:14 +03:00
Anton Popov
6c0959b907 fix asynchronous inserts with Native format 2022-01-28 03:25:15 +03:00
Ramazan Polat
bfc47e1dee
Add commands download clickhouse-diagnostics folder 2022-01-28 00:13:48 +03:00