Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3585#discussion_r107879890
  
    --- Diff: 
flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/scala/stream/sql/SqlITCase.scala
 ---
    @@ -317,4 +422,24 @@ class SqlITCase extends StreamingWithStateTestBase {
         result.addSink(new StreamITCase.StringSink)
         env.execute()
       }
    +
    +}
    +
    +object SqlITCase {
    +
    +  class EventTimeSourceFunction[T](
    +      dataWithTimestampList: Seq[Either[(Long, T), Long]]) extends 
SourceFunction[T] {
    +    override def run(ctx: SourceContext[T]): Unit = {
    +      dataWithTimestampList.foreach { x =>
    --- End diff --
    
    can be simplified to
    ```
    dataWithTimestampList.foreach {
      case Left(t) => ctx.collectWithTimestamp(t._2, t._1)
      case Right(w) => ctx.emitWatermark(new Watermark(w))
    }
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to