StatementExecutor¶
StatementExecutor is a private static final class of StandaloneExecutor with statement handlers.
Creating Instance¶
StatementExecutor takes the following to be created:
StatementExecutor is created when:
StandaloneExecutoris requested to processesQueryFile and validateStatements
Statement Handlers¶
StatementExecutor creates HANDLERS collection of handlers (functions) of Statements.
| SQL | Statement Class | Handler |
|---|---|---|
| SET | SetProperty | StatementExecutor::handleSetProperty |
| UNSET | UnsetProperty | StatementExecutor::handleUnsetProperty |
| CREATE STREAM | CreateStream | StatementExecutor::handleExecutableDdl |
| CREATE TABLE | CreateTable | StatementExecutor::handleExecutableDdl |
| REGISTER TYPE | RegisterType | StatementExecutor::handleExecutableDdl |
| CREATE STREAM AS SELECT | CreateStreamAsSelect | handlePersistentQuery |
| CREATE TABLE AS SELECT | CreateTableAsSelect | handlePersistentQuery |
| INSERT INTO | InsertInto | handlePersistentQuery |
The HANDLERS is used in execute and generateSupportedMessage.
handlePersistentQuery¶
void handlePersistentQuery(
ConfiguredStatement<?> statement)
handlePersistentQuery handles persistent queries only.
handlePersistentQuery requests the KsqlExecutionContext to execute the given statement (in the ServiceContext) to produce a QueryMetadata.
handlePersistentQuery makes sure that the QueryMetadata is a PersistentQueryMetadata or throws a KsqlStatementException:
Could not build the query
handlePersistentQuery is used when:
StatementExecutoris requested for the HANDLERS (to handle CREATE STREAM AS SELECT, CREATE TABLE AS SELECT and INSERT INTO statements)