mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-30 11:32:03 +00:00
Fix more tests.
This commit is contained in:
parent
8cec00dd6e
commit
c740328426
@ -1420,11 +1420,14 @@ FutureSetPtr ActionsMatcher::makeSet(const ASTFunction & node, Data & data, bool
|
||||
return data.prepared_sets->addFromStorage(set_key, storage_set->getSet());
|
||||
}
|
||||
|
||||
// std::cerr << ".... checking for " << identifier->getColumnName() << std::endl;
|
||||
if (auto tmp_table = data.getContext()->findExternalTable(identifier->getColumnName()))
|
||||
if (!data.getContext()->isGlobalContext())
|
||||
{
|
||||
external_table_set = tmp_table->future_set;
|
||||
// std::cerr << "Found " << reinterpret_cast<const void *>(tmp_table.get()) << " " << reinterpret_cast<const void *>(external_table_set.get()) << std::endl;
|
||||
// std::cerr << ".... checking for " << identifier->getColumnName() << std::endl;
|
||||
if (auto tmp_table = data.getContext()->findExternalTable(identifier->getColumnName()))
|
||||
{
|
||||
external_table_set = tmp_table->future_set;
|
||||
// std::cerr << "Found " << reinterpret_cast<const void *>(tmp_table.get()) << " " << reinterpret_cast<const void *>(external_table_set.get()) << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -90,6 +90,8 @@ public:
|
||||
in_second_argument_node_type == QueryTreeNodeType::UNION)
|
||||
{
|
||||
auto set_key = PreparedSetKey::forSubquery(in_second_argument->getTreeHash());
|
||||
if (sets.getFuture(set_key))
|
||||
return;
|
||||
|
||||
auto subquery_options = select_query_options.subquery();
|
||||
Planner subquery_planner(
|
||||
|
@ -1236,6 +1236,15 @@ static void buildIndexes(
|
||||
if (!indexes->use_skip_indexes)
|
||||
return;
|
||||
|
||||
const SelectQueryInfo * info = &query_info;
|
||||
std::optional<SelectQueryInfo> info_copy;
|
||||
if (settings.allow_experimental_analyzer)
|
||||
{
|
||||
info_copy.emplace(query_info);
|
||||
info_copy->filter_actions_dag = filter_actions_dag;
|
||||
info = &*info_copy;
|
||||
}
|
||||
|
||||
UsefulSkipIndexes skip_indexes;
|
||||
using Key = std::pair<String, size_t>;
|
||||
std::map<Key, size_t> merged;
|
||||
@ -1249,14 +1258,14 @@ static void buildIndexes(
|
||||
if (inserted)
|
||||
{
|
||||
skip_indexes.merged_indices.emplace_back();
|
||||
skip_indexes.merged_indices.back().condition = index_helper->createIndexMergedCondition(query_info, metadata_snapshot);
|
||||
skip_indexes.merged_indices.back().condition = index_helper->createIndexMergedCondition(*info, metadata_snapshot);
|
||||
}
|
||||
|
||||
skip_indexes.merged_indices[it->second].addIndex(index_helper);
|
||||
}
|
||||
else
|
||||
{
|
||||
auto condition = index_helper->createIndexCondition(query_info, context);
|
||||
auto condition = index_helper->createIndexCondition(*info, context);
|
||||
if (!condition->alwaysUnknownOrTrue())
|
||||
skip_indexes.useful_indices.emplace_back(index_helper, condition);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user