Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
ghx-label-12
Description
In some cases, direct pushing down predicates that reference analytic tuple into inline view leads to incorrect query results. such as sql:
WITH detail_measure AS ( SELECT * FROM ( VALUES ( 1 AS `isqbiuar`, 1 AS `bgsfrbun`, 1 AS `result_type`, 1 AS `bjuzzevg` ), (2, 2, 2, 2) ) a ), order_measure_sql0 AS ( SELECT row_number() OVER ( ORDER BY row_number_0 DESC NULLS LAST, isqbiuar ASC NULLS LAST ) AS `row_number_0`, `isqbiuar` FROM ( VALUES (1 AS `row_number_0`, 1 AS `isqbiuar`), (2, 2) ) b ) SELECT detail_measure.`isqbiuar` AS `isqbiuar`, detail_measure.`bgsfrbun` AS `bgsfrbun`, detail_measure.`result_type` AS `result_type`, detail_measure.`bjuzzevg` AS `bjuzzevg`, `row_number_0` AS `row_number_0` FROM detail_measure LEFT JOIN order_measure_sql0 ON order_measure_sql0.isqbiuar = detail_measure.isqbiuar WHERE row_number_0 BETWEEN 1 AND 1 ORDER BY `row_number_0` ASC NULLS LAST, `bgsfrbun` ASC NULLS LAST
The current query result is:
The correct query result is: