Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
1.10.0
-
None
-
NA
Description
JDBC adapter generates wrong SQL if set operation (UNION, INTERSECT or MINUS) has more than two inputs. In union example, after UnionMergeRule, the union input is convert to three input, and rel-to-sql convert result is wrong.
input sql
SELECT * FROM (SELECT \"product_id\" FROM \"foodmart\".\"product\" UNION ALL SELECT \"product_id\" FROM \"foodmart\".\"sales_fact_1997\") UNION ALL SELECT \"product_class_id\" AS \"PRODUCT_ID\" FROM \"foodmart\".\"product_class\"
output sql
SELECT \"product_id\" FROM \"foodmart\".\"product\" UNION ALL SELECT \"product_id\" FROM \"foodmart\".\"sales_fact_1997\"
the last union query is lost.