Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
None
-
None
-
None
-
None
Description
SELECT *, ( SELECT SUM ( (SELECT SUM ( order_amt ) FROM tb_order t2 WHERE t2.product_id = t0.product_id ) ) FROM tb_order t1 WHERE t1.product_id = t0.product_id ) FROM tb_order t0
to rel
LogicalProject(order_id=[$0], order_amt=[$1], order_date=[$2], desc=[$3], buyer_id=[$4], seller_id=[$5], product_id=[$6], express_id=[$7], EXPR$8=[$9])
LogicalJoin(condition=[=($6, $8)], joinType=[left])
LogicalTableScan(table=[[tb_order]])
LogicalAggregate(group=[{0}], EXPR$0=[SUM($1)])
LogicalProject(product_id0=[$8], EXPR$0=[$9])
LogicalJoin(condition=[true], joinType=[left])
LogicalFilter(condition=[IS NOT NULL($6)])
LogicalTableScan(table=[[tb_order]])
LogicalAggregate(group=[{0}], EXPR$0=[SUM($1)])
LogicalProject(product_id=[$6], order_amt=[$1])
LogicalFilter(condition=[IS NOT NULL($6)])
LogicalTableScan(table=[[tb_order]])
line 6, "LogicalJoin condition=[true]" is going to create a Cartesian product
Attachments
Issue Links
- duplicates
-
CALCITE-5418 Nested Queries are not expanded properly
- Open