From 887b49649c62bd21f660ecf33a00b8448a9109c0 Mon Sep 17 00:00:00 2001 From: Dmitry Novik Date: Mon, 2 Sep 2024 14:59:17 +0200 Subject: [PATCH] Small refactoring --- src/Analyzer/Resolve/QueryAnalyzer.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/Analyzer/Resolve/QueryAnalyzer.cpp b/src/Analyzer/Resolve/QueryAnalyzer.cpp index 0d5f02586b6..36e0a21356f 100644 --- a/src/Analyzer/Resolve/QueryAnalyzer.cpp +++ b/src/Analyzer/Resolve/QueryAnalyzer.cpp @@ -4515,19 +4515,7 @@ void QueryAnalyzer::resolveTableFunction(QueryTreeNodePtr & table_function_node, TableFunctionPtr table_function_ptr = TableFunctionFactory::instance().tryGet(table_function_name, scope_context); if (!table_function_ptr) { - String database_name = scope_context->getCurrentDatabase(); - String table_name; - - Identifier table_identifier{table_function_name}; - if (table_identifier.getPartsSize() == 1) - { - table_name = table_identifier[0]; - } - else if (table_identifier.getPartsSize() == 2) - { - database_name = table_identifier[0]; - table_name = table_identifier[1]; - } + auto [database_name, table_name] = extractDatabaseAndTableNameForParametrizedView(table_function_name, scope_context); /// Collect parametrized view arguments NameToNameMap view_params;