Hi,

你说的不行,指的是运行报错了(如果报错了,可以贴下错误的日志),还是出来的结果不符合预期(是不生效,还是啥的)。

Best,
Xingbo

洗你的头 <[email protected]> 于2020年11月1日周日 上午10:16写道:

> 尊敬的开发者您好:我想要在输出表中进行条件筛选,使用了where语句,结果不行
> 我的代码如下:
> # 处理流程
> t_env.from_path('mySource') \
> &nbsp; &nbsp; .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是可以正常运行的)

回复