You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kylin.apache.org by fengbin <fe...@didachuxing.com> on 2018/04/20 10:38:04 UTC
Error result with this SQL
This SQL result is error.
SELECT COUNT(DISTINCT VIEW_TAXI_RIDE.PASSENGER_ID)
FROM VIEW_TAXI_RIDE
WHERE
VIEW_TAXI_RIDE.create_day = '2018-04-10'
AND VIEW_TAXI_RIDE.STATUS IN (6,7)
AND VIEW_TAXI_RIDE.PASSENGER_ID IN
( SELECT DISTINCT v.PASSENGER_ID FROM view_taxi_ride v WHERE v.create_day = '2018-04-11' AND v.STATUS IN (6,7) )
Bug this SQL result is right.
select intersect_count(passenger_id, create_day, array['2018-04-10','2018-04-11']) from VIEW_TAXI_RIDE where STATUS IN (6,7)
Re:Error result with this SQL
Posted by Ma Gang <mg...@163.com>.
This should be a bug, currently Kylin cannot handle such sub-query properly(both outside query and sub-query hit cube). The second sql can work is because there is no subquery exists, and intersect_count is Kylin's udf, you should define bitmap measure for passenger_id column.
At 2018-04-20 18:38:04, "fengbin" <fe...@didachuxing.com> wrote:
>This SQL result is error.
>SELECT COUNT(DISTINCT VIEW_TAXI_RIDE.PASSENGER_ID)
>FROM VIEW_TAXI_RIDE
>WHERE
>VIEW_TAXI_RIDE.create_day = '2018-04-10'
>AND VIEW_TAXI_RIDE.STATUS IN (6,7)
>AND VIEW_TAXI_RIDE.PASSENGER_ID IN
>( SELECT DISTINCT v.PASSENGER_ID FROM view_taxi_ride v WHERE v.create_day = '2018-04-11' AND v.STATUS IN (6,7) )
>
>
>Bug this SQL result is right.
>select intersect_count(passenger_id, create_day, array['2018-04-10','2018-04-11']) from VIEW_TAXI_RIDE where STATUS IN (6,7)