Return-Path: X-Original-To: apmail-drill-dev-archive@www.apache.org Delivered-To: apmail-drill-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4B63517E07 for ; Mon, 26 Jan 2015 17:54:35 +0000 (UTC) Received: (qmail 74345 invoked by uid 500); 26 Jan 2015 17:54:35 -0000 Delivered-To: apmail-drill-dev-archive@drill.apache.org Received: (qmail 74284 invoked by uid 500); 26 Jan 2015 17:54:35 -0000 Mailing-List: contact dev-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 dev@drill.apache.org Received: (qmail 74234 invoked by uid 99); 26 Jan 2015 17:54:35 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Jan 2015 17:54:35 +0000 Date: Mon, 26 Jan 2015 17:54:35 +0000 (UTC) From: "Victoria Markman (JIRA)" To: dev@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (DRILL-2069) Star is not expanded correctly in the query with IN clause containing subquery MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Victoria Markman created DRILL-2069: --------------------------------------- Summary: Star is not expanded correctly in the query with IN clause containing subquery Key: DRILL-2069 URL: https://issues.apache.org/jira/browse/DRILL-2069 Project: Apache Drill Issue Type: Bug Components: Query Planning & Optimization Affects Versions: 0.8.0 Reporter: Victoria Markman Assignee: Jinfeng Ni t1.json {code} { "a1": "aa", "b1": 1 } { "a1": "bb", "b1": 2 } { "a1": "cc", "b1": 3 } {code} t2.json {code} { "a2": "aa", "b2": 1 } { "a2": "bb", "b2": 2 } { "a2": "xx", "b2": 10 } {code} Star is expanded incorrectly, we should get only columns from `t1.json` {code} 0: jdbc:drill:schema=dfs> select * from `t1.json` where a1 in (select a2 from `t2.json`); +------------+------------+------------+------------+ | a2 | a1 | b1 | a10 | +------------+------------+------------+------------+ | aa | aa | 1 | aa | | bb | bb | 2 | bb | +------------+------------+------------+------------+ 2 rows selected (0.172 seconds) {code} explain plan {code} 00-01 Project(*=[$0]) 00-02 Project(*=[$0]) 00-03 HashJoin(condition=[=($1, $2)], joinType=[inner]) 00-05 Project(*=[$0], a1=[$1]) 00-07 Scan(groupscan=[EasyGroupScan [selectionRoot=/test/t1.json, numFiles=1, columns=[`*`], files=[maprfs:/test/t1.json]]]) 00-04 HashAgg(group=[{0}]) 00-06 Scan(groupscan=[EasyGroupScan [selectionRoot=/test/t2.json, numFiles=1, columns=[`a2`], files=[maprfs:/test/t2.json]]]) {code} Workaround - specify columns explicitly {code} 0: jdbc:drill:schema=dfs> select t1.a1, t1.a1 from `t1.json` t1 where t1.a1 in (select t2.a2 from `t2.json` t2); +------------+------------+ | a1 | a10 | +------------+------------+ | aa | aa | | bb | bb | +------------+------------+ 2 rows selected (0.24 seconds) {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)