Commit Graph

3760 Commits

Author SHA1 Message Date
alesapin
9881c60fdb Better comment 2020-07-20 16:45:18 +03:00
alesapin
b9a0d0802c Better code 2020-07-20 16:44:07 +03:00
alesapin
6b7d1033e6 Comments for ugly fix 2020-07-20 16:06:44 +03:00
alesapin
479048cf69 Ugly code without races 2020-07-20 15:34:29 +03:00
Alexander Kuzmenkov
232cd2648f
Merge pull request #12522 from ClickHouse/aku/std-logic-error
Abort on std::logic_error in debug builds
2020-07-20 14:50:03 +03:00
Alexander Kuzmenkov
40ee6eba19
Merge pull request #12545 from ClickHouse/fix_load_part_without_checksums
Fix loading parts without checksums
2020-07-20 14:40:53 +03:00
Anton Popov
d4783f8f19 fix lack of aliases with function 'any' 2020-07-20 12:04:03 +03:00
Vitaly Baranov
0b17595a91
Merge pull request #12423 from vitlibar/update-simdjson
Update simdjson
2020-07-20 10:15:38 +03:00
philip.han
11de86074f Use range-based for loop and remove redundant call to 'c_str' 2020-07-20 15:33:23 +09:00
Ivan Babrou
72622a9b00 Parallelize PK range and skipping index stages
This runs PK lookup and skipping index stages on parts
in parallel, as described in #11564.

While #12277 sped up PK lookups, skipping index stage
may still be a bottleneck in a select query. Here we
parallelize both stages between parts.

