代码之家  ›  专栏  ›  技术社区  ›  Tom

尚不支持处理时间临时连接

  •  0
  • Tom  · 技术社区  · 5 年前

    我正在使用Flink 1.12.0,并且正在阅读 https://ci.apache.org/projects/flink/flink-docs-stable/dev/table/streaming/joins.html#processing-time-temporal-join 。看起来支持处理时间时态连接。

    但是,当我运行以下应用程序时,它会抱怨 Processing-time temporal join is not supported yet 。我很困惑这是代码错误还是Flink真的不支持处理时间时态连接。

    val env = StreamExecutionEnvironment.getExecutionEnvironment
        env.setParallelism(1)
        val tenv = StreamTableEnvironment.create(env)
    
        val ddl1 =
          """
          create table s1(
          id STRING,
          tradeDate TIMESTAMP,
          price DOUBLE,
          pt as PROCTIME()
          ) with (
            'connector' = 'filesystem',
            'path' = 'D:/T018_LookupJoin_stock.csv',
            'format' = 'csv'
          )
          """.stripMargin(' ')
    
    
        tenv.executeSql(ddl1)
    
    
        val ddl2 =
          """
          create table s2(
          id STRING primary key not enforced,
          name STRING,
          tradeDate TIMESTAMP
          ) with (
            'connector' = 'filesystem',
            'path' = 'D:/T018_LookupJoin_stocktimechanging.csv',
            'format' = 'csv'
          )
          """.stripMargin(' ')
    
    
        tenv.executeSql(ddl2)
    
        val sql =
          """
          select s1.id ,s1.price, s1.tradeDate, u.name, u.tradeDate
          from s1 join s2 for SYSTEM_TIME as of s1.pt as u
          on s1.id = u.id
          """.stripMargin(' ')
    
        tenv.sqlQuery(sql).toAppendStream[Row].print()
    
        env.execute()
    
      }
    
    0 回复  |  直到 5 年前