Skip to content

CreateSourceFactory

Creating Instance

CreateSourceFactory takes the following to be created:

CreateSourceFactory is created alongside a CommandFactories.

ValueSerdeFactory

CreateSourceFactory is given a ValueSerdeFactory when created.

The ValueSerdeFactory is used in validateSerdesCanHandleSchemas.

Creating CreateStreamCommand

createStreamCommand can create a CreateStreamCommand for a CreateStream statement or a KsqlStructuredDataOutputNode.

CreateStream

CreateStreamCommand createStreamCommand(
  CreateStream statement,
  KsqlConfig ksqlConfig)

createStreamCommand ensureTopicExists, buildSchema and buildTimestampColumn.

createStreamCommand requests the MetaStore for the DataSource for the given CreateStream.

createStreamCommand throwIfCreateOrReplaceOnSourceStreamOrTable.

In the end, createStreamCommand creates a CreateStreamCommand.


createStreamCommand is used when:

KsqlStructuredDataOutputNode

CreateStreamCommand createStreamCommand(
  KsqlStructuredDataOutputNode outputNode)

createStreamCommand creates a CreateStreamCommand for the given KsqlStructuredDataOutputNode (with the isSource flag disabled).

createStreamCommand is used when:

  • CommandFactories is requested to create

Creating CreateTableCommand

CreateTableCommand createTableCommand(
  CreateTable statement,
  KsqlConfig ksqlConfig)

createTableCommand...FIXME

createTableCommand is used when:

throwIfCreateOrReplaceOnSourceStreamOrTable

void throwIfCreateOrReplaceOnSourceStreamOrTable(
  CreateSource createSource,
  DataSource existingSource)

throwIfCreateOrReplaceOnSourceStreamOrTable throws a KsqlException when the given CreateSource is as follows:

  1. CREATE OR REPLACE
  2. SOURCE or the given DataSource is a source
Cannot add [stream|table] '[source-name]':
CREATE OR REPLACE is not supported on source [stream|table]s.

throwIfCreateOrReplaceOnSourceStreamOrTable is used when:

buildFormats

Formats buildFormats(
  SourceName name,
  LogicalSchema schema,
  CreateSourceProperties props,
  KsqlConfig ksqlConfig)

buildFormats...FIXME

buildFormats is used when: