Commit Graph

37589 Commits

Author SHA1 Message Date
Nikolay Degterinsky
5104b2e8bf
Merge branch 'master' into parameters-rename-query 2023-02-17 17:30:37 +01:00
kssenii
afb36dd120 Allow disk setting to override storage_policy from config merge tree settings insteaf of exception 2023-02-17 17:11:29 +01:00
Maksim Kita
6c1436f78e Fixed tests 2023-02-17 16:50:46 +01:00
Kseniia Sumarokova
bf6e6a88f7
Merge branch 'master' into iceberg 2023-02-17 16:36:28 +01:00
Alexey Milovidov
45b1eabd36
Merge pull request #46420 from evillique/replace-transformer-fix-parameters
Fix parameterized queries with REPLACE transformer
2023-02-17 18:25:57 +03:00
Igor Nikonov
486501296c Merge remote-tracking branch 'origin/master' into igor/remove_redundant_distinct 2023-02-17 14:40:02 +00:00
Igor Nikonov
64dfc9f8ce Fix clang-analyzer warning 2023-02-17 14:39:20 +00:00
flynn
ebd88aab41
Merge branch 'master' into iceberg 2023-02-17 21:53:29 +08:00
Alexander Gololobov
bcb196a11f Extracted common logic into saveMatch() 2023-02-17 14:42:37 +01:00
Nikolai Kochetov
b7a96eaead
Merge branch 'master' into fix-crash-with-distinct 2023-02-17 14:25:47 +01:00
Vladimir C
0f182f6164
Merge pull request #46454 from azat/merge-alias-prewhere 2023-02-17 14:10:52 +01:00
Alexander Tokmakov
fb3574d2cf Merge branch 'master' into fix_test_store_cleanup 2023-02-17 13:59:22 +01:00
flynn
b3a9468661 fix 2023-02-17 12:42:24 +00:00
flynn
4b1d997b82 fix 2023-02-17 12:27:53 +00:00
kssenii
bae85c50e9 Fix stress test 2023-02-17 12:40:17 +01:00
Igor Nikonov
3871959605
Merge branch 'master' into fix-crash-with-distinct 2023-02-17 11:43:43 +01:00
Sema Checherinda
b551b9fb3a
Merge pull request #46452 from CheSema/resolve-race-get-csn
resolve race in getCSNAndAssert
2023-02-17 11:31:58 +01:00
flynn
1d5b7ebc73 fix 2023-02-17 09:01:13 +00:00
flynn
561b575111 fix style 2023-02-17 08:35:38 +00:00
flynn
a39f6f419b refactor 2023-02-17 08:27:52 +00:00
Joanna Hulboj
3771d97936 FIXUP: Unused error code 2023-02-17 07:40:54 +00:00
Nikolay Degterinsky
3b19823960
Merge branch 'master' into replace-transformer-fix-parameters 2023-02-17 02:02:54 +01:00
Joanna Hulboj
d48bdcc754 FIXUP: Into FunctionArrayMapped: Simplify the dispatch in case of positional params 2023-02-16 20:17:49 +00:00
Joanna Hulboj
8747e23dbb FIXUP: PR comments 2023-02-16 20:17:49 +00:00
Azat Khuzhin
5af2967f65 Revert code in TreeRewriter for proper column order for UNION
It is not required after #44920, which has a proper fix that does this
in ExpressionAnalyzer.

This reverts commit d98336ad83.
Reverts: #37887

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-02-16 20:46:39 +01:00
Alexey Milovidov
993a39e2a1
Merge pull request #46360 from genzgd/http_client_version
Allow to provide the protocol version by HTTP clients to tune the compatibility of the Native output format.
2023-02-16 22:17:04 +03:00
Maksim Kita
11965e59e2 Analyzer Planner disable by default 2023-02-16 19:46:24 +01:00
Alexander Gololobov
e0cc1b9ae4 Fix assertion when index argument is not passed 2023-02-16 19:29:26 +01:00
Alexander Gololobov
7b4219e23a Added documentation field 2023-02-16 19:26:10 +01:00
Sema Checherinda
73a506b996
Update src/Interpreters/TransactionLog.cpp
Co-authored-by: Alexander Tokmakov <tavplubix@gmail.com>
2023-02-16 19:01:02 +01:00
Sema Checherinda
0511f5e635
Update src/Interpreters/TransactionLog.cpp
Co-authored-by: Alexander Tokmakov <tavplubix@gmail.com>
2023-02-16 19:00:55 +01:00
Sema Checherinda
bc661442c3
Update src/Interpreters/TransactionLog.cpp
Co-authored-by: Alexander Tokmakov <tavplubix@gmail.com>
2023-02-16 19:00:46 +01:00
Joanna Hulboj
5e32e20abb FIXUP: arrayPartialSort arg check and few tests 2023-02-16 17:59:12 +00:00
Joanna Hulboj
221e4942b2 FIXUP: check in FunctionArrayMapped refactor 2023-02-16 17:59:12 +00:00
Joanna Hulboj
4ee665b158 FIXUP: Missing ErrorCodes 2023-02-16 17:59:12 +00:00
Joanna Hulboj
7bb7ea6913 Added arrayPartialSort and arraySort functions 2023-02-16 17:59:12 +00:00
Joanna Hulboj
23d173a53c Refactor FunctionArrayMapped to allow for a fixed number of extra positional arguments 2023-02-16 17:59:12 +00:00
Nikolai Kochetov
9cca571777 Fix constants in the result of MergingSortedAlgorithm. 2023-02-16 17:58:35 +00:00
kssenii
417052e4b2 Fix remaining tests 2023-02-16 18:56:19 +01:00
Robert Schulze
0ff404da9c
Merge pull request #46302 from JakeBamrah/master
Expand date formatters and add `DATE_FORMAT` function for better MySQL compatibility
2023-02-16 17:54:12 +01:00
Azat Khuzhin
beff5ac795 Fix PREWHERE for Merge with different default types
In case of underlying table has an ALIAS for this column, while in Merge
table it is not marked as an alias, there will NOT_FOUND_COLUMN_IN_BLOCK
error.

Further more, when underlying tables has different default type for the
column, i.e. one has ALIAS and another has real column, then you will
also get NOT_FOUND_COLUMN_IN_BLOCK, because Merge engine should take
care of this.

Also this patch reworks how PREWHERE is handled for Merge table, and now
if you use PREWHERE on the column that has the same type and default
type (ALIAS, ...) then it will be possible, and only if the type
differs, it will be prohibited and throw ILLEGAL_PREWHERE error.

And last, but not least, also respect this restrictions for
optimize_move_to_prewhere.

v2: introduce IStorage::supportedPrewhereColumns()
v3: Remove excessive condition for PREWHERE in StorageMerge::read()
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
2023-02-16 17:21:53 +01:00
kssenii
75d62ee24a Remove support of feature which does not work reliably 2023-02-16 16:41:31 +01:00
SmitaRKulkarni
f3f459fe34
Merge branch 'master' into 45185_Inner_join_with_where 2023-02-16 16:20:20 +01:00
Smita Kulkarni
6763a9d1ff Updated to not clear on_expression from table_join as its used by future analyze runs 2023-02-16 16:15:18 +01:00
flynn
eae73a1511 fix 2023-02-16 13:42:19 +00:00
Alexander Tokmakov
9feb448a5e fix a race condition 2023-02-16 14:41:18 +01:00
Alexander Gololobov
d0f402fa5b
Merge pull request #46391 from ClickHouse/debug-docker
Easy debugging of clickhouse-server in Docker
2023-02-16 14:09:43 +01:00
youennL-cs
6526c2a8ab
[RFC] Replacing merge tree new engine (#41005)
* Add new engine to ReplacingMergeTree corresponding to the ReplacingCollapsingMergeTree

* Add new test for the new ReplacingMergeTree engine

* Limit sign value to -1/1

* Add new engine to ReplacingMergeTree corresponding to the ReplacingCollapsingMergeTree

* Add new test for the new ReplacingMergeTree engine

* Limit sign value to -1/1

* Replace sign column(Int8) by is_deleted(UInt8)

* Add new engine to ReplacingMergeTree corresponding to the ReplacingCollapsingMergeTree

* Add new test for the new ReplacingMergeTree engine

* Limit sign value to -1/1

* Replace sign column(Int8) by is_deleted(UInt8)

* Add new engine to ReplacingMergeTree corresponding to the ReplacingCollapsingMergeTree

* Add new test for the new ReplacingMergeTree engine

* Limit sign value to -1/1

* Replace sign column(Int8) by is_deleted(UInt8)

* Add keyword 'CLEANUP' when OPTIMIZE

* Cleanup uniquely when it's a replacingMergeTree

* Propagate CLEANUP information and change from 'with_cleanup' to 'cleanup'

* Cleanup data flagged as 'is_deleted'

* Fix merge when optimize and add a test

* Fix OPTIMIZE and INSERT + add tests

* New fix for cleanup at the merge

* Cleanup debug logs

* Add the SETTINGS option 'clean_deleted_rows' that can be 'never' or 'always'

* Fix regression bug; Now REplicatedMergeTree can be called as before without 'is_deleted'

* Add Replicated tests

* Disable tag 'long' for our test and cleanup some white spaces

* Update tests

* Fix tests and remove additional useless whitespace

* Fix replica test

* Style clean && add condition check for is_deleted values

* clean_deleted_rows settings is nom an enum

* Add valid default value to the clean_deleted_rows settings

* Update cleanup checkers to use the enum and fix typos in the test

* Fix submodule contrib/AMQP-CPP pointer

* Add missing messages in test reference and remove a print with non derterministic order

* fix replica test reference

* Fix edge case

* Fix a typo for the spell checker

* Fix reference

* Fix a condition to raise an error if is_deleted differ from 0/1 and cleanup

* Change tests file name and update number

* This should fix the ReplacingMergeTree parameter set

* Fix replicated parameters

* Disable allow_deprecated_syntax_for_merge_tree for our new column

* Fix a test

* Remove non deterministic order print in the test

* Test on replicas

* Remove a condition, when checking optional parameters, that should not be sueful since we disabled the deprected_syntaxe

* Revert "Remove a condition, when checking optional parameters, that should not be useful since we disabled the deprected_syntaxe"

This reverts commit b65d64c05e.

* Fix replica management and limit the number of argument to two maximum, due to the possiblity of deprecated table create/attach failing otherwise

* Test a fix for replicated log information error

* Try to add sync to have consistent results

* Change path of replicas that should cause one issue and add few prints in case it's not that

* Get cleanup info on replicas only if information found

* Fix style issues

* Try to avoid replication error 'cannot select parts...' and and replica read/write field order

* Cleanup according to PR reviews
 and add tests on error raised.

* Update src/Storages/MergeTree/registerStorageMergeTree.cpp

Co-authored-by: Alexander Tokmakov <tavplubix@gmail.com>

* Select ... FINAL don't show rows with is_deleted = true

* Update and fix SELECT ... FINAL merge parameter

* Remove is_deleted rows only on the version inserted when merge

* Fix (master) updates issues

* Revert changes that should not be commited

* Add changes according to review

* Revert changes that should not be commited - part 2

---------

Co-authored-by: Alexander Tokmakov <tavplubix@gmail.com>
2023-02-16 16:03:16 +03:00
flynn
7f4c23ec8a fix 2023-02-16 12:48:22 +00:00
Maksim Kita
05baf271f0 Analyzer fix table functions with invalid arguments analysis 2023-02-16 12:17:04 +01:00
Maksim Kita
57b5d9852f Fixed build 2023-02-16 12:17:03 +01:00
Maksim Kita
b72ea982b0 Remove unnecessary includes of InterpreterSelectQuery header 2023-02-16 12:17:03 +01:00
Maksim Kita
4ddf1b0f48 Planner filter push down optimization fix 2023-02-16 12:17:03 +01:00
Maksim Kita
6b2adc1ec2 Analyzer storage Merge fixes 2023-02-16 12:17:03 +01:00
Maksim Kita
b1ab2af7ad Analyzer support storage Merge 2023-02-16 12:17:03 +01:00
Maksim Kita
469ad2c51b Fixed build 2023-02-16 12:17:03 +01:00
Maksim Kita
80af0666ea Analyzer support Materialized View 2023-02-16 12:17:03 +01:00
Maksim Kita
be9406ec0e Fixed tests 2023-02-16 12:17:03 +01:00
Maksim Kita
b2cc71f413 Fixed tests 2023-02-16 12:17:03 +01:00
Maksim Kita
c29f3c0f99 Analyzer fix GROUP BY columns validation 2023-02-16 12:17:03 +01:00
Maksim Kita
84065fb13f Analyzer added distributed table functions support 2023-02-16 12:17:03 +01:00
Maksim Kita
9b7cd64093 Analyzer join_use_nulls fix 2023-02-16 12:17:03 +01:00
Maksim Kita
0cba5848ac Fixed tests 2023-02-16 12:17:03 +01:00
Maksim Kita
c0e513efeb Fixed style check 2023-02-16 12:17:03 +01:00
Maksim Kita
afb3eb3c31 Planner JOIN planning fix 2023-02-16 12:17:03 +01:00
Maksim Kita
a090a8449d Analyzer distributed read fix 2023-02-16 12:17:03 +01:00
Maksim Kita
3a624e6bef Analyzer ColumnNode AST conversion fix 2023-02-16 12:17:03 +01:00
Maksim Kita
f21486c95b Analyzer validate that there are no window functions in GROUP BY 2023-02-16 12:17:03 +01:00
Maksim Kita
af38660cf5 Analyzer support ARRAY JOIN with Nested 2023-02-16 12:17:03 +01:00
Maksim Kita
077555bd5d Analyzer support build pushing to views chain 2023-02-16 12:17:03 +01:00
Maksim Kita
f73c49b082 Fixed style check 2023-02-16 12:17:03 +01:00
Maksim Kita
f8442b2a8d Analyzer support LiveView 2023-02-16 12:17:03 +01:00
Maksim Kita
5cc56eb108 Analyzer better support for single_join_prefer_left_table setting 2023-02-16 12:17:03 +01:00
Maksim Kita
7e58e23d3a Analyzer subquery resolve fix 2023-02-16 12:17:03 +01:00
Maksim Kita
70eb41c6a8 Analyzer add single_join_prefer_left_table setting 2023-02-16 12:17:03 +01:00
Maksim Kita
caaff8f387 GroupingFunctionsResolvePass crash fix 2023-02-16 12:17:03 +01:00
Maksim Kita
387f035560 QueryTreePassManager add ComparisonTupleEliminationPass 2023-02-16 12:17:03 +01:00
Maksim Kita
a12aea45f6 Analyzer matcher resolve fix 2023-02-16 12:17:02 +01:00
Maksim Kita
8497eba49f Fixed tests 2023-02-16 12:17:02 +01:00
Maksim Kita
cd3e8482ae Analyzer TableFunctionExplain fix 2023-02-16 12:17:02 +01:00
Maksim Kita
2830877e22 Analyzer support table functions 2023-02-16 12:17:02 +01:00
Maksim Kita
8374133123 Analyzer evaluate scalar subquery fix 2023-02-16 12:17:02 +01:00
Maksim Kita
484fc40e64 Analyzer identifier resolution for subcolumns fix 2023-02-16 12:17:02 +01:00
Maksim Kita
25da9dcef7 StorageDistributed Planner initialization fix 2023-02-16 12:17:02 +01:00
Maksim Kita
d3b604de5a FunctionToSubcolumnsPass mapContains map argument result type fix 2023-02-16 12:17:02 +01:00
Maksim Kita
c469e10092 Dictionaries DictionaryStorageFetchRequest fix 2023-02-16 12:17:02 +01:00
Maksim Kita
5b7fb9c458 Analyzer support enable_global_with_statement setting 2023-02-16 12:17:02 +01:00
Maksim Kita
d703c65dbd Analyzer lambda resolve unknown identifier crash fix 2023-02-16 12:17:02 +01:00
Maksim Kita
75876200af Planner disable names projection on shards 2023-02-16 12:17:02 +01:00
Maksim Kita
480619af63 Analyzer ARRAY JOIN disable alias validation for subquery or table function 2023-02-16 12:17:02 +01:00
Maksim Kita
b9cb067153 Analyzer table function arguments resolution fix 2023-02-16 12:17:02 +01:00
Maksim Kita
86ee97aed5 AggregateFunctionsArithmeticOperationsPass disable optimization if both arguments are non constant 2023-02-16 12:17:02 +01:00
Maksim Kita
301d9e22c2 Analyzer change countDistinct function implementation using count_distinct_implementation setting 2023-02-16 12:17:02 +01:00
Maksim Kita
75cbb0e0d0 Analyzer scalar subqueries execution fix 2023-02-16 12:17:02 +01:00
Maksim Kita
fa0ef340b6 Analyzer IN function invalid arguments size error fix 2023-02-16 12:17:02 +01:00
Maksim Kita
0fe3ba36c4 Analyzer added ParitionPruner support 2023-02-16 12:17:02 +01:00
Maksim Kita
45f45b290c Analyzer recursive SQL user defined functions fix 2023-02-16 12:17:02 +01:00
Maksim Kita
9b7710ba40 Analyzer count function handling with unqualified matcher fix 2023-02-16 12:17:02 +01:00
Maksim Kita
8eb93b216b Planner JOIN TREE unused columns drop fix 2023-02-16 12:17:02 +01:00
Maksim Kita
84f3f8e18b Planner UNION different number of columns exception fix 2023-02-16 12:17:02 +01:00