Skip to content

CreateSourceProperties

Creating Instance

CreateSourceProperties takes the following to be created:

  • Originals (Map<String, Literal>)
  • Duration Parser (Function<String, Duration>)

CreateSourceProperties is created using from factory and when:

While being created, CreateSourceProperties creates a PropertiesConfig and performs parameter validations.

Creating CreateSourceProperties

CreateSourceProperties from(
  Map<String, Literal> literals)

from creates a CreateSourceProperties (with the given literals and the default DurationParser).


from is used when:

PropertiesConfig

When created, CreateSourceProperties creates a PropertiesConfig with the following table-specific configuration properties (in addition to CommonCreateConfigs).

SOURCE_CONNECTOR

Indicates that this source was created by a connector with the given name.

Default: null

WINDOW_SIZE

Window size of HOPPING or TUMBLING windows, e.g. 20 SECONDS

Default: null

WINDOW_TYPE

Supported values:

  • SESSION
  • HOPPING
  • TUMBLING

Default: null

Key Format

Optional<FormatInfo> getKeyFormat(
  SourceName name)

getKeyFormat determines the name of the format based on the value of FORMAT property (if specified) or defaults to KEY_FORMAT property (from the PropertiesConfig).

In the end, getKeyFormat creates a FormatInfo with the format name and the key format properties (if specified).


getKeyFormat is used when:

  • DefaultFormatInjector is requested for injectForCreateStatement
  • SourcePropertiesUtil is requested to getKeyFormat

Key Format Properties

Map<String, String> getKeyFormatProperties(
  String keyFormat,
  String name)

getKeyFormatProperties...FIXME

KEY_SCHEMA_ID

Optional<Integer> getKeySchemaId()

getKeySchemaId is the value of KEY_SCHEMA_ID property.


getKeySchemaId is used when:

  • DefaultSchemaInjector is requested to forCreateStatement, getKeySchema, addSchemaFields
  • CreateSourceProperties is requested to getKeyFormatProperties

Value Format

Optional<FormatInfo> getValueFormat()

getValueFormat determines the name of the format based on the value of FORMAT property (if specified) or defaults to VALUE_FORMAT property (from the PropertiesConfig).

In the end, getKeyFormat creates a FormatInfo with the format name and the value format properties (if specified).


getValueFormat is used when:

  • DefaultFormatInjector is requested to injectForCreateStatement
  • SourcePropertiesUtil is requested to getValueFormat

Value Format Properties

Map<String, String> getValueFormatProperties(
  String valueFormat)

getValueFormatProperties defines the value format properties for various formats (in one go).

Property Value
delimiter VALUE_DELIMITER property if specified
fullSchemaName VALUE_AVRO_SCHEMA_FULL_NAME or VALUE_SCHEMA_FULL_NAME if either is specified
schemaId VALUE_SCHEMA_ID if specified
unwrapPrimitives true (only if the given valueFormat is PROTOBUF and the unwrapProtobufPrimitives flag is enabled)

VALUE_SCHEMA_ID

Optional<Integer> getValueSchemaId()

getValueSchemaId is the value of VALUE_SCHEMA_ID property.


getValueSchemaId is used when:

  • CreateSourceFactory is requested to createTableCommand
  • CreateSourceProperties is requested to getValueFormatProperties
  • DefaultSchemaInjector is requested to forCreateStatement, getValueSchema, addSchemaFields