【Flink实战系列】Flink SQL 实现interval Join

上一篇是用API实现的interval join,这一篇主要是用Flink sql实现一个interval join,实现的逻辑和上一篇一样,包括最后的返回值都是一样的,直接看下面的代码:

package flink.join

import java.util.TimeZone
import com.alibaba.fastjson.JSON
import flink.util.CommonUtils
import org.apache.flink.api.scala._
import org.apache.flink.streaming.api.TimeCharacteristic
import org.apache.flink.streaming.api.functions.timestamps.BoundedOutOfOrdernessTimestampExtractor
import org.apache.flink.streaming.api.scala.StreamExecutionEnvironment
import org.apache.flink.table.api.TableEnvironment
import org.apache.flink.table.api.scala._
import org.apache.flink.types.Row
import org.apache.flink.streaming.api.windowing.time.Time

/**
  * Flink的interval join的使用
  */
object FlinkSQLIntervalJoin {
  def main(args: Array[String]): Unit = {
    val env = StreamExecutionEnvironment.getExecutionEnvironment
    val tEnv = TableEnvironment.getTableEnvironment(env)
    env.setParallelism(3)
    env.setStreamTimeCharacteristic(T

你可能感兴趣的:(Flink,实战系列,flink)