diff --git a/src/Core/Settings.h b/src/Core/Settings.h index c60d6511abc..2c45108f9a5 100644 --- a/src/Core/Settings.h +++ b/src/Core/Settings.h @@ -627,7 +627,7 @@ class IColumn; \ M(Bool, optimize_rewrite_sum_if_to_count_if, false, "Rewrite sumIf() and sum(if()) function countIf() function when logically equivalent", 0) \ M(Bool, optimize_rewrite_aggregate_function_with_if, true, "Rewrite aggregate functions with if expression as argument when logically equivalent. For example, avg(if(cond, col, null)) can be rewritten to avgIf(cond, col)", 0) \ - M(Bool, optimize_rewrite_array_exists_to_has, true, "Rewrite arrayExists() functions to has() when logically equivalent. For example, arrayExists(x -> x = 1, arr) can be rewritten to has(arr, 1)", 0) \ + M(Bool, optimize_rewrite_array_exists_to_has, false, "Rewrite arrayExists() functions to has() when logically equivalent. For example, arrayExists(x -> x = 1, arr) can be rewritten to has(arr, 1)", 0) \ M(UInt64, insert_shard_id, 0, "If non zero, when insert into a distributed table, the data will be inserted into the shard `insert_shard_id` synchronously. Possible values range from 1 to `shards_number` of corresponding distributed table", 0) \ \ M(Bool, collect_hash_table_stats_during_aggregation, true, "Enable collecting hash table statistics to optimize memory allocation", 0) \ diff --git a/tests/queries/0_stateless/02896_optimize_array_exists_to_has_with_date.reference b/tests/queries/0_stateless/02896_optimize_array_exists_to_has_with_date.reference new file mode 100644 index 00000000000..d00491fd7e5 --- /dev/null +++ b/tests/queries/0_stateless/02896_optimize_array_exists_to_has_with_date.reference @@ -0,0 +1 @@ +1 diff --git a/tests/queries/0_stateless/02896_optimize_array_exists_to_has_with_date.sql b/tests/queries/0_stateless/02896_optimize_array_exists_to_has_with_date.sql new file mode 100644 index 00000000000..b87a154b46a --- /dev/null +++ b/tests/queries/0_stateless/02896_optimize_array_exists_to_has_with_date.sql @@ -0,0 +1 @@ +SELECT arrayExists(date -> (date = '2022-07-31'), [toDate('2022-07-31')]) AS date_exists;