[ 
https://issues.apache.org/jira/browse/DRILL-3018?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Victoria Markman updated DRILL-3018:
------------------------------------
    Description: 
This is a regression.
Both queries worked and returned correct result with May 7 build
(mapr-drill-1.0.0.31658-1.noarch.rpm)

Running with the latest build, I got these two failures:
{code}
select * from j2 where c_integer > (select min(c_bigint) from j7 where 
c_boolean is null)
Failed with exception
java.sql.SQLException: SYSTEM ERROR: 
org.apache.drill.exec.work.foreman.UnsupportedRelOperatorException: This query 
cannot be planned possibly due to either a cartesian join or an inequality

select * from j2 where c_float < (select min(c_float) from j6 where c_boolean 
is null )
Failed with exception
java.sql.SQLException: SYSTEM ERROR: 
org.apache.drill.exec.work.foreman.UnsupportedRelOperatorException: This query 
cannot be planned possibly due to either a cartesian join or an inequality join 
{code}

The common pattern between these queries is that function MIN is running over 
no rows, in both queries there is no correlation to the outer table.
{code}
-- Non correlated
-- Greater than
-- MIN returns NULL
select * from j2 where c_integer > (select min(c_bigint) from j7 where 
c_boolean is null);

-- Non correlated
-- Less than
-- MIN returns NULL
select * from j2 where c_float < (select min(c_float) from j6 where c_boolean 
is null );
{code}


  was:
This is a regression.
Both queries worked and returned correct result with May 7 build
(mapr-drill-1.0.0.31658-1.noarch.rpm)

Running with the latest build, I got these two failures:
{code}
select * from j2 where c_integer > (select min(c_bigint) from j7 where 
c_boolean is null)
Failed with exception
java.sql.SQLException: SYSTEM ERROR: 
org.apache.drill.exec.work.foreman.UnsupportedRelOperatorException: This query 
cannot be planned possibly due to either a cartesian join or an inequality

select * from j2 where c_float < (select min(c_float) from j6 where c_boolean 
is null )
Failed with exception
java.sql.SQLException: SYSTEM ERROR: 
org.apache.drill.exec.work.foreman.UnsupportedRelOperatorException: This query 
cannot be planned possibly due to either a cartesian join or an inequality join 
{code}

The common pattern between these queries is that function MIN is running over 
no rows, in both queries there is no correlation to the outer table.
{code}
-- Non correlated
-- Greater than
-- MIN returns NULL
select * from j2 where c_integer > (select min(c_bigint) from j7 where 
c_boolean is null);

-- Non correlated
-- Less than
-- MIN returns NULL
select * from j2 where c_float < (select min(c_float) from j6 where c_boolean 
is null );
{code}

QA run details for the reference: 
http://10.10.104.91:8080/job/Run%20Regression%20QA%20Changes/359/console


> Queries with scalar aggregate  and non equality (non correlated) fail to plan
> -----------------------------------------------------------------------------
>
>                 Key: DRILL-3018
>                 URL: https://issues.apache.org/jira/browse/DRILL-3018
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>    Affects Versions: 1.0.0
>            Reporter: Victoria Markman
>
> This is a regression.
> Both queries worked and returned correct result with May 7 build
> (mapr-drill-1.0.0.31658-1.noarch.rpm)
> Running with the latest build, I got these two failures:
> {code}
> select * from j2 where c_integer > (select min(c_bigint) from j7 where 
> c_boolean is null)
> Failed with exception
> java.sql.SQLException: SYSTEM ERROR: 
> org.apache.drill.exec.work.foreman.UnsupportedRelOperatorException: This 
> query cannot be planned possibly due to either a cartesian join or an 
> inequality
> select * from j2 where c_float < (select min(c_float) from j6 where c_boolean 
> is null )
> Failed with exception
> java.sql.SQLException: SYSTEM ERROR: 
> org.apache.drill.exec.work.foreman.UnsupportedRelOperatorException: This 
> query cannot be planned possibly due to either a cartesian join or an 
> inequality join 
> {code}
> The common pattern between these queries is that function MIN is running over 
> no rows, in both queries there is no correlation to the outer table.
> {code}
> -- Non correlated
> -- Greater than
> -- MIN returns NULL
> select * from j2 where c_integer > (select min(c_bigint) from j7 where 
> c_boolean is null);
> -- Non correlated
> -- Less than
> -- MIN returns NULL
> select * from j2 where c_float < (select min(c_float) from j6 where c_boolean 
> is null );
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to