Skip to content

Commit

Permalink
Merge pull request ClickHouse#53175 from ClickHouse/analyzer-fix-test…
Browse files Browse the repository at this point in the history
…-unique-index

Fix: 00838_unique_index test with analyzer
  • Loading branch information
alexey-milovidov authored Aug 10, 2023
2 parents 20dd081 + 3296daa commit d65ddc6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
13 changes: 6 additions & 7 deletions src/Storages/MergeTree/MergeTreeIndexSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,6 @@ MergeTreeIndexConditionSet::MergeTreeIndexConditionSet(
if (!key_columns.contains(name))
key_columns.insert(name);

ASTPtr ast_filter_node = buildFilterNode(query_info.query);
if (!ast_filter_node)
return;

if (context->getSettingsRef().allow_experimental_analyzer)
{
if (!query_info.filter_actions_dag)
Expand All @@ -280,6 +276,10 @@ MergeTreeIndexConditionSet::MergeTreeIndexConditionSet(
}
else
{
ASTPtr ast_filter_node = buildFilterNode(query_info.query);
if (!ast_filter_node)
return;

if (checkASTUseless(ast_filter_node))
return;

Expand Down Expand Up @@ -457,11 +457,10 @@ const ActionsDAG::Node * MergeTreeIndexConditionSet::operatorFromDAG(const Actio
if (arguments_size != 1)
return nullptr;

auto bit_wrapper_function = FunctionFactory::instance().get("__bitWrapperFunc", context);
const auto & bit_wrapper_func_node = result_dag->addFunction(bit_wrapper_function, {arguments[0]}, {});
const ActionsDAG::Node * argument = &traverseDAG(*arguments[0], result_dag, context, node_to_result_node);

auto bit_swap_last_two_function = FunctionFactory::instance().get("__bitSwapLastTwo", context);
return &result_dag->addFunction(bit_swap_last_two_function, {&bit_wrapper_func_node}, {});
return &result_dag->addFunction(bit_swap_last_two_function, {argument}, {});
}
else if (function_name == "and" || function_name == "indexHint" || function_name == "or")
{
Expand Down
1 change: 0 additions & 1 deletion tests/analyzer_tech_debt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
00725_memory_tracking
00754_distributed_optimize_skip_select_on_unused_shards
00754_distributed_optimize_skip_select_on_unused_shards_with_prewhere
00838_unique_index
00927_asof_joins
00940_order_by_read_in_order_query_plan
00945_bloom_filter_index
Expand Down

0 comments on commit d65ddc6

Please sign in to comment.