Azat Khuzhin
0b47f4a9e9
Fix optimize_trivial_count_query with partition predicate
...
Consider the following example:
CREATE TABLE test(p DateTime, k int) ENGINE MergeTree PARTITION BY toDate(p) ORDER BY k;
INSERT INTO test VALUES ('2020-09-01 00:01:02', 1), ('2020-09-01 20:01:03', 2), ('2020-09-02 00:01:03', 3);
- SELECT count() FROM test WHERE toDate(p) >= '2020-09-01' AND p <= '2020-09-01 00:00:00'
In this case rpn will be (FUNCTION_IN_RANGE, FUNCTION_UNKNOWN (due to strict), FUNCTION_AND)
and for optimize_trivial_count_query we cannot use index if there is at least one FUNCTION_UNKNOWN.
since there is no post processing and return count() based on only the first predicate is wrong.
Before this patch FUNCTION_UNKNOWN was allowed for optimize_trivial_count_query, and the result was wrong.
And two examples above just to show the difference, the behaviour hadn't been changed with this patch:
- SELECT * FROM test WHERE toDate(p) >= '2020-09-01' AND p <= '2020-09-01 00:00:00'
In this case will be (FUNCTION_IN_RANGE, FUNCTION_IN_RANGE (due to non-strict), FUNCTION_AND)
so it will prune everything out and nothing will be read.
- SELECT * FROM test WHERE toDate(p) >= '2020-09-01' AND toUnixTimestamp(p)%5==0
In this case will be (FUNCTION_IN_RANGE, FUNCTION_UNKNOWN, FUNCTION_AND)
and all, two, partitions will be scanned, but due to filtering later none of rows will be matched.
2020-11-25 23:09:17 +03:00
Azat Khuzhin
32f69dc76f
Cleanup 01505_trivial_count_with_partition_predicate
2020-11-25 23:09:17 +03:00
Nikita Mikhaylov
f3f06dccac
Merge pull request #17121 from yshrotciv/patch-1
...
Update replication.md
2020-11-25 21:29:19 +03:00
alexey-milovidov
532cd4beaa
Merge pull request #17405 from ClickHouse/revert-17351-dependabot/pip/docs/tools/mkdocs-macros-plugin-0.5.0
...
Revert "Bump mkdocs-macros-plugin from 0.4.20 to 0.5.0 in /docs/tools"
2020-11-25 18:05:48 +03:00
alexey-milovidov
2ca24c0f16
Revert "Bump mkdocs-macros-plugin from 0.4.20 to 0.5.0 in /docs/tools"
2020-11-25 18:05:36 +03:00
alexey-milovidov
c3a49c0947
Merge pull request #17365 from Avogar/benchmark-bug
...
Add eof check in receiveHello
2020-11-25 17:51:51 +03:00
alesapin
be80750ee7
Merge pull request #16899 from ClickHouse/query-profiler-minor-change
...
Minor change in query profiler
2020-11-25 17:14:11 +03:00
alesapin
77efcbcdbc
Merge pull request #17271 from azat/libunwind-cmake-3.19-build-fix
...
Fix libunwind build for cmake 3.19+
2020-11-25 17:09:40 +03:00
alesapin
dd4c5bdeb9
Merge pull request #17249 from amosbird/insub
...
Fix const column in set index.
2020-11-25 17:05:23 +03:00
Nikita Mikhaylov
d6dd133bee
Merge pull request #17363 from nikitamikhaylov/copier-uninitialized-var
...
Initialize unitialized variable
2020-11-25 15:12:42 +03:00
Nikita Mikhaylov
27acf6462f
Merge pull request #17248 from kaka11chen/15235
...
Fix #15235 . When clickhouse-copier handle non-partitioned table, throws segfault error.
2020-11-25 14:31:59 +03:00
Alexander Kuzmenkov
edce1e636e
Merge pull request #16535 from ClickHouse/aku/opentelemetry
...
OpenTelemetry improvements
2020-11-25 14:10:17 +03:00
Alexander Kuzmenkov
acba5ac0f1
Update src/DataTypes/DataTypeTuple.cpp
2020-11-25 14:10:04 +03:00
alesapin
3a3860c776
Merge pull request #16837 from ClickHouse/correctly_send_close_request
...
Set expire after we sent close in ZooKeeper client
2020-11-25 10:21:41 +03:00
alesapin
3e1b2f515b
Merge pull request #17311 from ClickHouse/fix_integration_tests
...
Fix some flaky tests
2020-11-25 10:09:27 +03:00
Vitaly Baranov
08b3707842
Merge pull request #15111 from vitlibar/grpc-protocol
...
Implement GRPC protocol.
2020-11-25 09:00:32 +03:00
chenqi
302cd55f45
Fix #15235 . When clickhouse-copier handle non-partitioned table, throw segfault error.
2020-11-25 11:52:00 +08:00
alesapin
7e014967db
Less broken ugly hack
2020-11-25 00:07:56 +03:00
Alexander Kuzmenkov
1d7dcef4a0
Merge remote-tracking branch 'origin/master' into HEAD
2020-11-24 21:45:10 +03:00
Alexander Kuzmenkov
1d6558f694
not sure what's going on
2020-11-24 21:45:01 +03:00
Alexander Kuzmenkov
8de415861f
Merge pull request #17206 from ClickHouse/aku/noescape
...
Remove escaping from toString(std::string)
2020-11-24 21:23:39 +03:00
nikitamikhaylov
ebd51db987
better
2020-11-24 21:22:50 +03:00
Alexey Milovidov
828d27d801
Remove unused ProfileEvents
2020-11-24 20:45:24 +03:00
Nikita Mikhaylov
33e87518dd
Merge pull request #17372 from ClickHouse/revert-17344-msan-fix-attempt
...
Revert "Attempt to fix Stress test (MSan)"
2020-11-24 20:36:37 +03:00
Nikita Mikhaylov
c25558ad2e
Revert "Attempt to fix Stress test (MSan)"
2020-11-24 20:36:17 +03:00
alesapin
b28fc3d4f6
Ugly fix for dangling reference
2020-11-24 19:24:36 +03:00
tavplubix
085359c110
Merge pull request #17274 from ClickHouse/fix_ast_formatting_in_logs
...
Fix AST formatting in log messages
2020-11-24 19:00:56 +03:00
Vitaly Baranov
65719da0d8
Merge pull request #16977 from MyroTk/rbac_attach_create_drop_detach_testflows
...
RBAC Testflows tests for ATTACH, CREATE, DROP, and DETACH
2020-11-24 18:31:44 +03:00
Pavel Kruglov
5b94dd2f74
Add eof check in receiveHello
2020-11-24 18:15:13 +03:00
Vitaly Baranov
4b3488934c
Disable running test test_odbc_interaction.test_bridge_dies_with_parent with asan.
2020-11-24 17:55:02 +03:00
Vitaly Baranov
3c85165e60
Redirect stderr, stdout for clickhouse-odbc-bridge to files.
2020-11-24 17:55:02 +03:00
Vitaly Baranov
a32ed23198
Fork abseil-cpp to remove dependency on errno@GLIBC_PRIVATE, __pthread_unwind@GLIBC_PRIVATE and to fix shared build.
2020-11-24 17:55:02 +03:00
Vitaly Baranov
7b0f94b5f2
glibc-compatibility: Add secure_getenv().
2020-11-24 17:55:02 +03:00
Vitaly Baranov
3253a525e2
glibc-compatibility: Add getauxval().
2020-11-24 17:55:02 +03:00
Vitaly Baranov
a61359c224
glibc-compatibility: Add accept4() from musl 1.2.1.
2020-11-24 17:55:02 +03:00
Vitaly Baranov
fc67aaec20
glibc-compatibility: Add epoll_create1() from musl 1.2.1.
2020-11-24 17:55:02 +03:00
Vitaly Baranov
d949898890
glibc-compatibility: Add eventfd(), eventfd_read(), eventfd_write() from musl 1.2.1.
2020-11-24 17:55:02 +03:00
Vitaly Baranov
be056a93ab
Add comments desribing the protocol.
2020-11-24 17:55:02 +03:00
Vitaly Baranov
1bd19bb124
Implemented clickhouse grpc client.
2020-11-24 17:55:02 +03:00
Vitaly Baranov
950bccb130
Add test for authentication.
2020-11-24 17:55:02 +03:00
Vitaly Baranov
a0e384b0c0
Added support for external tables.
2020-11-24 17:55:02 +03:00
Vitaly Baranov
23842e7ac6
Added support for input() function.
2020-11-24 17:55:02 +03:00
Vitaly Baranov
0e3a8840b5
Support cancellation of executing query via gRPC.
2020-11-24 17:55:02 +03:00
Vitaly Baranov
18ebea5d66
Optimization: Forward reading of next query infos.
2020-11-24 17:55:02 +03:00
Vitaly Baranov
88f1eeec2f
Add tests for parallel executing of queries.
2020-11-24 17:55:02 +03:00
Vitaly Baranov
eab3006a4d
Support SSL and compression when using gRPC protocol.
2020-11-24 17:55:02 +03:00
Vitaly Baranov
b0cb3eb306
Extend the protocol with streaming and nonstreaming functions.
2020-11-24 17:55:01 +03:00
Vitaly Baranov
b51e14253d
Added support for sessions in gRPC protocol.
2020-11-24 17:55:01 +03:00
Vitaly Baranov
9285f7edc1
Send profile info to client.
2020-11-24 17:55:01 +03:00
Vitaly Baranov
98e2cc4117
Fix sending progress.
2020-11-24 17:55:01 +03:00