Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-12251 Rework the Table API & SQL type system
  3. FLINK-17481

Cannot set LocalDateTime column as rowtime when converting DataStream to Table

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Table SQL / API
    • Labels:
      None

      Description

      I am trying to convert an embedded LocalDateTime timestamp into a rowtime column while converting from DataStream to table.

      DataStream<Tuple1<LocalDateTime>> in = env.fromElements(Tuple1.of(LocalDateTime.now()))
       .returns(new TupleTypeInfo<>(LocalTimeTypeInfo.getInfoFor(LocalDateTime.class)));
      
      tableEnv.sqlQuery("select * FROM " + tableEnv.fromDataStream(in, "f0.rowtime"));

      Unfortunately this leads to the following error:

      org.apache.flink.table.api.ValidationException: The rowtime attribute can only replace a field with a valid time type, such as Timestamp or Long. But was: LocalDateTime

      It seems that only java.sql.Timestamp classes are supported for rowtime conversion now.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              gyfora Gyula Fora
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: