Commit Graph

12605 Commits

Author SHA1 Message Date
Robert Schulze
a1c164a758
Fix a bunch of clang-tidy warnings in headers 2024-02-28 23:43:12 +00:00
Alexey Milovidov
e1e66dc2b8
Merge pull request #60095 from ClickHouse/fix-inconsistent-formatting
Fix inconsistent formatting of queries
2024-02-29 00:41:40 +03:00
Nikita Mikhaylov
938976d8c3 Merge branch 'master' of github.com:ClickHouse/ClickHouse into shabroo/master 2024-02-28 21:40:43 +00:00
Robert Schulze
2ccaf954f6
Fix wacky primary key sorting in SHOW INDEX 2024-02-28 20:46:37 +00:00
Robert Schulze
a58869303f
Added comment 2024-02-28 19:36:15 +00:00
Robert Schulze
d3b942cec5
Merge remote-tracking branch 'ClickHouse/master' into query_cache_minor_change 2024-02-28 19:35:31 +00:00
Nikolai Kochetov
53714e6f7a Refactor StorageSystemOneBlock 2024-02-28 19:10:00 +00:00
Raúl Marín
4023e67ac5
Merge pull request #60138 from Algunenano/max_threads_sanity
Add sanity check for number of threads and block size
2024-02-28 19:05:55 +01:00
Kruglov Pavel
a7eabbbe3a
Merge branch 'master' into variant-improvements 2024-02-28 17:38:54 +01:00
Alexey Milovidov
b0ab0b37db
Merge pull request #60434 from ClickHouse/revert-60216-revert-59697-check-stack-size-in-parser
Revert "Revert "Check stack size in Parser""
2024-02-28 19:20:49 +03:00
Alexey Milovidov
1950a75bd4 Merge branch 'master' into fix-inconsistent-formatting 2024-02-28 17:10:29 +01:00
Raúl Marín
2cea787f81 Merge remote-tracking branch 'blessed/master' into parallel_replicas_cte_2 2024-02-28 16:44:55 +01:00
Kruglov Pavel
f1b2dbaeb5
Merge pull request #60353 from Avogar/validate-nested-types-under-a-setting
Validate experimental and suspicious types inside nested types under a setting
2024-02-28 13:36:11 +01:00
Raúl Marín
3920120260
Merge pull request #60453 from Algunenano/fix_preimagepass
Fix OptimizeDateOrDateTimeConverterWithPreimageVisitor with null arguments
2024-02-28 13:15:04 +01:00
pufit
330a206470
Add definers for views (Attempt 2) (#60439) 2024-02-27 19:00:17 -05:00
Nikita Taranov
90c9ae1b22
Merge pull request #59448 from nickitat/insert_with_max_insert_threads_into_remote_tables
More parallel insert-select pipeline
2024-02-28 00:54:16 +01:00
Alexey Milovidov
8cf619bc03 Merge branch 'master' of github.com:ClickHouse/ClickHouse into fix-inconsistent-formatting 2024-02-28 00:30:44 +01:00
Alexey Milovidov
9ea7ff231b
Merge pull request #60448 from ClickHouse/clang-19
Update to clang-19
2024-02-27 23:38:08 +03:00
Alexey Milovidov
0f3c9963d1 Merge branch 'master' of github.com:ClickHouse/ClickHouse into revert-60216-revert-59697-check-stack-size-in-parser 2024-02-27 17:30:32 +01:00
Raúl Marín
0a243c3c57 Fix 2024-02-27 16:17:48 +01:00
Robert Schulze
0f6bec7842
Merge pull request #59291 from azat/dist/config-settings
Support specifying settings for Distributed engine in config (like for MergeTree)
2024-02-27 16:10:51 +01:00
Raúl Marín
e81c2ede2a Add setting to control preimage optimization 2024-02-27 15:58:42 +01:00
Alexey Milovidov
7c6e28708b
Merge pull request #60370 from ClickHouse/remove-alter-live-view
Remove ALTER LIVE VIEW
2024-02-27 17:45:59 +03:00
Nikita Mikhaylov
8719a601fa
Merge pull request #60436 from nickitat/revert_56864
Revert "Merge pull request #56864 from ClickHouse/broken-projections-better-handling"
2024-02-27 15:25:15 +01:00
Alexey Milovidov
c192a448d0 Update to clang-19 2024-02-27 14:37:21 +01:00
Raúl Marín
753056eed7
Merge branch 'master' into parallel_replicas_cte_2 2024-02-27 14:06:02 +01:00
Nikolai Kochetov
63b4457991
Merge pull request #60360 from ClickHouse/follow-up-60082
Follow up #60082
2024-02-27 12:50:25 +01:00
Raúl Marín
c9dd6fe8d5
Set max_parallel_replicas to 1 when disabling 2024-02-27 12:35:14 +01:00
liuneng
c1df83a27f refactor code 2024-02-27 14:04:54 +08:00
Nikita Taranov
854f1b064b Revert "Merge pull request #56864 from ClickHouse/broken-projections-better-handling"
This reverts commit caaafbcedb, reversing
changes made to d45b248f96.
2024-02-27 00:13:28 +01:00
Alexey Milovidov
04fe5dc55c Merge branch 'master' into fix-inconsistent-formatting 2024-02-26 23:46:24 +01:00
Alexey Milovidov
0b90076a36
Revert "Revert "Check stack size in Parser"" 2024-02-27 01:34:50 +03:00
Robert Schulze
4794dc28f0
Merge remote-tracking branch 'ClickHouse/master' into dist/config-settings 2024-02-26 21:57:33 +00:00
Alexey Milovidov
ad99bb95a3
Merge pull request #60388 from ClickHouse/remove-useless-method-2
Remove unused method
2024-02-26 21:05:37 +03:00
Alexey Milovidov
a3f1411679 Merge branch 'master' of github.com:ClickHouse/ClickHouse into fix-inconsistent-formatting 2024-02-26 19:01:11 +01:00
Amos Bird
41388a7a53 Fix
(cherry picked from commit 1d22dd8f0d809f1cc6593d4164098f1b5463cc77)
2024-02-26 17:52:19 +00:00
vdimir
5a9026f39b
Analyzer: compute ALIAS columns right after reading 2024-02-26 16:15:05 +00:00
Raúl Marín
eb0af49fd0 Merge remote-tracking branch 'blessed/master' into max_threads_sanity 2024-02-26 16:33:43 +01:00
Nikolai Kochetov
ce7cde64ec Small fix 2024-02-26 15:33:25 +00:00
Nikolai Kochetov
ed78c18eda Add a setting query_plan_optimize_prewhere. Use AST-based PREWHERE optimization when it is disabled. 2024-02-26 15:19:27 +00:00
Nikolai Kochetov
2b9889fb84
Merge pull request #60082 from amosbird/non-trivial-count-optimization
Refactor prewhere and primary key optimization
2024-02-26 16:17:24 +01:00
avogar
3c881b63d6 Merge branch 'master' of github.com:ClickHouse/ClickHouse into validate-nested-types-under-a-setting 2024-02-26 14:45:57 +00:00
Nikolai Kochetov
ef8dab52c6
Merge pull request #57767 from jsc0218/DictShortCircuit
Dict Short Circuit
2024-02-26 15:16:15 +01:00
Raúl Marín
f885423a4a Cleanup and more tests 2024-02-26 15:09:05 +01:00
Raúl Marín
2fa04bb37c Merge remote-tracking branch 'blessed/master' into parallel_replicas_cte_2 2024-02-26 14:31:20 +01:00
Yong Wang
795c1a98dc
Fix segmentation fault in KQL parser when the input query exceeds the max_query_size (#59626)
* Fix_kql_issue_found_by_wingfuzz

This commit fix the issues:
 https://github.com/ClickHouse/ClickHouse/issues/59036
 https://github.com/ClickHouse/ClickHouse/issues/59037

both issues are same reason, the input query exceed the max_query_size,
so the condition isEnd() of token is not meet and cause the assertion failure

* fix_kql_issue_found_by_wingfuzz: use isValid instead of TokenType::EndOfStream

* fix_kql_issue_found_by_wingfuzz: make functional test result consist

* fix_kql_issue_found_by_wingfuzz: update test case for makeseries

* fix_kql_issue_found_by_wingfuzz: disable makeseries

* fix_kql_issue_found_by_wingfuzz:
 use isvalid() function to replace isEnd() function of TokenIterator to check the end of stream

* fix_kql_issue_found_by_wingfuzz: add test case for max_query_size

* fix_kql_issue_found_by_wingfuzz: fix AST structure

* fix_kql_issue_found_by_wingfuzz: make sure the max query size test is in the dialect of kusto

* fix_kql_issue_found_by_wingfuzz : restore max query size after test

* fix_kql_issue_found_by_wingfuzz : fix typo

---------

Co-authored-by: János Benjamin Antal <benjamin.antal@clickhouse.com>
2024-02-26 13:31:47 +01:00
Yarik Briukhovetskyi
7d413bef18
Merge branch 'ClickHouse:master' into fix_datetime64_scale_conversion 2024-02-26 12:28:36 +01:00
Robert Schulze
1e40b63cb1
Merge remote-tracking branch 'ClickHouse/master' into dist/config-settings 2024-02-26 11:15:51 +00:00
Raúl Marín
f84209be2f Merge remote-tracking branch 'blessed/master' into max_threads_sanity 2024-02-26 11:56:29 +01:00
Robert Schulze
5c967c44de
Merge pull request #60248 from ClickHouse/revert-59450-order-by-all-ambiguities
Revert "Replace `ORDER BY ALL` by `ORDER BY *`"
2024-02-26 10:23:41 +01:00
liuneng
757b2f3369 fix style 2024-02-26 16:49:15 +08:00
liuneng
a0f108ec3f fix bug 2024-02-26 16:22:47 +08:00
liuneng
94f78ac44b use template class 2024-02-26 15:34:56 +08:00
liuneng
2279885c3e fix clangtidy error 2024-02-26 09:51:21 +08:00
liuneng
22a33884c3 fix bug 2024-02-26 09:51:21 +08:00
liuneng
ce3f95f717 fix style 2024-02-26 09:51:21 +08:00
liuneng
b0943ab3e8 add lazyAddedColumns 2024-02-26 09:51:21 +08:00
liuneng
3a2c9a8793 update 2024-02-26 09:51:21 +08:00
liuneng
5c42f2c041 optimize default value 2024-02-26 09:51:21 +08:00
liuneng
18eb75f4d2 lazy build join output 2024-02-26 09:51:21 +08:00
Alexey Milovidov
979cd2937b Fix inconsistent formatting of SET param_... 2024-02-26 02:11:51 +01:00
Alexey Milovidov
10e59c2e01 Remove ALTER LIVE VIEW 2024-02-26 00:01:34 +01:00
Alexey Milovidov
d097da1223 Remove unused method 2024-02-25 22:40:03 +01:00
Amos Bird
534da3f40f
Fix more tests 2024-02-26 02:31:59 +08:00
Amos Bird
5551a9073b
Better 2024-02-26 02:31:59 +08:00
Amos Bird
207d36d7c1
Make it work 2024-02-26 02:31:58 +08:00
Amos Bird
6137914604
Fix most tests 2024-02-26 02:31:58 +08:00
Amos Bird
b40a412086
Fix 2024-02-26 02:31:57 +08:00
Amos Bird
8a1e23dcc4
Fix more tests 2024-02-26 02:31:57 +08:00
Amos Bird
7435568a0d
Fix tests 2024-02-26 02:31:57 +08:00
Amos Bird
c5e073320c
Unify prewhere optimization 2024-02-26 02:31:56 +08:00
Amos Bird
07a0adceb9
Only use query_info.filter_actions_dag for key analysis 2024-02-26 02:31:55 +08:00
Alexey Milovidov
2eb4d25126 Remove ALTER LIVE VIEW 2024-02-23 22:56:18 +01:00
avogar
8fa75a21c5 Don't allow suspicious variant types by default, add notes in documentation 2024-02-23 20:48:38 +00:00
avogar
39ad054e94 Merge branch 'master' of github.com:ClickHouse/ClickHouse into variant-improvements 2024-02-23 18:59:34 +00:00
Raúl Marín
d507884a1d Force reanalysis if parallel replicas changed 2024-02-23 17:59:25 +01:00
Alexey Milovidov
da2ae34c1d Merge branch 'master' of github.com:ClickHouse/ClickHouse into fix-inconsistent-formatting 2024-02-23 15:55:03 +01:00
Alexey Milovidov
10ba0801be Fix inconsistent formatting of SYSTEM SYNC REPLICA LIGHTWEIGHT 2024-02-23 15:45:08 +01:00
Nikita Mikhaylov
8fef0b71c4
Merge pull request #60350 from ClickHouse/revert-54901-pufit/views-sql-security
Revert "Add definers for views"
2024-02-23 15:15:36 +01:00
Alexey Milovidov
9e32d0f5b2 Merge branch 'master' of github.com:ClickHouse/ClickHouse into fix-inconsistent-formatting 2024-02-23 15:05:46 +01:00
avogar
da8d8fee47 Validate experimental and suspicious types inside nested types under a setting to reflect it in compatibility setting 2024-02-23 13:45:03 +00:00
Raúl Marín
edd5a64890 Better checks 2024-02-23 14:22:05 +01:00
Alexander Tokmakov
32607cc796
Merge pull request #60159 from ClickHouse/fix_create_replica
Skip sanity checks on secondary CREATE query
2024-02-23 13:53:47 +01:00
Sergei Trifonov
2c766cf75f
Merge pull request #59507 from ClickHouse/alter-table-forget-partition
Add `FORGET PARTITION` query to remove old partition nodes from ZooKeeper
2024-02-23 12:55:08 +01:00
Raúl Marín
464b5e0e15
Revert "Add definers for views (#54901)"
This reverts commit 57306706b3.
2024-02-23 12:44:31 +01:00
Vitaly Baranov
db119eed49
Merge pull request #60002 from vitlibar/add-config-setting-remove-backup-files-after-failure
Add new config setting "backups.remove_backup_files_after_failure"
2024-02-23 12:42:55 +01:00
Raúl Marín
a431608dd4 Add sanity check for some settings 2024-02-23 12:32:17 +01:00
Yarik Briukhovetskyi
ec2c717910
Merge branch 'ClickHouse:master' into fix_datetime64_scale_conversion 2024-02-23 12:24:14 +01:00
zhongyuankai
055efec1a0
minor 2024-02-23 19:03:41 +08:00
zhongyuankai
68239075b7
Query cache does not record the number of queries by default 2024-02-23 18:33:24 +08:00
Raúl Marín
1a4b4d493f
Merge pull request #60228 from Algunenano/parallel_replicas_2
Treat 2+ in allow_experimental_parallel_reading_from_replicas as 2
2024-02-23 11:17:23 +01:00
János Benjamin Antal
7cad0050c0
Disambiguate alter commands list (#59532)
* Add optional parentheses to TTL element and alter command

* Add some basic tests

* Extend tests with more test cases

* Add one more test case

* Add server setting to control new formatting behavior

* Automatic style fix

* Fix segfault in `clickhouse-format` related to new server setting

* Remove format_ttl_expressions_with_parentheses

* Fix unit test compilation failures

* Introduce global flag to control the new formatting behavior

* Revert "Fix segfault in `clickhouse-format` related to new server setting"

This reverts commit d7131a3145.

* Revert accidental changes

* Revert accidental include reorder

* Revert accidental changes

* Enable new format in client and local server

---------

Co-authored-by: robot-clickhouse <robot-clickhouse@users.noreply.github.com>
2024-02-22 19:17:15 +01:00
Alexander Tokmakov
e56748a92c
Merge pull request #60044 from ClickHouse/fix_undead_sessions
Ability to detect undead ZooKeeper sessions
2024-02-22 18:13:15 +01:00
Vitaly Baranov
b130726a0c
Merge branch 'master' into add-config-setting-remove-backup-files-after-failure 2024-02-22 18:09:12 +01:00
pufit
57306706b3
Add definers for views (#54901) 2024-02-22 17:47:50 +01:00
Azat Khuzhin
0cb6f205d7 Fix actions execution during preliminary filtering (PK, partition pruning)
Previously preliminary filtering works incorrectly if input columns had
been used multiple times, because:
- position initialized only for the first user
- column had been moved, so the second user will get nullptr

And this was the case when it had been required multiple times.

Consider the following example:

    select * from data final prewhere indexHint(_partition_id = 'all') or indexHint(_partition_id = 'all')

Actions for this PREWHERE is the following:

    (lldb) p actions.__ptr_->dumpActions()
    (std::string) $1 = "input:
    _partition_id LowCardinality(String)
    _partition_id LowCardinality(String)

    actions:
    INPUT : 0 -> _partition_id LowCardinality(String) : 0
    COLUMN Const(String) -> 'all' String : 1
    COLUMN Const(String) -> 'UInt8'_String String : 2
    INPUT : 1 -> _partition_id LowCardinality(String) : 3
    COLUMN Const(String) -> 'all' String : 4
    COLUMN Const(String) -> 'UInt8'_String String : 5
    FUNCTION equals(_partition_id :: 0, 'all' :: 1) -> equals(_partition_id, 'all') LowCardinality(UInt8) : 6
    FUNCTION equals(_partition_id :: 3, 'all' :: 4) -> equals(_partition_id, 'all') LowCardinality(UInt8) : 1
    FUNCTION _CAST(equals(_partition_id, 'all') :: 6, 'UInt8'_String :: 2) -> _CAST(equals(_partition_id, 'all'), 'UInt8'_String) UInt8 : 4
    FUNCTION _CAST(equals(_partition_id, 'all') :: 1, 'UInt8'_String :: 5) -> _CAST(equals(_partition_id, 'all'), 'UInt8'_String) UInt8 : 2
    FUNCTION or(_CAST(equals(_partition_id, 'all'), 'UInt8'_String) :: 4, _CAST(equals(_partition_id, 'all'), 'UInt8'_String) :: 2) -> or(indexHint(), indexHint())"...

It has _partition_id column in input multiple times.

So fix this by adding a flag (`allow_duplicates_in_input`), if set,
columns will be fully initialized.

v2: fix "Position out of bound in Block::erase()"
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-02-22 15:01:57 +01:00
Azat Khuzhin
be2ec93a3f Remove commented code in ExpressionActions::execute()
This information will be added to the exception anyway.

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2024-02-22 15:01:57 +01:00
Alexander Tokmakov
97ed2c05b0 Merge branch 'master' into fix_undead_sessions 2024-02-22 14:36:36 +01:00
Yarik Briukhovetskyi
ab634a308d
Merge branch 'ClickHouse:master' into fix_datetime64_scale_conversion 2024-02-22 13:22:04 +01:00
Nikolai Kochetov
0e6b55ad35
Merge pull request #60220 from kitaisreal/system-backups-system-backup-log-add-query-id-and-error-stacktrace
Tables system.backups and system.backup_log add query_id and error stacktrace
2024-02-22 12:43:52 +01:00