Page properties |
---|
Discussion thread |
|
---|
Vote thread |
|
---|
JIRA |
---|
|
Status
Current state: "Accepted"
Discussion thread: http://apache-flink-mailing-list-archive.1008284.n3.nabble.com/DISCUSS-FLIP-107-Reading-table-columns-from-different-parts-of-source-records-td38277.html
...
| Jira |
---|
server | ASF JIRA |
---|
serverId | 5aa69414-a9e9-3523-82ec-879b028fb15b |
---|
key | FLINK-15869 |
---|
|
|
---|
|
...
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
...
We propose to extend the `Schema` class from FLIP-129 by:
// for `offset INT METADATA` SchemaBuilder.columnByMetadata(String, DataType) // for `offset INT METADATA VIRTUAL` SchemaBuilder.columnByMetadata(String, DataType, boolean isVirtual) // for `myOffset INT METADATA FROM 'offset' VIRTUAL` SchemaBuilder.columnByMetadata(String, DataType, String) SchemaBuilder.columnByMetadata(String, DataType, String, boolean isVirtual) |
An example would look like:
.schema(Schema.newBuilder() .column("user_id", DataTypes.BIGINT()) .column("user_name", DataTypes.STRING()) .columnByMetadata("offset", DataTypes.INT()) .columnByMetadata("myOffset", DataTypes.INT(), "offset") .watermark("ts", $("ts").minus(lit(3).seconds())) .primaryKey("user_id") .build() ) |
LIKE clause
Currently, the LIKE clause offers the following table features:
...
The following example shows how to overwrite a metadata column with another metadata column:
CREATE TABLE t (i INT, s STRING, timestamp TIMESTAMP(3) WITH LOCAL TIME ZONE METADATA FROM 'timestamp', d DOUBLE);
CREATE TABLE t (timestamp TIMESTAMP(3) WITH LOCAL TIME ZONE METADATA FROM 'other-system.timestamp') WITH (...) LIKE t ( INCLUDING ALL OVERWRITING OPTIONS OVERWRITING METADATA ) |
Reading metadata via DynamicTableSource
...