Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

As a result, #connect has been deprecated sind Flink 1.11. In this FLIP, we want to propose a new API to programmatically define sources and sinks on the Table API without having to switch to SQL DDL.

Public Interfaces

InterfaceChangeComment
TableEnvironment
#connectRemoveDeprecated since Flink 1.11
#createTable(path, TableDescriptor)New
#createTemporaryTable(path, TableDescriptor)New
#from(TableDescriptor)New
Table
#executeInsert(TableDescriptor)New
Other
ConnectTableDescriptorRemove
BatchTableDescriptorRemove
StreamTableDescriptorRemove
ConnectorDescriptorRemove
TableDescriptorRefactor
  • Removed in its current form
  • Name is re-used for the new API
RowtimeRemove


TableEnvironment#createTable & TableEnvironment#createTemporaryTable

...

Code Block
languagejava
titleTableDescriptor
collapsetrue
TableDescriptor {
  // Create a builder
  static TableDescriptorBuilder forConnector(String connector);
  
  @Nullable Schema getSchema();
  Map<String, String> getOptions();
  @Nullable String getComment();
  List<String> getPartitionKeys();
  @Nullable TableLikeDescriptor getLikeDescriptor();
}

TableDescriptorBuilder<SELF> {
  SELF schema(Schema schema);
  
  SELF comment(String comment);

  SELF option<T>(ConfigOption<T> configOption, T value);
  SELF option(String key, String value);

  SELF format(String format);
  SELF format(ConfigOption<?> formatOption, String format);  
  SELF format(FormatDescriptor formatDescriptor);
  SELF format(ConfigOption<?> formatOption, FormatDescriptor formatDescriptor);
  
  SELF partitionedBy(String... partitionKeys);
  
  SELF like(String tableName, LikeOption... likeOptions);
  
  TableDescriptor build();
}

TableLikeDescriptor {
  String getTableName();
  List<TableLikeOption> getLikeOptions();
}

FormatDescriptor {
  static FormatDescriptorBuilder forFormat(String format);
  
  String getFormat();
  Map<String, String> getOptions();
}

FormatDescriptorBuilder<SELF> {
  SELF option<T>(ConfigOption<T> configOption, T value);
  SELF option(String key, String value);
  FormatDescriptor build();
}

interface LikeOption {
	enum INCLUDING implements LikeOption {
		ALL,
		CONSTRAINTS,
		GENERATED,
		OPTIONS,
		PARTITIONS,
		WATERMARKS
	}

	enum EXCLUDING implements LikeOption {
		ALL,
		CONSTRAINTS,
		GENERATED,
		OPTIONS,
		PARTITIONS,
		WATERMARKS
	}

	enum OVERWRITING implements LikeOption {
		GENERATED,
		OPTIONS,
		WATERMARKS
	}
}

...