2021-08-26 13:19:52 +00:00
|
|
|
#pragma once
|
2022-12-02 14:05:46 +00:00
|
|
|
|
|
|
|
#include <Core/QualifiedTableName.h>
|
2022-12-10 22:57:14 +00:00
|
|
|
#include <Interpreters/Context_fwd.h>
|
|
|
|
#include <Parsers/IAST_fwd.h>
|
|
|
|
#include <unordered_set>
|
2022-12-02 14:05:46 +00:00
|
|
|
|
2021-08-26 13:19:52 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2021-11-01 18:53:07 +00:00
|
|
|
using TableNamesSet = std::unordered_set<QualifiedTableName>;
|
|
|
|
|
2022-12-02 14:05:46 +00:00
|
|
|
/// Returns a list of all tables explicitly referenced in the create query of a specified table.
|
|
|
|
/// For example, a column default expression can use dictGet() and thus reference a dictionary.
|
2021-09-13 19:11:16 +00:00
|
|
|
/// Does not validate AST, works a best-effort way.
|
2022-12-04 11:33:06 +00:00
|
|
|
TableNamesSet getDependenciesFromCreateQuery(const ContextPtr & context, const QualifiedTableName & table_name, const ASTPtr & ast);
|
2022-12-02 14:05:46 +00:00
|
|
|
|
2021-08-26 13:19:52 +00:00
|
|
|
}
|