Skip to content

DdlCommandExec.Executor

DdlCommandExec.Executor is an Executor.

DdlCommandExec.Executor is a private (internal) class of DdlCommandExec.

Creating Instance

DdlCommandExec.Executor takes the following to be created:

  • SQL statement
  • withQuery flag
  • Query Sources
  • restoreInProgress flag

DdlCommandExec.Executor is created when:

Executing AlterSourceCommand

DdlCommandResult executeAlterSource(
  AlterSourceCommand alterSource)

executeAlterSource is part of the Executor abstraction.


executeAlterSource uses the name of the given AlterSourceCommand to look up the DataSource in the MetaStore.

executeAlterSource adds new columns to the LogicalSchema of the data source.

executeAlterSource requests the MetaStore to register the altered data source.

KsqlExceptions

executeAlterSource throws a KsqlException if the data source could not be found:

Source [name] does not exist.

executeAlterSource throws a KsqlException when the data source types do not match:

Incompatible data source type is [type], but statement was ALTER [type]

executeAlterSource throws a KsqlException when the data source isCasTarget:

ALTER command is not supported for CREATE ... AS statements.

executeAlterSource throws a KsqlException if the name of a new column already exists:

Cannot add column [name] to schema. A column with the same name already exists.

Executing CreateStreamCommand

DdlCommandResult executeCreateStream(
  CreateStreamCommand createStream)

executeCreateStream is part of the Executor abstraction.


executeCreateStream uses the name of the given CreateStreamCommand to look up the DataSource in the MetaStore.

executeCreateStream creates a KsqlStream.

executeCreateStream registers the KsqlStream (as a new data source) in the MetaStore.

executeCreateStream addSourceReferences for the KsqlStream with the withQuerySources in the MetaStore.