ClickHouse Parses SQL with a Backtracking Recursive-Descent Parser
ClickHouse’s SQL parser is a set of combinators that share one position, rewind it on failure, and budget every rewind.
ClickHouse’s SQL parser is a set of combinators that share one position, rewind it on failure, and budget every rewind.
ClickHouse’s parser unquotes identifiers, splits compound names, guesses the table qualifier and builds parameter nodes before the analyzer runs.
The ClickHouse AST is a tree of 32-byte reference-counted nodes with a bit-packed flag word and an iterative destructor.