Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-11220

Can not Select row time field in JOIN query

    XMLWordPrintableJSON

Details

    Description

      SQL:

      Orders...toTable(tEnv, 'orderId, 'orderTime.rowtime)
      Payment...toTable(tEnv, 'orderId, 'payTime.rowtime)
      
      SELECT orderTime, o.orderId, payTime
        FROM Orders AS o JOIN Payment AS p
        ON o.orderId = p.orderId AND
           p.payTime BETWEEN orderTime AND orderTime + INTERVAL '1' HOUR
      
      

      Execption:

      
      org.apache.flink.table.api.TableException: Found more than one rowtime field: [orderTime, payTime] in the table that should be converted to a DataStream.
      Please select the rowtime field that should be used as event-time timestamp for the DataStream by casting all other fields to TIMESTAMP.
      
      at org.apache.flink.table.api.StreamTableEnvironment.translate(StreamTableEnvironment.scala:906)
      

      The reason for the error is that we have 2 time fields `orderTime` and `payTime`. I think we do not need throw the exception, and we can remove the logic of `plan.process(new OutputRowtimeProcessFunction[A](conversion, rowtimeFields.head.getIndex))`, if we want using the timestamp after toDataSteram, we should using `assignTimestampsAndWatermarks()`.

      What do you think ? twalthr fhueske

      Attachments

        Activity

          People

            Unassigned Unassigned
            sunjincheng121 sunjincheng
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated: