Commit Graph

92053 Commits

Author SHA1 Message Date
Alexander Tokmakov
8246e55002
Merge pull request #38486 from azat/fix-parts-removal
Fix parts removal after incorrect server shutdown
2022-06-29 14:17:59 +03:00
Alexander Tokmakov
32c6a944ee
Merge pull request #38541 from Algunenano/rmarin_fix_replicated_create_table_compat
Fix table creation to avoid replication issues with pre-22.4 replicas
2022-06-29 14:15:50 +03:00
Maksim Kita
eeae73e0cf SQL create drop index update implementation 2022-06-29 13:10:30 +02:00
Kruglov Pavel
b9813bcdea
Merge pull request #38356 from kssenii/fix-rabbitmq-with-peekable
Fix RabbitMQ with formats based on PeekableReadBuffer
2022-06-29 13:06:10 +02:00
Alexander Tokmakov
c3573532c0
Merge pull request #38487 from ClickHouse/add_some_tsa_annotations
Add some TSA annotations
2022-06-29 13:57:10 +03:00
Yakov Olkhovskiy
78ea290789 add remove command 2022-06-29 06:47:21 -04:00
Alexander Tokmakov
ceb66ade4b
Merge pull request #38335 from ClickHouse/deprecate_ordinary_database
Deprecate Ordinary database and old *MergeTree syntax
2022-06-29 13:42:59 +03:00
Kruglov Pavel
5cc662f227
Merge pull request #38511 from azat/fix-schema_inference_with_globs
tests: fix 02305_schema_inference_with_globs flakiness
2022-06-29 12:39:38 +02:00
Maksim Kita
23e09b5e9b
Merge pull request #35166 from zhangjmruc/sql_compatible_create_drop_index
Support SQL compatible create/drop index syntax
2022-06-29 12:30:28 +02:00
Maksim Kita
c45e9a36bd
Merge pull request #38549 from ClibMouse/Issue_38457
Updated Index file for GeoFunctions
2022-06-29 12:11:43 +02:00
mergify[bot]
26258959b1
Merge branch 'master' into distinct_sorted_small_refact 2022-06-29 09:38:34 +00:00
Mikhail f. Shiryaev
80e7abd0fe
Merge pull request #38548 from excitoon-favorites/ci-integration-tests-test
Don't spoil return code of integration tests runner with redundant tee
2022-06-29 11:18:53 +02:00
Maksim Kita
00372e4646 Fixed tests 2022-06-29 11:05:36 +02:00
Alexander Tokmakov
2aa6c66a2e
Merge pull request #38488 from azat/fix-02335_column_ttl_expired_column_optimization
tests: cleanup tmp data in 02335_column_ttl_expired_column_optimization
2022-06-29 12:05:23 +03:00
Maksim Kita
24e8ba5f9a
Merge pull request #38540 from ClickHouse/update-poco
Update poco
2022-06-29 11:02:43 +02:00
Robert Schulze
f14c32e15c
Merge pull request #38546 from ClickHouse/builderbintidy
Rename slightly weirdly named "BuilderBinTidy" to "BuilderClangTidy"
2022-06-29 10:22:38 +02:00
Robert Schulze
bb441faa42
Merge pull request #38491 from ClickHouse/clang-tidy-in-branches
Fix some clang-tidy warnings in headers
2022-06-29 10:22:04 +02:00
Robert Schulze
fd31147727
Merge pull request #37852 from michael1589/master
compile the new libgsasl to supportting hadoop secure rpc transfer(supports hadoop.rpc.protection=privacy/integrity/authentication)
2022-06-29 09:39:58 +02:00
Alexey Milovidov
0d27672ac8
Merge pull request #38440 from xiedeyantu/allow_trailing_comma
Allow trailing comma in columns list
2022-06-29 09:47:09 +03:00
Alexey Milovidov
e7dbe526f8
Update ParserCreateQuery.cpp 2022-06-29 09:46:45 +03:00
Alexey Milovidov
4cda5491f6
Merge pull request #38542 from ClickHouse/unique_lock-to-lock_guard
Don't use std::unique_lock unless we need to
2022-06-29 09:40:56 +03:00
Alexey Milovidov
dea3b5bfce
Revert "Non Negative Derivative window function" 2022-06-29 08:56:15 +03:00
Vladimir Chebotarev
f7ef571842 Don't spoil return code of integration tests runner with redundant tee. 2022-06-29 06:11:09 +03:00
jianmei zhang
d75af09f74 Fix style error 2022-06-29 11:08:05 +08:00
jianmei zhang
8d49aa4697 Support sql standard drop index in seprate parser files 2022-06-29 11:08:05 +08:00
jianmei zhang
589cba8045 Support sql standard create index in seprate parser files 2022-06-29 11:08:05 +08:00
jianmei zhang
9154aec201 Fix compile error 2022-06-29 11:08:05 +08:00
jianmei zhang
d6b0bc2942 Add test case 2022-06-29 11:08:05 +08:00
Jianmei Zhang
13231d6a85 Pass command type for create and drop index 2022-06-29 11:08:05 +08:00
Jianmei Zhang
4d0635371f Support sql stanard create and drop index 2022-06-29 11:08:05 +08:00
HeenaBansal2009
d5886e4861 Updated Index file for GeoFunctions 2022-06-28 19:24:06 -07:00
lgbo-ustc
ee30c4a3f7 update test scripts 2022-06-29 10:23:00 +08:00
lgbo-ustc
7274169c33 update test scripts 2022-06-29 10:03:10 +08:00
mergify[bot]
beef90674f
Merge branch 'master' into master 2022-06-29 01:00:34 +00:00
Nikita Taranov
f5d26572df
Quick fix for aggregation pipeline (#38295) 2022-06-29 01:16:30 +02:00
Robert Schulze
f5bfc2c27b
BuilderBinClangTidy 2022-06-28 22:29:17 +02:00
Robert Schulze
5048d384b2
BuilderBinClangTidy 2022-06-28 22:28:19 +02:00
Igor Nikonov
c1840e798c Fix: wrong header variable was used 2022-06-28 20:15:16 +00:00
Igor Nikonov
d80a21a445 Distinct sorted: calculate column positions once in constructor
- instead of calculating them on every chunk
2022-06-28 19:59:05 +00:00
Azat Khuzhin
4a52d3f6b9 tests: update reference for 00597_push_down_predicate_long
CI: https://s3.amazonaws.com/clickhouse-test-reports/37887/6b4613c88056f3901f6d8a832c9e2bc15e22206d/stateless_tests__aarch64__actions_.html
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-06-28 22:53:03 +03:00
Azat Khuzhin
f86ddebada Add sanity check for UNION header
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-06-28 22:53:03 +03:00
Azat Khuzhin
d98336ad83 Fix incorrect columns order in subqueries of UNION
Consider the following query:

    SELECT avgWeighted(x, y) FROM (SELECT NULL, 255 AS x, 1 AS y UNION ALL SELECT y, NULL AS x, 1 AS y)

Here is UNION from two SELECT queries
- `SELECT NULL, 255 AS x, 1 AS y`
- `SELECT y, NULL AS x, 1 AS y`

UNION queries matches columns by positions, not names, so the following
columns should be used by `avgWeighted()`:
- `255 AS x,  1 AS y`
- `NULL AS x, 1 AS y`

Result types of arguments should be:
- `x Nullable(UInt8)`
- `y UInt8`

And in case of UNION query is a subselect itself, it will return only
required columns, for the example above it needs only `x` and `y`.
For this it will get positions of these arguments from the first query,
and then use those positions to get required column names from the
second query (since there is no ability to get columns by positions
instead of names internally), and due to duplicated columns the second
query will return (`y`, `x`) not (`x`, `y`), and this will make the
result incorrect:

    EXPLAIN header = 1, optimize = 0, actions=1 SELECT avgWeighted(x, y) FROM (SELECT NULL, 255 AS x, 1 AS y UNION ALL SELECT y, NULL AS x, 1 AS y)

    Aggregates:
        avgWeighted(x, y)
          Function: avgWeighted(Nullable(UInt8), UInt8) → Nullable(Float64)
          Arguments: x, y
          Argument positions: 0, 1
      Expression (Before GROUP BY)
      Header: x UInt8
              y Nullable(UInt8)
      ...
      Union
      Header: x UInt8
              y Nullable(UInt8)
        Expression (Conversion before UNION)
        Header: x UInt8
                y Nullable(UInt8)
        Expression (Conversion before UNION)
        Header: x UInt8
                y Nullable(UInt8)

And the query itself fails with an error:

    Logical error: 'Bad cast from type DB::ColumnVector<char8_t> to DB::ColumnNullable'.

_NOTE: `avgWeighted()` here is required to trigger `LOGICAL_ERROR`_

CI: https://s3.amazonaws.com/clickhouse-test-reports/37796/e637489f81768df582fe7389e57f7ed12893087c/fuzzer_astfuzzerdebug,actions//report.html
Fixes: 02227_union_match_by_name
v2: fix untuple() (reserve space for output_columns_positions too)
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-06-28 22:53:03 +03:00
Azat Khuzhin
563fac5333 tests: add a test for incorrect header in UNION queries
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-06-28 22:53:03 +03:00
Azat Khuzhin
ee0f2651ee Revert "Fix converting types for UNION queries (may produce LOGICAL_ERROR)"
This fix is incorrect, and it introduce new issues, in particular it
may breaks UNION queries w/o column aliases, i.e.:

    SELECT a, b, c FROM (SELECT 3 AS a, 2147483647 AS b, 1048575 AS c UNION ALL SELECT -2, NULL, -2) AS js1 ORDER BY a

CI: https://s3.amazonaws.com/clickhouse-test-reports/37796/e637489f81768df582fe7389e57f7ed12893087c/fuzzer_astfuzzerdebug,actions//report.html
Reverts: #37593/#34775 (2613149f6b)
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-06-28 22:50:01 +03:00
Robert Schulze
75f7662ebb
Rename slightly weirdly named "BuilderBinTidy" to "BuilderClangTidy" 2022-06-28 19:47:00 +00:00
Azat Khuzhin
1648cd0eb0 tests: cleanup tmp data in 02335_column_ttl_expired_column_optimization
v2: remove trap usage as requested by @tavplubix
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2022-06-28 22:43:09 +03:00
mergify[bot]
a1d7b1dbf3
Merge branch 'master' into master 2022-06-28 19:36:07 +00:00
Robert Schulze
f692ead6ad
Don't use std::unique_lock unless we have to
Replace where possible by std::lock_guard which is more light-weight.
2022-06-28 19:19:06 +00:00
mergify[bot]
3f266954f0
Merge branch 'master' into deprecate_ordinary_database 2022-06-28 18:13:36 +00:00
Raúl Marín
9b4da86e2e Adapt table creation with replication to avoid issues with pre-22.4 replicas 2022-06-28 20:12:07 +02:00