Skip to content

DefaultKsqlParser

DefaultKsqlParser is a KsqlParser.

Creating Instance

DefaultKsqlParser takes no arguments to be created.

DefaultKsqlParser is created when:

Parsing SQL Statements (parse)

List<ParsedStatement> parse(
  String sql)

parse parses the given sql (using ANTLR) and creates as many ParsedStatements as there are SQL statements in the sql.

ANTLR

This is when a SQL text is parsed (transformed) using ANTLR into a collection of ksqlDB's ParsedStatements according to the SqlBase.g4 grammar:

statements
    : (singleStatement)* EOF
    ;

Every ParsedStatements maps exactly to a singleStatement.

parse is part of the KsqlParser abstraction.

Preparing Statement for Execution

PreparedStatement<?> prepare(
  ParsedStatement stmt,
  TypeRegistry typeRegistry)

prepare creates an AstBuilder (with the given TypeRegistry) to build a Statement.

In the end, prepare creates a PreparedStatement (with the SQL query in text format and as the Statement).


prepare is part of the KsqlParser abstraction.

Back to top