use of io.confluent.ksql.execution.streams.timestamp.TimestampExtractionPolicy in project ksql by confluentinc.
the class SourceBuilderUtils method timestampExtractor.
static TimestampExtractor timestampExtractor(final KsqlConfig ksqlConfig, final LogicalSchema sourceSchema, final Optional<TimestampColumn> timestampColumn, final SourceStep<?> streamSource, final RuntimeBuildContext buildContext) {
final TimestampExtractionPolicy timestampPolicy = TimestampExtractionPolicyFactory.create(ksqlConfig, sourceSchema, timestampColumn);
final Optional<Column> tsColumn = timestampColumn.map(TimestampColumn::getColumn).map(c -> sourceSchema.findColumn(c).orElseThrow(IllegalStateException::new));
final QueryContext queryContext = streamSource.getProperties().getQueryContext();
return timestampPolicy.create(tsColumn, ksqlConfig.getBoolean(KsqlConfig.KSQL_TIMESTAMP_THROW_ON_INVALID), buildContext.getProcessingLogger(queryContext));
}
Aggregations