pyflink的where该如何使用?如何筛选?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

pyflink的where该如何使用?如何筛选?

洗你的头
尊敬的开发者您好:我想要在输出表中进行条件筛选,使用了where语句,结果不行
我的代码如下:
# 处理流程
t_env.from_path('mySource') \
    .select("pickup_datetime, dropoff_datetime, pickup_longitude, pickup_latitude, dropoff_longitude, dropoff_latitude, distance_meters(pickup_longitude, pickup_latitude) as O, distance_meters(dropoff_longitude, dropoff_latitude) as D, compute_duration_time(pickup_datetime, dropoff_datetime) as duration") \
&nbsp; &nbsp; .where("duration &gt;= 120 &amp;&amp; duration <= 3600") \
&nbsp; &nbsp; .select("pickup_datetime, dropoff_datetime, pickup_longitude, pickup_latitude, dropoff_longitude, dropoff_latitude, O, D, is_same_od(O, D) as same_od, duration") \
&nbsp; &nbsp; .where("same_od == 0") \
&nbsp; &nbsp; .select("pickup_datetime, dropoff_datetime, pickup_longitude, pickup_latitude, dropoff_longitude, dropoff_latitude, O, D, duration") \
&nbsp; &nbsp; .insert_into('mySink')
请问我这样使用where为什么不行呢?我应该如何去筛选出想要的结果呢?
(尝试了去掉where是可以正常运行的)