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 233B71864C for ; Fri, 26 Jun 2015 17:54:05 +0000 (UTC) Received: (qmail 87370 invoked by uid 500); 26 Jun 2015 17:54:04 -0000 Delivered-To: apmail-drill-issues-archive@drill.apache.org Received: (qmail 87231 invoked by uid 500); 26 Jun 2015 17:54:04 -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 87056 invoked by uid 99); 26 Jun 2015 17:54:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Jun 2015 17:54:04 +0000 Date: Fri, 26 Jun 2015 17:54:04 +0000 (UTC) From: "Venki Korukanti (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-3377) Can't partition by expression when columns are explicitly specified in the CTAS column list 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-3377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14603305#comment-14603305 ] Venki Korukanti commented on DRILL-3377: ---------------------------------------- +1 > Can't partition by expression when columns are explicitly specified in the CTAS column list > ------------------------------------------------------------------------------------------- > > Key: DRILL-3377 > URL: https://issues.apache.org/jira/browse/DRILL-3377 > Project: Apache Drill > Issue Type: Bug > Components: Query Planning & Optimization > Affects Versions: 1.0.0 > Reporter: Victoria Markman > Assignee: Venki Korukanti > Labels: ctas > Attachments: 0001-DRILL-3377-Fix-naming-resolution-error-for-partition.patch > > > Query below throws an error: > {code:sql} > create table test(x1, x2) partition by (x1) as > select sum(a1), b1 > from t1 > group by b1; > {code} > {code} > 0: jdbc:drill:schema=dfs> create table test(x1, x2) partition by (x1) as select sum(a1), b1 from t1 group by b1; > Error: SYSTEM ERROR: IllegalArgumentException: partition col x1 could not be resolved in table's column lists! > [Error Id: ab5624e8-e4dd-4752-95af-8bc2eef5d056 on atsqa4-133.qa.lab:31010] (state=,code=0) > {code} > When column aliases are used, it works: > {code} > 0: jdbc:drill:schema=dfs> create table test partition by (x1) as select sum(a1) x1, b1 x2 from t1 group by b1; > +-----------+----------------------------+ > | Fragment | Number of records written | > +-----------+----------------------------+ > | 0_0 | 10 | > +-----------+----------------------------+ > 1 row selected (0.904 seconds) > 0: jdbc:drill:schema=dfs> select * from test; > +-------+--------+ > | x1 | x2 | > +-------+--------+ > | null | hhhhh | > | 2 | bbbbb | > | 10 | jjjjj | > | 1 | aaaaa | > | 3 | ccccc | > | 4 | null | > | 5 | eeeee | > | 7 | ggggg | > | 6 | fffff | > | 9 | iiiii | > +-------+--------+ > 10 rows selected (0.161 seconds) > 0: jdbc:drill:schema=dfs> select * from test order by x1; > +-------+--------+ > | x1 | x2 | > +-------+--------+ > | 1 | aaaaa | > | 2 | bbbbb | > | 3 | ccccc | > | 4 | null | > | 5 | eeeee | > | 6 | fffff | > | 7 | ggggg | > | 9 | iiiii | > | 10 | jjjjj | > | null | hhhhh | > +-------+--------+ > 10 rows selected (0.299 seconds) > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)