use of org.apache.flink.table.sources.DefinedRowtimeAttributes in project flink by apache.
the class ConnectorCatalogTable method calculateSourceSchema.
public static <T1> TableSchema calculateSourceSchema(TableSource<T1> source, boolean isBatch) {
TableSchema tableSchema = source.getTableSchema();
if (isBatch) {
return tableSchema;
}
DataType[] types = Arrays.copyOf(tableSchema.getFieldDataTypes(), tableSchema.getFieldCount());
String[] fieldNames = tableSchema.getFieldNames();
if (source instanceof DefinedRowtimeAttributes) {
updateRowtimeIndicators((DefinedRowtimeAttributes) source, fieldNames, types);
}
if (source instanceof DefinedProctimeAttribute) {
updateProctimeIndicator((DefinedProctimeAttribute) source, fieldNames, types);
}
return TableSchema.builder().fields(fieldNames, types).build();
}
Aggregations