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 C16F417BCC for ; Tue, 3 Feb 2015 21:19:34 +0000 (UTC) Received: (qmail 6288 invoked by uid 500); 3 Feb 2015 21:19:35 -0000 Delivered-To: apmail-drill-issues-archive@drill.apache.org Received: (qmail 6264 invoked by uid 500); 3 Feb 2015 21:19:35 -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 6253 invoked by uid 99); 3 Feb 2015 21:19:35 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Feb 2015 21:19:35 +0000 Date: Tue, 3 Feb 2015 21:19:35 +0000 (UTC) From: "Sean Hsuan-Yi Chu (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-2012) Flatten fails when we filter by a non-projected column 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-2012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14304013#comment-14304013 ] Sean Hsuan-Yi Chu commented on DRILL-2012: ------------------------------------------ Jason, because it is about flatten operator, can you help take a look on this one? > Flatten fails when we filter by a non-projected column > ------------------------------------------------------- > > Key: DRILL-2012 > URL: https://issues.apache.org/jira/browse/DRILL-2012 > Project: Apache Drill > Issue Type: Bug > Components: Query Planning & Optimization > Reporter: Rahul Challapalli > Assignee: Jason Altekruse > Priority: Critical > Attachments: Plan.txt, error.log > > > git.commit.id.abbrev=b491cdb > {code} > { > "id": "0001", > "type": "donut", > "name": "Cake", > "ppu": 0.55, > "batters": > { > "batter": > [ > { "id": "1001", "type": "Regular" }, > { "id": "1002", "type": "Chocolate" }, > { "id": "1003", "type": "Blueberry" }, > { "id": "1004", "type": "Devil's Food" } > ] > }, > "topping": > [ > { "id": "5001", "type": "None" }, > { "id": "5002", "type": "Glazed" }, > { "id": "5005", "type": "Sugar" }, > { "id": "5007", "type": "Powdered Sugar" }, > { "id": "5006", "type": "Chocolate with Sprinkles" }, > { "id": "5003", "type": "Chocolate" }, > { "id": "5004", "type": "Maple" } > ] > } > {code} > The below query fails : > {code} > select j.id id, j.name name, flatten(j.topping) tt, flatten(j.batters.batter) bb from `sample.json` j where j.type = 'donut'; > Query failed: Query failed: Failure while running fragment., Trying to flatten a non-repeated filed. [ 98ff5db0-4aa7-4f65-9a7a-93ae8bc41f6b on qa-node190.qa.lab:31010 ] > [ 98ff5db0-4aa7-4f65-9a7a-93ae8bc41f6b on qa-node190.qa.lab:31010 ] > {code} > However if I include the filter column in the list of selected columns, then the query succeeds. > {code} > select j.type, j.id id, j.name name, flatten(j.topping) tt, flatten(j.batters.batter) bb from `user.json` j where j.type = 'donut'; > +------------+------------+------------+------------+------------+ > | type | id | name | tt | bb | > +------------+------------+------------+------------+------------+ > | donut | 0001 | Cake | {"id":"5001","type":"None"} | {"id":"1001","type":"Regular"} | > | donut | 0001 | Cake | {"id":"5001","type":"None"} | {"id":"1002","type":"Chocolate"} | > | donut | 0001 | Cake | {"id":"5001","type":"None"} | {"id":"1003","type":"Blueberry"} | > | donut | 0001 | Cake | {"id":"5001","type":"None"} | {"id":"1004","type":"Devil's Food"} | > | donut | 0001 | Cake | {"id":"5002","type":"Glazed"} | {"id":"1001","type":"Regular"} | > | donut | 0001 | Cake | {"id":"5002","type":"Glazed"} | {"id":"1002","type":"Chocolate"} | > | donut | 0001 | Cake | {"id":"5002","type":"Glazed"} | {"id":"1003","type":"Blueberry"} | > | donut | 0001 | Cake | {"id":"5002","type":"Glazed"} | {"id":"1004","type":"Devil's Food"} | > | donut | 0001 | Cake | {"id":"5005","type":"Sugar"} | {"id":"1001","type":"Regular"} | > | donut | 0001 | Cake | {"id":"5005","type":"Sugar"} | {"id":"1002","type":"Chocolate"} | > | donut | 0001 | Cake | {"id":"5005","type":"Sugar"} | {"id":"1003","type":"Blueberry"} | > | donut | 0001 | Cake | {"id":"5005","type":"Sugar"} | {"id":"1004","type":"Devil's Food"} | > | donut | 0001 | Cake | {"id":"5007","type":"Powdered Sugar"} | {"id":"1001","type":"Regular"} | > | donut | 0001 | Cake | {"id":"5007","type":"Powdered Sugar"} | {"id":"1002","type":"Chocolate"} | > | donut | 0001 | Cake | {"id":"5007","type":"Powdered Sugar"} | {"id":"1003","type":"Blueberry"} | > | donut | 0001 | Cake | {"id":"5007","type":"Powdered Sugar"} | {"id":"1004","type":"Devil's Food"} | > | donut | 0001 | Cake | {"id":"5006","type":"Chocolate with Sprinkles"} | {"id":"1001","type":"Regular"} | > | donut | 0001 | Cake | {"id":"5006","type":"Chocolate with Sprinkles"} | {"id":"1002","type":"Chocolate"} | > | donut | 0001 | Cake | {"id":"5006","type":"Chocolate with Sprinkles"} | {"id":"1003","type":"Blueberry"} | > | donut | 0001 | Cake | {"id":"5006","type":"Chocolate with Sprinkles"} | {"id":"1004","type":"Devil's Food"} | > | donut | 0001 | Cake | {"id":"5003","type":"Chocolate"} | {"id":"1001","type":"Regular"} | > | donut | 0001 | Cake | {"id":"5003","type":"Chocolate"} | {"id":"1002","type":"Chocolate"} | > | donut | 0001 | Cake | {"id":"5003","type":"Chocolate"} | {"id":"1003","type":"Blueberry"} | > | donut | 0001 | Cake | {"id":"5003","type":"Chocolate"} | {"id":"1004","type":"Devil's Food"} | > | donut | 0001 | Cake | {"id":"5004","type":"Maple"} | {"id":"1001","type":"Regular"} | > | donut | 0001 | Cake | {"id":"5004","type":"Maple"} | {"id":"1002","type":"Chocolate"} | > | donut | 0001 | Cake | {"id":"5004","type":"Maple"} | {"id":"1003","type":"Blueberry"} | > | donut | 0001 | Cake | {"id":"5004","type":"Maple"} | {"id":"1004","type":"Devil's Food"} | > {code} > I attached the relevant log file. -- This message was sent by Atlassian JIRA (v6.3.4#6332)