Return-Path: X-Original-To: apmail-drill-issues-archive@minotaur.apache.org Delivered-To: apmail-drill-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 00EB1179C7 for ; Fri, 13 Mar 2015 22:43:39 +0000 (UTC) Received: (qmail 73969 invoked by uid 500); 13 Mar 2015 22:43:38 -0000 Delivered-To: apmail-drill-issues-archive@drill.apache.org Received: (qmail 73939 invoked by uid 500); 13 Mar 2015 22:43:38 -0000 Mailing-List: contact issues-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list issues@drill.apache.org Received: (qmail 73928 invoked by uid 99); 13 Mar 2015 22:43:38 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Mar 2015 22:43:38 +0000 Date: Fri, 13 Mar 2015 22:43:38 +0000 (UTC) From: "Jinfeng Ni (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (DRILL-2318) Query fails when an ORDER BY clause is used with CTEs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DRILL-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jinfeng Ni updated DRILL-2318: ------------------------------ Fix Version/s: 0.9.0 > 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 > Fix For: 0.9.0 > > Attachments: drillbit.log > > > 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} > Error: > Query failed: SqlValidatorException: Table 'x' not found > Log attached. > *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)