You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by "Abhishek Girish (JIRA)" <ji...@apache.org> on 2015/02/26 03:33:05 UTC

[jira] [Created] (DRILL-2318) Query fails when an ORDER BY clause is used with CTEs

Abhishek Girish created DRILL-2318:
--------------------------------------

             Summary: Query fails when an ORDER BY clause is used with CTEs 
                 Key: DRILL-2318
                 URL: https://issues.apache.org/jira/browse/DRILL-2318
             Project: Apache Drill
          Issue Type: Bug
          Components: Query Planning & Optimization
    Affects Versions: 0.8.0
            Reporter: Abhishek Girish
            Assignee: Jinfeng Ni


Adding a WITH clause with a simple CTE causes a query with an ORDER BY to fail. This happens even when the CTE is unrelated to the main query. 

*The following query fails to execute:*
{code:sql}
WITH 
     x
     AS (SELECT  ss_sold_date_sk a1
         FROM  store_sales) 
SELECT  x.a1
FROM   x
ORDER  BY 
          x.a1;
{code}

The following query executes fine:
{code:sql}
WITH 
     x
     AS (SELECT  ss_sold_date_sk a1
         FROM  store_sales) 
SELECT  x.a1
FROM   x
{code}




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