环境:flink1.11:
代码如下:
val dataStreamEnv: StreamExecutionEnvironment = FlinkUtils.streamEnv
val tableEnv: StreamTableEnvironment = FlinkUtils.streamTableEnv
val sql = """SELECT
CASE
WHEN
kafka_table.log_type = 'detect'
AND
kafka_table.event_level = 3
THEN 3
ELSE 0
END as weight,
kafka_table.src_ip as kafka_table_src_ip_0,
kafka_table.dev_type as kafka_table_dev_type_0
FROM
kafka_table
WHERE
kafka_table.event_time >= unix_timestamp() - 60 * 60 * 5
AND
kafka_table.src_ip <> null
AND
kafka_table.event_level > 0
AND
kafka_table.dev_type = 1
val data:Table = tableEnv.sqlQuery(sql)
val result = tableEnv.toRetractStream[Row](data)
result.print("====>")
"""
现象:如果判空条件为kafka_table.src_ip <> null,则程序直接结束,没有任何报错,而使用kafka_table.src_ip is
not null 可以正常运行并一直产生数据。
疑问:我明白is not null是正确的用法,问题是用<> null 为什么程序会直接结束而且没有任何报错,感觉像是当作批处理去运行了。
--
Sent from:
http://apache-flink.147419.n8.nabble.com/