ClickHouse/src/Dictionaries/getDictionaryConfigurationFromAST.h
Alexander Tokmakov df56e99b87 fixes after review
2021-09-13 22:11:16 +03:00

28 lines
852 B
C++

#pragma once
#include <Poco/Util/AbstractConfiguration.h>
#include <Parsers/ASTCreateQuery.h>
#include <Interpreters/Context_fwd.h>
namespace DB
{
using DictionaryConfigurationPtr = Poco::AutoPtr<Poco::Util::AbstractConfiguration>;
/// Convert dictionary AST to Poco::AbstractConfiguration
/// This function is necessary because all loadable objects configuration are Poco::AbstractConfiguration
/// Can throw exception if query is ill-formed
DictionaryConfigurationPtr
getDictionaryConfigurationFromAST(const ASTCreateQuery & query, ContextPtr context, const std::string & database_ = "");
struct ClickHouseDictionarySourceInfo
{
QualifiedTableName table_name;
bool is_local = false;
};
std::optional<ClickHouseDictionarySourceInfo>
getInfoIfClickHouseDictionarySource(DictionaryConfigurationPtr & config, ContextPtr global_context);
}