Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.11.0
-
None
Description
Consider the below query
select region.sales_region as c0, region_1.sales_region as c1, sum(sales_fact_1997.unit_sales) as m0 from region as region, store as store, sales_fact_1997 as sales_fact_1997, region as region_1, customer as customer where sales_fact_1997.store_id = store.store_id and store.region_id = region.region_id and region.sales_region = 'South West' and sales_fact_1997.customer_id = customer.customer_id and customer.customer_region_id = region_1.region_id and region_1.sales_region = 'South West' group by region.sales_region, region_1.sales_region
The query fails with the following error-
(org.apache.drill.exec.work.foreman.UnsupportedRelOperatorException) This query cannot be planned possibly due to either a cartesian join or an inequality join
org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.convertToPrel():437
org.apache.drill.exec.planner.sql.handlers.DefaultSqlHandler.getPlan():169
org.apache.drill.exec.planner.sql.DrillSqlWorker.getQueryPlan():131
org.apache.drill.exec.planner.sql.DrillSqlWorker.getPlan():79
org.apache.drill.exec.work.foreman.Foreman.runSQL():991
org.apache.drill.exec.work.foreman.Foreman.run():276
java.util.concurrent.ThreadPoolExecutor.runWorker():1145
java.util.concurrent.ThreadPoolExecutor$Worker.run():615
java.lang.Thread.run():744
This is a regression. It worked with drill 1.10.0
Having a single alias of the table region in the above query works fine.