You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Yiwen Tu (Jira)" <ji...@apache.org> on 2020/04/16 06:42:00 UTC

[jira] [Created] (FLINK-17179) Set row time attribute not working in connector descriptor

Yiwen Tu created FLINK-17179:
--------------------------------

             Summary: Set row time attribute not working in connector descriptor
                 Key: FLINK-17179
                 URL: https://issues.apache.org/jira/browse/FLINK-17179
             Project: Flink
          Issue Type: Bug
          Components: Connectors / Kafka, Table SQL / API
    Affects Versions: 1.10.0
            Reporter: Yiwen Tu
         Attachments: image-2020-04-16-14-40-14-219.png

Read data from kafka and set row time attribute in connector descriptor like this:

fsTableEnv.connect(new Kafka()
 .version("universal")
 .topic("stg_rljghxx_damo")
 .property()

...
 ).withFormat(new Json()
 .schema(Types.ROW(new String[]\{"FaceID", "faceQuality","ShotTime"},
 new TypeInformation[]\{Types.STRING(),Types.FLOAT(), Types.INT()})))
 .withSchema(new Schema()
 .field("FaceID", Types.STRING())
 .field("faceQuality",Types.FLOAT())
 .field("ShotTime", Types.INT()).rowtime(new Rowtime().timestampsFromField("ShotTime")))
 .createTemporaryTable("my_table");

 

And then use field of ShotTime as event time in  window like this:

Table result = table.window(Session.withGap("2.minutes").on("ShotTime").as("w")).groupBy("w, ..")
 .select(..);

And throws an error:

!image-2020-04-16-14-40-14-219.png!

And When use DDL in sql,

it works.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)