Persistent Queries¶
Persistent Queries (per PersistentQueryType
) can be the following queries:
When Analyzer is requested to analyze a query it creates a Visitor with a flag to indicate whether the sink is defined or not for persistent queries.
CREATE_SOURCE¶
CREATE_SOURCE
s don't write to a topic (so EngineExecutor
does not have to check for read-only topics the other query types could attempt to write to).
It is forbidden to terminate CREATE_SOURCE
queries when linked to a source table (and ValidatedCommandFactory
throws a KsqlStatementException):
Cannot terminate query '[queryId]' because it is linked to a source table.
EngineExecutor
will not execute CREATE_SOURCE
plans when ksql.source.table.materialization.enabled is disabled and prints out the following INFO message to the logs instead:
Source table query '[statementText]' won't be materialized because 'ksql.source.table.materialization.enabled' is disabled.
CREATE_SOURCE
is used when:
KsqlPlanV1
is requested for the getPersistentQueryType (with the queryPlan and the ddlCommand specified as a sourceCreateTableCommand
)QueryBuilder
is requested to buildPersistentQueryInDedicatedRuntime and buildPersistentQueryInSharedRuntimeQueryRegistryImpl
is requested to registerPersistentQuery and unregisterQuery