On a query that uses a bloom filter skipping index to pick
2,688 rows out of 8,273,114,994 on a two day time span,
this change reduces latency from 10.5s to 1.5s.
2020-07-19 21:49:41 -07:00
Alexey Milovidov
10355a2850 Make behaviour of remainder of division for floating point numbers compatible with most of DBMS #7323 2020-07-20 04:03:46 +03:00
philip.han
5e2d361dc8 Remove std::move 2020-07-20 00:12:58 +09:00
Vitaly Baranov
61e43c3ef9 Make conversion std::string_view => StringRef explicit. 2020-07-19 12:50:24 +03:00
Vitaly Baranov
8bcaf7908e Rework JSON functions to use the new simdjson interface. 2020-07-19 12:50:19 +03:00
alexey-milovidov
7aee5abb83
Merge pull request #12569 from ClickHouse/aku/numa-metric
Add perf metric for NUMA-local memory access
2020-07-19 03:21:24 +03:00
alexey-milovidov
504783fe2b
Update ProfileEvents.cpp 2020-07-19 03:20:45 +03:00
Alexander Kuzmenkov
5a662ca48c Add perf metric for NUMA-local memory access 2020-07-17 20:10:59 +03:00
tavplubix
5634482393
Merge pull request #12556 from azat/distributed-remove-files-on-drop
Remove data for Distributed tables (blocks from async INSERTs) on DROP TABLE
2020-07-17 19:29:57 +03:00
Alexander Kuzmenkov
a4a23673cc fixup 2020-07-17 17:25:13 +03:00
Alexander Kuzmenkov
4089f761e1 fix one out_of_range 2020-07-17 17:20:33 +03:00
Alexander Kuzmenkov
fb7743d8f5 Merge remote-tracking branch 'origin/master' into HEAD 2020-07-17 16:19:05 +03:00
philip.han
cdd7755484 Remove unused code 2020-07-17 22:05:17 +09:00
philip.han
8e8af83b15 Fix style 2020-07-17 21:08:08 +09:00
philip.han
3554e6c36a Replace vector with PODArray and add testcases 2020-07-17 21:06:29 +09:00
Alexander Kuzmenkov
aa54101c21
Merge pull request #12553 from ClickHouse/aku/fuzzer-fixes
Minor fixes for query fuzzer
2020-07-17 14:52:32 +03:00
alexey-milovidov
51f539d3fb
Merge pull request #12480 from azat/fix-SETTINGS-parse-after-FORMAT
[RFC] Fix SETTINGS parse after FORMAT
2020-07-17 14:11:24 +03:00
alexey-milovidov
9fb40a3f7b
Merge pull request #12386 from fastio/master
COS (Tencent Cloud Object Storage) integration
2020-07-17 14:09:16 +03:00
alexey-milovidov
f3db2f3c3d
Update S3Common.cpp 2020-07-17 14:07:26 +03:00
alexey-milovidov
0f6599c9e5
Merge pull request #12541 from BohuTANG/mysql_explain
Fix EXPLAIN format for MySQL client
2020-07-17 14:04:01 +03:00
Artem Zuikov
c6e3e9b1ff
String convertion to enum in if() and transform() (#12515) 2020-07-17 12:28:51 +03:00
philip.han
769a6dfb08 bayseAB returns an empty block if input_rows_count is 0 and isDeterministic returns false 2020-07-17 18:21:25 +09:00
philip.han
d4aff270db Fix the formula of gamma and the method of argument parsing 2020-07-17 17:52:51 +09:00
alesapin
ac802a8e96
Merge pull request #12543 from ClickHouse/fix_marks_type_on_mutation
Fix incorrect adaptive granularity by default
2020-07-17 11:09:54 +03:00
Vitaly Baranov
4cc101f1d4 Fix build scripts. 2020-07-17 10:30:13 +03:00
philip.han
36feefb429 Replace ABTestResult with Variants 2020-07-17 16:23:24 +09:00
Azat Khuzhin
6ea1b19476 Remove data for Distributed tables (blocks from async INSERTs) on DROP TABLE 2020-07-17 08:59:57 +03:00
Peng Jian
2fc58e8f10 Fix code sytle check & build check 2020-07-17 11:33:29 +08:00
Azat Khuzhin
781f1597f2 Fix SETTINGS parsing after FORMAT for SELECT queries
There are two possible ways to pass the SETTINGS clause:

  - SELECT 1 FORMAT Null SETTINGS max_block_size = 1
  - SELECT 1 SETTINGS max_block_size = 1[ FORMAT Null]

And when the SETTINGS goes after FORMAT it is parsed in
ParserQueryWithOutput, and these settings are not applied for the query
from the ASTSelectQuery::initSettings()

So propagate settings from the ParserQueryWithOutput to the
ASTSelectQuery settings.
2020-07-17 00:28:52 +03:00
alexey-milovidov
fde8c87a1f
Merge pull request #12426 from ClickHouse/log-engine-rollback-on-insert-error
Rollback insertion error in Log engines
2020-07-16 22:50:48 +03:00
Alexander Kuzmenkov
039cf36acb Minor fixes for query fuzzer 2020-07-16 21:05:34 +03:00
Anton Popov
97e8a88b30
Merge pull request #12277 from bobrik/ivan/exact-range-speedup
WIP: Optimize PK lookup for queries that match exact PK range
2020-07-16 19:17:50 +03:00
alesapin
21d3a79794 Fix arcadia build for msgpack 2020-07-16 14:08:26 +03:00
alesapin
b3ec3b1ed1 Fix loading parts without checksums 2020-07-16 13:54:49 +03:00
Nikita Mikhaylov
1bef33f04f
Merge pull request #12452 from ClickHouse/system-log-dont-log-under-mutex
SystemLog: do not log under mutex
2020-07-16 14:44:28 +04:00
Vitaly Baranov
000b197ad1
Merge pull request #11234 from traceon/ldap-per-user-authentication
Add LDAP authentication support
2020-07-16 13:17:21 +03:00
alesapin
42983c5416 Fix incorrect adaptive granularity by default 2020-07-16 12:10:15 +03:00
Artem Zuikov
ff372ec0f0
Standard join type syntax position (#12520) 2020-07-16 11:56:45 +03:00
Alexey Milovidov
6df282e813 Fixup 2020-07-16 11:33:51 +03:00
BohuTANG
bae11968de Fix EXPLAIN format for MySQL/PG client #12432 2020-07-16 16:29:17 +08:00
alesapin
f7792d0145
Merge pull request #12294 from ClickHouse/fasttest
Add image for fast tests run (with clone, build, etc.)
2020-07-16 11:21:53 +03:00
alexey-milovidov
8966c09ed6
Merge pull request #12519 from vzakaznikov/fix_data_duplication_and_tests_for_live_view
Fixing race condition in live view tables which could cause data duplication and live view tests
2020-07-16 11:03:28 +03:00
alexey-milovidov
6e9af5f179
Merge pull request #12529 from CurtizJ/fix-12521
Better exception for function 'in' with invalid number of arguments
2020-07-16 11:01:55 +03:00
alexey-milovidov
47e41b82b6
Merge pull request #12505 from ClickHouse/testkeeper-improve-performance
Improve performance of TestKeeper
2020-07-16 10:51:01 +03:00
Alexey Milovidov
68f9fd3767 Debug tests 2020-07-16 06:02:20 +03:00
Alexey Milovidov
82ea884d01 Fix incorrect unit test 2020-07-16 05:37:12 +03:00
Alexey Milovidov
a6016b95ce Fix clang-tidy 2020-07-16 05:34:43 +03:00
Alexey Milovidov
3408b7e259 Merge branch 'master' into log-engine-rollback-on-insert-error 2020-07-16 05:34:02 +03:00
Alexey Milovidov
83b2db4e5b Fixup 2020-07-16 05:09:02 +03:00
Alexey Milovidov
d75d982da9 Merge branch 'master' into fix-avg-serialization 2020-07-16 05:02:10 +03:00
Alexey Milovidov
e1173bc3f7 Fixup 2020-07-16 05:00:21 +03:00
Alexey Milovidov
1bf679703d Merge branch 'master' into testkeeper-improve-performance 2020-07-16 04:58:35 +03:00
Denis Glazachev
59cb758cf7 Merge branch 'master' into ldap-per-user-authentication 2020-07-16 02:29:24 +04:00
Nikita Mikhaylov
02c49b9d7f better 2020-07-15 22:10:36 +00:00
Nikita Mikhaylov
22e0015782 fix arcadia 2020-07-15 21:28:01 +00:00
alesapin
e35c49faa2 Merge branch 'master' into fasttest 2020-07-15 22:35:46 +03:00
Alexander Kuzmenkov
f785837b1d
Merge pull request #12518 from ClickHouse/aku/android
Some provisions for Android build
2020-07-15 22:05:41 +03:00
Alexey Milovidov
d380ff83e2 Merge branch 'master' into testkeeper-improve-performance 2020-07-15 19:38:06 +03:00
Alexey Milovidov
e1e2204279 Whitespace 2020-07-15 19:37:52 +03:00
Nikita Mikhaylov
ed05465479 Merge branch 'master' of github.com:ClickHouse/ClickHouse into achimbab-bayesAB 2020-07-15 16:34:56 +00:00
Nikita Mikhaylov
1a8811bd47 fix tidy build 2020-07-15 16:34:08 +00:00
alexey-milovidov
e7cf3f4e70
Merge pull request #12464 from ianton-ru/s3_profile_events
add profiling events from S3 request to system.events and system.quer…
2020-07-15 19:33:15 +03:00
Anton Popov
de7b0c2424 better exception for function 'in' with invalid number of arguments 2020-07-15 17:25:09 +03:00
Vitaliy Zakaznikov
370dd3396b Fixing clang build. 2020-07-15 16:18:53 +02:00
Vladimir Chebotarev
ed4da4bec6
Separated AWSAuthV4Signer into different logger, removed "AWSClient: AWSClient" (#12320) 2020-07-15 17:16:45 +03:00
Alexander Kuzmenkov
9d728d60d0 Abort on std::logic_error in debug builds
This helps notice them in tests, same as assert() and LOGICAL_ERROR.
2020-07-15 15:08:01 +03:00
Anton Popov
c6423b2b28 lower read buffer size, while reading from compact parts 2020-07-15 14:53:23 +03:00
Vitaliy Zakaznikov
560151f6cd * Fix bug in StorageLiveView.cpp
* Fixing synchronization of the first insert in live view tests
2020-07-15 13:24:33 +02:00
Anton Ivashkin
4c8498c115 Merge master 2020-07-15 14:16:10 +03:00
Alexander Kuzmenkov
3e6b9f297f Some provisions for Android build 2020-07-15 14:16:00 +03:00
Anton Ivashkin
fbd80e8d67 Fix codestyle 2020-07-15 14:15:12 +03:00
Artem Zuikov
5f01a587f6
Optimize monotonous ORDER BY (#12467) 2020-07-15 13:10:21 +03:00
alesapin
614540eddf
Merge pull request #12382 from ClickHouse/clear-all-columns
Better errors for CLEAR/DROP columns (possibly in partitions)
2020-07-15 12:52:06 +03:00
alesapin
00d2219808 Merge branch 'master' into fasttest 2020-07-15 11:35:15 +03:00
alexey-milovidov
9c68124110
Merge pull request #12302 from azat/kafka-error-in-the-batch-SIGSEGV
kafka: fix SIGSEGV if there is a message with error in the middle of the batch
2020-07-15 05:20:26 +03:00
Amos Bird
6017a33722
Fix 2020-07-15 10:20:05 +08:00
alexey-milovidov
156be5e270
Update HashJoin.cpp 2020-07-15 10:19:50 +08:00
Amos Bird
46c2bb57ec
Refactor joinGet and implement multi-key lookup. 2020-07-15 10:12:04 +08:00
Nikita Mikhaylov
4d10ac9b1a
trigger ci 2020-07-15 02:25:59 +03:00
Alexey Milovidov
b665413869 Improve performance of TestKeeper 2020-07-15 01:53:34 +03:00
tavplubix
7a5fb2dade
Merge pull request #12466 from ClickHouse/aku/fuzzer-fixes
Fuzzing-related fixes
2020-07-14 22:56:57 +03:00
Artem Zuikov
e8057387cb
Fix crash in 'JOIN dict ON expr(dict_key) = k' (#12458) 2020-07-14 17:06:11 +03:00
alesapin
9e41fbca55 Remove check for drop detached partition 2020-07-14 16:56:30 +03:00
Anton Ivashkin
52fea6a5a3 Merge master 2020-07-14 15:56:38 +03:00
Alexander Kuzmenkov
b515dd5b83 Merge remote-tracking branch 'origin/master' into HEAD 2020-07-14 15:40:27 +03:00
Alexander Kuzmenkov
b24f727aea typo 2020-07-14 15:40:18 +03:00
Anton Ivashkin
527d33aa2b Fix gcc build, fix codestyle 2020-07-14 15:26:22 +03:00
alesapin
0740b88d6b Merge branch 'master' into fasttest 2020-07-14 15:19:05 +03:00
feng lv
767bc7a905 add doc
fix test

fix

name style fix
2020-07-14 18:50:51 +08:00
Artem Zuikov
dda2510208
Try enable multiple_joins_rewriter_version v2 by default (#12469) 2020-07-14 12:34:47 +03:00
Alexey Milovidov
cb0b74af86 Fix AggregateFunctionAvg serialization backwards compatibility 2020-07-14 11:56:01 +03:00
alexey-milovidov
a45d9bba35
Merge pull request #12434 from excitoon-favorites/s3read
`min_bytes_for_seek` setting for `DiskS3`
2020-07-14 11:26:09 +03:00
alesapin
014bb070ec Fix tests 2020-07-14 11:19:39 +03:00
alexey-milovidov
fd4adf27d6
Merge pull request #12456 from CurtizJ/fix-12437
Fix #12437
2020-07-14 09:28:31 +03:00
alexey-milovidov
96fc213aeb
Merge pull request #12475 from georgthegreat/patch-1
Update ya.make
2020-07-14 09:24:09 +03:00
alexey-milovidov
7e679b731d
Merge pull request #12477 from azat/arrow-deprecated-fixes
arrow deprecated API usage build fixes
2020-07-14 09:23:52 +03:00
feng lv
f0b423e928 add test
style fix
2020-07-14 14:16:47 +08:00
feng lv
dffdb6e9e9 add FROM_UNIXTIME function 2020-07-14 14:04:37 +08:00
alexey-milovidov
1893d89ce3
Merge pull request #12448 from ClickHouse/fix-trash-rabbitmq
Fix trash from RabbitMQ
2020-07-14 01:11:37 +03:00
Azat Khuzhin
4ec5e79ade Do not suppress -Wdeprecated* for arrow 2020-07-13 21:25:51 +03:00
Azat Khuzhin
5f6fdb89bb Fix arrow deprecated API usage
And also use fmt-style for exceptions
2020-07-13 21:25:49 +03:00
alesapin
1f576ee039 Some intermediate solution 2020-07-13 20:27:52 +03:00
Alexey Milovidov
6edf43d112 Fix build 2020-07-13 19:51:37 +03:00
Alexey Milovidov
cb46bca157 Merge branch 'master' into fix-trash-rabbitmq 2020-07-13 19:51:17 +03:00
tavplubix
3314a97b99
Merge pull request #12009 from hczhcz/patch-0628
Allow TabSeparatedRaw as an input format
2020-07-13 19:43:31 +03:00
Yuriy Chernyshov
0d057afaad
Update ya.make
Works around https://github.com/protocolbuffers/protobuf/issues/7681
2020-07-13 19:21:51 +03:00
alesapin
4a53264a86 Remove redundant and duplicated code 2020-07-13 19:19:08 +03:00
robot-clickhouse
0f23642a3d Auto version update to [20.7.1.1] [54437] 2020-07-13 18:26:03 +03:00
Alexander Kuzmenkov
c6ab1f61dc
Merge pull request #12427 from ClickHouse/fix-limit-overflow
Avoid overflow in LIMIT #10470 #11372
2020-07-13 18:20:21 +03:00
Peng Jian
7579d65ebc Registering StorageS3 and TableFunctionS3 under two different names (S3 and COSN). 2020-07-13 22:13:30 +08:00
Alexander Kuzmenkov
d6e7ab5988 Fuzzing-related fixes 2020-07-13 16:58:48 +03:00
Denis Glazachev
f787702922 Merge branch 'master' into ldap-per-user-authentication
* master: (27 commits)
  Whitespaces
  Fix typo
  Fix UBSan report in base64
  Correct default secure port for clickhouse-benchmark #11044
  Remove test with bug #10697
  Update in-functions.md (#12430)
  Allow nullable key in MergeTree
  Update arithmetic-functions.md
  [docs] add rabbitmq docs (#12326)
  Lower block sizes and look what will happen #9248
  Fix lifetime_bytes/lifetime_rows for Buffer direct block write
  Retrigger CI
  Fix up  test_mysql_protocol failed
  Implement lifetime_rows/lifetime_bytes for Buffer engine
  Add comment regarding proxy tunnel usage in PocoHTTPClient.cpp
  Add lifetime_rows/lifetime_bytes interface (exported via system.tables)
  Tiny IStorage refactoring
  Trigger integration-test-runner image rebuild.
  Delete log.txt
  Fix test_mysql_client/test_python_client error
  ...
2020-07-13 15:46:27 +04:00
Artem Zuikov
b5c181c24e
Optimize redundant functions in ORDER BY (#12404) 2020-07-13 13:34:25 +03:00
Anton Popov
a9530d2883 in-memory parts: fix reading from nested 2020-07-13 12:10:55 +03:00
Anton Ivashkin
26fca949bd add profiling events from S3 request to system.events and system.query_log 2020-07-13 11:27:11 +03:00
Alexey Milovidov
dac5e1ce4d SystemLog: do not log under mutex 2020-07-13 08:24:55 +03:00
hcz
3683891ebc Fix TSVRaw on long text 2020-07-13 12:51:43 +08:00
Vladimir Chebotarev
820e95ae3c Added comments. 2020-07-13 07:15:37 +03:00
alexey-milovidov
7108f88de5
Merge pull request #12424 from ClickHouse/lower-default-block-size
Lower block sizes and look what will happen
2020-07-13 05:32:25 +03:00
alexey-milovidov
ae7eff98ed
Merge pull request #12433 from amosbird/np
Allow nullable key in MergeTree
2020-07-13 04:36:00 +03:00
Alexey Milovidov
8f2055b0a0 Fix trash from RabbitMQ 2020-07-13 04:11:48 +03:00
Alexey Milovidov
5afe441324 Whitespaces 2020-07-13 03:45:42 +03:00
Vladimir Chebotarev
ffde5f137b Minor fixes. 2020-07-13 03:27:51 +03:00
Vladimir Chebotarev
a479a20ba4 Review fixes. 2020-07-13 03:24:49 +03:00
Vladimir Chebotarev
d3ade3492e
Update DiskS3.h 2020-07-13 03:09:37 +03:00
alexey-milovidov
c6a5b77843
Update registerDiskS3.cpp 2020-07-13 03:04:46 +03:00
Alexey Milovidov
a79a94cd60 Fix build 2020-07-13 02:53:13 +03:00
Vladimir Chebotarev
4802a785b5 Added read_seek_threshold setting to DiskS3. 2020-07-13 02:51:25 +03:00
Vladimir Chebotarev
67f9d8124b Attempt to implement streaming optimization in DiskS3. 2020-07-13 02:47:22 +03:00
Vladimir Chebotarev
718523b0ee Working wrapper. 2020-07-13 02:47:22 +03:00
Alexey Milovidov
eb2ec74709 Fix comment 2020-07-13 01:32:24 +03:00
Alexey Milovidov
ab683860c9 Remove debug output 2020-07-13 01:31:08 +03:00
Alexey Milovidov
8f0ec09372 Fix error; add a test 2020-07-13 01:23:21 +03:00
Alexey Milovidov
8991192ddb Improved comment 2020-07-13 00:45:23 +03:00
Alexey Milovidov
7407a08750 Fix error 2020-07-13 00:44:27 +03:00
Alexey Milovidov
36de452fdd Merge branch 'master' into fix-limit-overflow 2020-07-13 00:24:24 +03:00
Alexey Milovidov
5ef8d49ebe Fix typo 2020-07-12 23:02:51 +03:00
tavplubix
d64e51d1a7
Merge pull request #12421 from azat/lifetime-table-metrics
lifetime_rows/lifetime_bytes for Buffer engine
2020-07-12 19:00:02 +03:00
Amos Bird
cac5a89169
Allow nullable key in MergeTree 2020-07-12 22:21:51 +08:00
Alexey Milovidov
49f60ef3a4 Fix build 2020-07-12 08:26:33 +03:00
Alexey Milovidov
ef930df484 Avoid overflow in LIMIT #10470 #11372 2020-07-12 08:18:01 +03:00
Alexey Milovidov
204a4af394 Rollback insertion error in Log engines #12402 2020-07-12 05:32:18 +03:00
Ivan Babrou
8784994d65 Allow conditions outside of PK with exact range
Conditions that are outside of PK are marked as `unknown` in `KeyCondition`,
so it's safe to allow them, as long as they are always combined by `AND`.
2020-07-11 18:59:26 -07:00
Alexey Milovidov
bc8e7e04df Lower block sizes and look what will happen #9248 2020-07-12 04:05:09 +03:00
alexey-milovidov
26d32f2ce5
Merge pull request #12412 from Jokser/s3-https
S3 HTTPS integration tests
2020-07-12 03:36:37 +03:00
Azat Khuzhin
3bee98c6f0 Fix lifetime_bytes/lifetime_rows for Buffer direct block write 2020-07-12 01:16:05 +03:00
alexey-milovidov
160dcf715d
Merge pull request #12383 from BohuTANG/mysql_write_through_poco_exception
Write through Poco::Exception exception to MySQL protocol client
2020-07-11 23:56:22 +03:00
alexey-milovidov
b1b4f8832d
Merge pull request #12397 from myrrc/bug/part-dict-update
Resolve #12098
2020-07-11 23:07:00 +03:00
Ivan Babrou
d9d8d0242e Optimize PK lookup for queries that match exact PK range
Existing code that looks up marks that match the query has a pathological
case, when most of the part does in fact match the query.

The code works by recursively splitting a part into ranges and then discarding
the ranges that definitely do not match the query, based on primary key.

The problem is that it requires visiting every mark that matches the query,
making the complexity of this sort of look up O(n).

For queries that match exact range on the primary key, we can find
both left and right parts of the range with O(log 2) complexity.

This change implements exactly that.

To engage this optimization, the query must:

* Have a prefix list of the primary key.
* Have only range or single set element constraints for columns.
* Have only AND as a boolean operator.

Consider a table with `(service, timestamp)` as the primary key.

The following conditions will be optimized:

* `service = 'foo'`
* `service = 'foo' and timestamp >= now() - 3600`
* `service in ('foo')`
* `service in ('foo') and timestamp >= now() - 3600 and timestamp <= now`

The following will fall back to previous lookup algorithm:

* `timestamp >= now() - 3600`
* `service in ('foo', 'bar') and timestamp >= now() - 3600`
* `service = 'foo'`

Note that the optimization won't engage when PK has a range expression
followed by a point expression, since in that case the range is not continuous.

Trace query logging provides the following messages types of messages,
each representing a different kind of PK usage for a part:

```
Used optimized inclusion search over index for part 20200711_5710108_5710108_0 with 9 steps
Used generic exclusion search over index for part 20200711_5710118_5710228_5 with 1495 steps
Not using index on part 20200710_5710473_5710473_0
```

Number of steps translates to computational complexity.

Here's a comparison for before and after for a query over 24h of data:

```
Read 4562944 rows, 148.05 MiB in 45.19249672 sec.,   100966 rows/sec.,   3.28 MiB/sec.
Read 4183040 rows, 135.78 MiB in 0.196279627 sec., 21311636 rows/sec., 691.75 MiB/sec.
```

This is especially useful for queries that read data in order
and terminate early to return "last X things" matching a query.

See #11564 for more thoughts on this.
2020-07-11 12:26:54 -07:00
Denis Glazachev
b68d7b6c24
Merge branch 'master' into ldap-per-user-authentication 2020-07-11 21:37:52 +04:00
Denis Glazachev
edb6ef8c09 Merge commit 'ceac649c01b0158090cd271776f3219f5e7ff57c' into ldap-per-user-authentication
* commit 'ceac649c01b0158090cd271776f3219f5e7ff57c': (75 commits)
  [docs] split misc statements (#12403)
  Update 00405_pretty_formats.reference
  Update PrettyCompactBlockOutputFormat.cpp
  Update PrettyBlockOutputFormat.cpp
  Update DataTypeNullable.cpp
  Update 01383_remote_ambiguous_column_shard.sql
  add output_format_pretty_grid_charset setting in docs
  add setting output_format_pretty_grid_charset
  Added a test for #11135
  Update index.md
  RIGHT and FULL JOIN for MergeJoin (#12118)
  Update MergeTreeIndexFullText.cpp
  restart the tests
  [docs] add syntax highlight (#12398)
  query fuzzer
  Fix std::bad_typeid when JSON functions called with argument of wrong type.
  Allow typeid_cast() to cast nullptr to nullptr.
  fix another context-related segfault
  [security docs] actually, only admins can create advisories
  query fuzzer
  ...
2020-07-11 21:32:36 +04:00
Denis Glazachev
2a3a0d47b3 Style fix 2020-07-11 21:31:00 +04:00
Denis Glazachev
3e68368b59 Refactor ExternalAuthenticators configuration process 2020-07-11 21:06:01 +04:00
Vitaly Baranov
fe6122a1dd
Merge pull request #12394 from vitlibar/fix-calculating-implicit-access-rights
Fix calculating implicit access rights
2020-07-11 19:31:56 +03:00
Pavel Kovalenko
d3fa78392e Retrigger CI 2020-07-11 18:35:51 +03:00
Azat Khuzhin
32a45d0dee Implement lifetime_rows/lifetime_bytes for Buffer engine
Buffer engine is usually used on INSERTs, but right now there is no way
to track number of INSERTed rows per-table, since only summary metrics
exists:
- StorageBufferRows
- StorageBufferBytes

But it can be pretty useful to track INSERTed rows rate (and it can be
exposed via http_handlers for i.e. prometheus)
2020-07-11 16:06:11 +03:00
Pavel Kovalenko
8b5f8c592f Add comment regarding proxy tunnel usage in PocoHTTPClient.cpp 2020-07-11 15:43:30 +03:00
Azat Khuzhin
433fdffc19 Add lifetime_rows/lifetime_bytes interface (exported via system.tables) 2020-07-11 15:33:11 +03:00
Azat Khuzhin
84c93a6b02 Tiny IStorage refactoring 2020-07-11 15:17:06 +03:00
Alexander Kuzmenkov
10b0287fa4
Merge pull request #12341 from ClickHouse/aku/perfect-visitor
More perfect forwarding in field visitors
2020-07-11 13:36:37 +03:00
alexey-milovidov
c615ea658b
Merge pull request #12400 from vitlibar/fix-bad_typeid
Fix std::bad_typeid when JSON functions called with argument of wrong type
2020-07-11 05:40:44 +03:00
alexey-milovidov
7bc2c83b80
Merge pull request #12372 from s-mx/issue-10429-add_setting_for_ascii_grid_symbols
add setting for ascii grid symbols
2020-07-11 05:31:41 +03:00
Denis Glazachev
af98e74afd Gracefully handle the case when ExternalAuthenticators instance is not created (yet) 2020-07-11 02:42:48 +04:00
alexey-milovidov
4b2da605da
Update PrettyCompactBlockOutputFormat.cpp 2020-07-11 00:32:21 +03:00
alexey-milovidov
ca0591320d
Update PrettyBlockOutputFormat.cpp 2020-07-11 00:31:25 +03:00
alexey-milovidov
88e9003c35
Update DataTypeNullable.cpp 2020-07-11 00:29:07 +03:00
alexey-milovidov
7c2bd32c9c
Merge pull request #12401 from ClickHouse/fix_segfault_in_storage_merge
Fix another Context-related segfault
2020-07-11 00:19:00 +03:00
Pavel Kovalenko
f43428a4d5 S3 HTTPS integration test. 2020-07-10 22:42:18 +03:00
alesapin
d2fcbe1f4e Fix build 2020-07-10 22:27:12 +03:00
Maxim Sabyanin
40f7ec71d3 add setting output_format_pretty_grid_charset
This setting allows to chose charset for printing grids (either UTF-8 or
ASCII).
2020-07-10 22:25:49 +03:00
alesapin
a9824fd650 Better cmake and less libraries 2020-07-10 22:08:18 +03:00
alesapin
df176c633e Disable msgpack 2020-07-10 21:27:10 +03:00
Artem Zuikov
6b26842ce5
RIGHT and FULL JOIN for MergeJoin (#12118) 2020-07-10 21:10:06 +03:00
alexey-milovidov
ef41ef3162
Update MySQLHandler.cpp 2020-07-10 21:03:12 +03:00
alexey-milovidov
e22547c29d
Merge pull request #12388 from ClickHouse/bloom-filter-arg-check
Check arguments of bloom filter index
2020-07-10 20:54:16 +03:00
alexey-milovidov
caef1d8e24
Update MergeTreeIndexFullText.cpp 2020-07-10 20:53:58 +03:00
alexey-milovidov
2d9e0ec049
Merge pull request #12376 from ClickHouse/fix-totals-state-2
Fix TOTALS/ROLLUP/CUBE for aggregate functions with -State and Nullable arguments
2020-07-10 20:18:48 +03:00
alexey-milovidov
d819624d7c
Merge pull request #12378 from ClickHouse/allow-clear-column-with-dependencies
Allow to CLEAR column even if there are depending DEFAULT expressions
2020-07-10 20:18:14 +03:00
alexey-milovidov
031c773260
Merge pull request #12384 from ClickHouse/support-negative-float-constants-in-key-condition
Avoid exception when negative or floating point constant is used in WHERE condition for indexed tables
2020-07-10 20:16:35 +03:00
Vitaly Baranov
30e3d61b01 Fix calculating implicit access rights. 2020-07-10 17:16:43 +03:00
Vitaly Baranov
94c858b2dc Fix std::bad_typeid when JSON functions called with argument of wrong type. 2020-07-10 17:12:57 +03:00
Vitaly Baranov
3a0d358694 Allow typeid_cast() to cast nullptr to nullptr. 2020-07-10 17:02:48 +03:00
Alexander Tokmakov
20d95a21fc fix another context-related segfault 2020-07-10 17:00:44 +03:00
myrrc
cfe06a3b2f fix: #12098 2020-07-10 16:06:41 +03:00
Artem Zuikov
01b5c2663c
Delete injective functions inside uniq (#12337) 2020-07-10 13:42:41 +03:00
BohuTANG
86590d4aca Change the exception catch to the generic way 2020-07-10 17:18:00 +08:00
Azat Khuzhin
610382b693 kafka: fix SIGSEGV if there is an message with error in the middle of the batch
ReadBufferFromKafkaConsumer does not handle the case when there is
message with an error on non first position in the current batch, since
it goes through messages in the batch after poll and stop on first valid
message.

But later it can try to use message as valid:
- while storing offset
- get topic name
- ...

And besides the message itself is also invalid (you can find this in the
gdb traces below).

So just filter out messages win an error error after poll.

SIGSEGV was with the following stacktrace:
    (gdb) bt
    3  0x0000000010f05b4d in rd_kafka_offset_store (app_rkt=0x0, partition=0, offset=0) at ../contrib/librdkafka/src/rdkafka_offset.c:656
    4  0x0000000010e69657 in cppkafka::Consumer::store_offset (this=0x7f2015210820, msg=...) at ../contrib/cppkafka/include/cppkafka/message.h:225
    5  0x000000000e68f208 in DB::ReadBufferFromKafkaConsumer::storeLastReadMessageOffset (this=0x7f206a136618) at ../contrib/libcxx/include/iterator:1508
    6  0x000000000e68b207 in DB::KafkaBlockInputStream::readImpl (this=0x7f202c689020) at ../src/Storages/Kafka/KafkaBlockInputStream.cpp:150
    7  0x000000000dd1178d in DB::IBlockInputStream::read (this=this@entry=0x7f202c689020) at ../src/DataStreams/IBlockInputStream.cpp:60
    8  0x000000000dd34c0a in DB::copyDataImpl<> () at ../src/DataStreams/copyData.cpp:21
    9  DB::copyData () at ../src/DataStreams/copyData.cpp:62
    10 0x000000000e67c8f2 in DB::StorageKafka::streamToViews () at ../contrib/libcxx/include/memory:3823
    11 0x000000000e67d218 in DB::StorageKafka::threadFunc () at ../src/Storages/Kafka/StorageKafka.cpp:488

And some information from it:

    (gdb) p this.current.__i
    $14 = (std::__1::__wrap_iter<cppkafka::Message const*>::iterator_type) 0x7f1ca8f58660

    # current-1
    (gdb) p $14-1
    $15 = (const cppkafka::Message *) 0x7f1ca8f58600
    (gdb) p $16.handle_
    $17 = {__ptr_ = {<std::__1::__compressed_pair_elem<rd_kafka_message_s*, 0, false>> = { __value_ = 0x7f203577f938}, ...}
    (gdb) p *(rd_kafka_message_s*)0x7f203577f938
    $24 = {err = RD_KAFKA_RESP_ERR__TRANSPORT, rkt = 0x0, partition = 0, payload = 0x7f202f0339c0, len = 63, key = 0x0, key_len = 0, offset = 0, _private = 0x7f203577f8c0}

    # current
    (gdb) p $14-0
    $28 = (const cppkafka::Message *) 0x7f1ca8f58660
    (gdb) p $28.handle_.__ptr_
    $29 = {<std::__1::__compressed_pair_elem<rd_kafka_message_s*, 0, false>> = { __value_ = 0x7f184f129bf0}, ...}
    (gdb) p *(rd_kafka_message_s*)0x7f184f129bf0
    $30 = {err = RD_KAFKA_RESP_ERR_NO_ERROR, rkt = 0x7f1ed44fe000, partition = 1, payload = 0x7f1fc9bc6036, len = 242, key = 0x0, key_len = 0, offset = 2394853582209,

    # current+1
    (gdb) p (*($14+1)).handle_.__ptr_
    $44 = {<std::__1::__compressed_pair_elem<rd_kafka_message_s*, 0, false>> = { __value_ = 0x7f184f129d30}, ...}
    (gdb) p *(rd_kafka_message_s*)0x7f184f129d30
    $45 = {err = RD_KAFKA_RESP_ERR_NO_ERROR, rkt = 0x7f1ed44fe000, partition = 1, payload = 0x7f1fc9bc612f, len = 31, key = 0x0, key_len = 0, offset = 2394853582210,
      _private = 0x7f184f129cc0}

    # distance from the beginning
    (gdb) p messages.__end_-messages.__begin_
    $34 = 65536
    (gdb) p ($14-0)-messages.__begin_
    $37 = 8965
    (gdb) p ($14-1)-messages.__begin_
    $38 = 8964

    # parsing info
    (gdb) p allowed
    $39 = false
    (gdb) p new_rows
    $40 = 1
    (gdb) p total_rows
    $41 = 8964

    # current buffer is invalid
    (gdb) p *buffer.__ptr_
    $50 = {<DB::ReadBuffer> = {<DB::BufferBase> = {pos = 0x7f202f0339c0 "FindCoordinator response error: Local: Broker transport failure", bytes = 47904863385, working_buffer = {
            begin_pos = 0x7f202f0339c0 "FindCoordinator response error: Local: Broker transport failure",
            end_pos = 0x7f202f0339c0 "FindCoordinator response error: Local: Broker transport failure"}, internal_buffer = {

v0: check message errors in ReadBufferFromKafkaConsumer::nextImpl() (but
this may lead to using of that messages after and SIGSEGV again, doh).
v2: skip messages with an error after poll.
2020-07-10 11:41:44 +03:00
Alexey Milovidov
47eaffbe63 Additional checks 2020-07-10 11:21:40 +03:00
Alexey Milovidov
4b86f36d37 Check arguments of bloom filter index 2020-07-10 11:13:21 +03:00
alesapin
5cae87e664
Merge pull request #12335 from ClickHouse/fix_alter_exit_codes
Fix alter rename error messages
2020-07-10 11:05:20 +03:00
Peng Jian
958bb1f3aa COS (Tencent Cloud Object Storage) integration
To allow import and export to COS.
2020-07-10 15:26:55 +08:00