@PublicEvolving
public interface CatalogDynamicTable extends CatalogTable {
/**
* CreatesThe definition anquery instancetext of {@linkdynamic CatalogDynamicTable}table.
Text is expanded in *
contrast to the original SQL.
* @param schema unresolved schema
* This is needed because *the @paramcontext commentsuch optionalas comment
current DB is lost after *the @paramsession, partitionKeysin listwhich
of partition keys or an* emptyview listis ifdefined, notis partitioned
gone. Expanded query text takes *care @paramof options options to configure the connector
* @param snapshot table snapshot of the table
* @param definitionQuery definition sql query
* @param freshness data freshness
* @param refreshMode data refresh mode
* @param refreshJobInfo refresh job handler
*/
static CatalogDynamicTable of(
Schema schema,
@Nullable String comment,
List<String> partitionKeys,
Map<String, String> options,
@Nullable Long snapshot,
String definitionQuery,
String freshness,
RefreshMode refreshMode,
RefreshJobHandler refreshJobHandler) {
return new DefaultCatalogDynamicTable(
schema,
comment,
partitionKeys,
options,
snapshot,
definitionQuery,
freshness,
refreshMode,
refreshJobHandler);
}
/**
* The definition query text of dynamic table. Text is expanded in contrast to the original SQL.
* This is needed because the context such as current DB is lost after the session, in which
* view is defined, is gone. Expanded query text takes care of this, as this, as an example.
*
* <p>For example, for a dynamic table that is defined in the context of "default" database with
* a query {@code select * from test1}, the expanded query text might become {@code select
* `test1`.`name`, `test1`.`value` from `default`.`test1`}, where table test1 resides in
* database "default" and has two columns ("name" and "value").
*
* @return the dynamic table definition in expanded text.
*/
String getDefinitionQuery();
/** Get the freshness of the dynamic table which is used to determine the data refresh mode. */
StringDuration getFreshness();
/** Get the refresh mode of the dynamic table. */
RefreshMode getRefreshMode();
/** Get the refresh handler of the dynamic table. */
RefreshJobHandlerRefreshHandler getRefreshHandler();
/** The refresh mode of the dynamic table. */
@PublicEvolving
enum RefreshMode {
CONTINUOUS,
FULL,
}
} |