public final class SchemaBuilderUtil extends Object
Modifier and Type | Method and Description |
---|---|
static org.apache.flink.table.api.Schema.Builder |
createEventStreamSchemaBuilder(EventStream eventStream)
Given an EventStream, converts its latest schema to
Flink columns and returns a new Schema.Builder with all columns.
|
static org.apache.flink.table.api.Schema.Builder |
createEventStreamSchemaBuilder(EventStream eventStream,
String schemaVersion)
Given an EventStream, converts its schema at the given version to
Flink columns and returns a new Schema.Builder with all columns.
|
static org.apache.flink.table.api.Schema.Builder |
withKafkaTimestampAsWatermark(org.apache.flink.table.api.Schema.Builder schemaBuilder)
Adds a "kafka_timestamp" column to the schema builder and uses
it as the watermark field with a default watermark delay of 10 seconds.
|
static org.apache.flink.table.api.Schema.Builder |
withKafkaTimestampAsWatermark(org.apache.flink.table.api.Schema.Builder schemaBuilder,
String columnName,
int watermarkDelaySeconds)
Adds kafka timestamp as a virtual column to the schema builder
and uses it as the watermark with a delay of watermarkDelaySeconds.
|
static org.apache.flink.table.api.Schema.Builder |
withKafkaTimestampAsWatermark(org.apache.flink.table.api.Schema.Builder schemaBuilder,
String columnName,
String sqlExpression)
Adds kafka timestamp as a virtual column to the schema builder
and uses it as the watermark.
|
public static org.apache.flink.table.api.Schema.Builder createEventStreamSchemaBuilder(EventStream eventStream)
public static org.apache.flink.table.api.Schema.Builder createEventStreamSchemaBuilder(EventStream eventStream, String schemaVersion)
@Nonnull public static org.apache.flink.table.api.Schema.Builder withKafkaTimestampAsWatermark(org.apache.flink.table.api.Schema.Builder schemaBuilder)
@Nonnull public static org.apache.flink.table.api.Schema.Builder withKafkaTimestampAsWatermark(org.apache.flink.table.api.Schema.Builder schemaBuilder, String columnName, int watermarkDelaySeconds)
columnName
- Name of the timestamp column to add to the schema.watermarkDelaySeconds
- Seconds to delay the watermark by.@Nonnull public static org.apache.flink.table.api.Schema.Builder withKafkaTimestampAsWatermark(org.apache.flink.table.api.Schema.Builder schemaBuilder, String columnName, String sqlExpression)
Schema.Builder#watermark(String, String)
columnName
- Name of the column to add to the schema.sqlExpression
- SQL expression to use for the watermark.
This should probably refer to the columnName, e.g. "$columnName - INTERVAL '30' seconds"Copyright © 2024. All rights reserved.