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 423D217EFB for ; Wed, 4 Mar 2015 04:36:05 +0000 (UTC) Received: (qmail 53235 invoked by uid 500); 4 Mar 2015 04:36:05 -0000 Delivered-To: apmail-drill-issues-archive@drill.apache.org Received: (qmail 53203 invoked by uid 500); 4 Mar 2015 04:36:05 -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 53191 invoked by uid 99); 4 Mar 2015 04:36:05 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Mar 2015 04:36:05 +0000 Date: Wed, 4 Mar 2015 04:36:05 +0000 (UTC) From: "Abhishek Girish (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (DRILL-2379) UNION ALL with ORDER BY fails when column aliases don't match 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-2379?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Abhishek Girish updated DRILL-2379: ----------------------------------- Attachment: drillbit.log > UNION ALL with ORDER BY fails when column aliases don't match > ------------------------------------------------------------- > > Key: DRILL-2379 > URL: https://issues.apache.org/jira/browse/DRILL-2379 > Project: Apache Drill > Issue Type: Bug > Components: Query Planning & Optimization > Affects Versions: 0.8.0 > Reporter: Abhishek Girish > Assignee: Jinfeng Ni > Attachments: drillbit.log > > > The following query fails to execute: > {code:sql} > SELECT x > FROM > (SELECT Sum(ss_ext_sales_price) x > FROM store_sales > UNION ALL > SELECT Sum(cs_ext_sales_price) y > FROM catalog_sales) tmp > ORDER BY x; > SELECT x > FROM > (SELECT ss_ext_sales_price x > FROM store_sales > UNION ALL > SELECT cs_ext_sales_price y > FROM catalog_sales) tmp > ORDER BY x; > SELECT x > FROM > (SELECT ss_ext_sales_price x > FROM store_sales > UNION ALL > SELECT ss_ext_sales_price y > FROM store_sales) tmp > ORDER BY x; > Error from Drill: > Query failed: RemoteRpcException: Failure while running fragment., Sort doesn't currently support sorts with changing schemas. > java.lang.RuntimeException: java.sql.SQLException: Failure while executing query. > ... > {code} > Log snippet attached. > Changing the alias from 'y' to 'x' in the second sub-query will solve the issue. -- This message was sent by Atlassian JIRA (v6.3.4#6332)