I figured this out.  I get this behavior because I was running the code in
a minicluster test that defaulted to batch.  I switched to streaming and it
renders "*ROWTIME*".

On Fri, Nov 25, 2022 at 11:51 PM Dan Hill <quietgol...@gmail.com> wrote:

> Hi.  I copied the Flink code from this page.  My printSchema() does not
> contain **ROWTIME** in the output.  I'm running Flink v1.14.4.
>
>
> https://nightlies.apache.org/flink/flink-docs-release-1.14/docs/dev/table/data_stream_api/
>
>
>
> public static class User {...}
>
> DataStream<User> dataStream =
>         env.fromElements(
>                 new User("Alice", 4, Instant.ofEpochMilli(1000)),
>                 new User("Bob", 6, Instant.ofEpochMilli(1001)),
>                 new User("Alice", 10, Instant.ofEpochMilli(1002)));
>
> Table table =
>         tableEnv.fromDataStream(
>                 dataStream,
>                 Schema.newBuilder()
>                         .columnByExpression("rowtime", "CAST(event_time AS 
> TIMESTAMP_LTZ(3))")
>                         .watermark("rowtime", "rowtime - INTERVAL '10' 
> SECOND")
>                         .build());
> table.printSchema();
>
>
> Actual: this printSchema prints the following:
>
> (
>     `name` STRING,
>     `score` INT,
>     `event_time` TIMESTAMP_LTZ(9),
>     `rowtime` TIMESTAMP_LTZ(3) AS CAST(event_time AS TIMESTAMP_LTZ(3)),
>     WATERMARK FOR `rowtime`: TIMESTAMP_LTZ(3) AS rowtime - INTERVAL '10' 
> SECOND
> )
>
> Expected: the Flink docs say there should be a **ROWTIME** in the schema
> details for rowtime.
>
>
>
>
>

Reply via email to