2016-05-13 03:22:16 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
2020-02-21 13:44:44 +00:00
|
|
|
#include <Parsers/IAST_fwd.h>
|
2016-05-13 03:22:16 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2017-06-02 21:37:28 +00:00
|
|
|
/// Get the cluster name from AST.
|
|
|
|
/** The name of the cluster is the name of the tag in the xml configuration.
|
|
|
|
* Usually it is parsed as an identifier. That is, it can contain underscores, but can not contain hyphens,
|
|
|
|
* provided that the identifier is not in backquotes.
|
|
|
|
* But in xml, as a tag name, it's more common to use hyphens.
|
|
|
|
* This name will be parsed as an expression with an operator minus - not at all what you need.
|
|
|
|
* Therefore, consider this case separately.
|
2016-05-13 03:22:16 +00:00
|
|
|
*/
|
2021-01-26 18:45:36 +00:00
|
|
|
std::string getClusterName(const IAST & node);
|
2022-12-10 23:43:42 +00:00
|
|
|
std::optional<std::string> tryGetClusterName(const IAST & node);
|
2020-02-21 13:44:44 +00:00
|
|
|
|
2021-01-26 18:45:36 +00:00
|
|
|
std::string getClusterNameAndMakeLiteral(ASTPtr & node);
|
2016-05-13 03:22:16 +00:00
|
|
|
|
|
|
|
}
|