1 | #include <iostream> |
---|---|
2 | |
3 | #include <Parsers/ASTCreateQuery.h> |
4 | #include <Parsers/ParserCreateQuery.h> |
5 | #include <Parsers/formatAST.h> |
6 | #include <Parsers/parseQuery.h> |
7 | |
8 | |
9 | int main(int, char **) |
10 | { |
11 | using namespace DB; |
12 | |
13 | std::string input = "CREATE TABLE hits (URL String, UserAgentMinor2 FixedString(2), EventTime DateTime) ENGINE = Log"; |
14 | ParserCreateQuery parser; |
15 | ASTPtr ast = parseQuery(parser, input.data(), input.data() + input.size(), "", 0); |
16 | |
17 | formatAST(*ast, std::cerr); |
18 | std::cerr << std::endl; |
19 | |
20 | return 0; |
21 | } |
22 |