From f3398f9908214f8d5ab06c5c625f2cf9f006364b Mon Sep 17 00:00:00 2001 From: Nikolai Kochetov Date: Mon, 19 Jun 2023 12:17:52 +0000 Subject: [PATCH] Try to make more consisten type check for sets. --- src/Storages/MergeTree/RPNBuilder.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Storages/MergeTree/RPNBuilder.cpp b/src/Storages/MergeTree/RPNBuilder.cpp index 1acc3ec6ce9..d7dd7ff3654 100644 --- a/src/Storages/MergeTree/RPNBuilder.cpp +++ b/src/Storages/MergeTree/RPNBuilder.cpp @@ -384,8 +384,11 @@ FutureSetPtr RPNBuilderTreeNode::tryGetPreparedSet( if (node_without_alias->column) { auto future_set = tryGetSetFromDAGNode(node_without_alias); + if (const auto * from_subquery = typeid_cast(future_set.get())) + return future_set; + auto set_types = future_set->getTypes(); - if (types_match(future_set->getTypes())) + if (types_match(set_types)) return future_set; } }