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 C925517A88 for ; Fri, 13 Mar 2015 23:02:39 +0000 (UTC) Received: (qmail 29704 invoked by uid 500); 13 Mar 2015 23:02:39 -0000 Delivered-To: apmail-drill-issues-archive@drill.apache.org Received: (qmail 29560 invoked by uid 500); 13 Mar 2015 23:02:39 -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 29434 invoked by uid 99); 13 Mar 2015 23:02:39 -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 23:02:39 +0000 Date: Fri, 13 Mar 2015 23:02:39 +0000 (UTC) From: "Jinfeng Ni (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (DRILL-2398) IS NOT DISTINCT FROM predicate returns incorrect result when used as a join filter 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-2398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jinfeng Ni updated DRILL-2398: ------------------------------ Assignee: Aman Sinha (was: Jinfeng Ni) > IS NOT DISTINCT FROM predicate returns incorrect result when used as a join filter > ---------------------------------------------------------------------------------- > > Key: DRILL-2398 > URL: https://issues.apache.org/jira/browse/DRILL-2398 > Project: Apache Drill > Issue Type: Bug > Components: Query Planning & Optimization > Reporter: Victoria Markman > Assignee: Aman Sinha > Priority: Critical > Fix For: 0.9.0 > > Attachments: j1.parquet, j2.parquet > > > count(*) should return 0 and not NULL > {code} > 0: jdbc:drill:schema=dfs> select > . . . . . . . . . . . . > count(*) > . . . . . . . . . . . . > from > . . . . . . . . . . . . > j1 INNER JOIN j2 ON > . . . . . . . . . . . . > ( j1.c_double = j2.c_double) > . . . . . . . . . . . . > where > . . . . . . . . . . . . > j1.c_bigint IS NOT DISTINCT FROM j2.c_bigint > . . . . . . . . . . . . > ; > +------------+ > | EXPR$0 | > +------------+ > +------------+ > {code} > These are the values in the table > {code} > 0: jdbc:drill:schema=dfs> select j1.c_bigint, j2.c_bigint, count(*) from j1 INNER JOIN j2 ON (j1.c_double = j2.c_double) group by j1.c_bigint, j2.c_bigint; > +------------+------------+------------+ > | c_bigint | c_bigint1 | EXPR$1 | > +------------+------------+------------+ > | 460194667 | -498749284 | 1 | > | 464547172 | -498828740 | 1 | > | 467451850 | -498966611 | 2 | > | 471050029 | -499154096 | 3 | > | 472873799 | -499233550 | 3 | > | 475698977 | -499395929 | 2 | > | 478986584 | -499564607 | 1 | > | 488139464 | -499763274 | 3 | > | 498214699 | -499871720 | 2 | > +------------+------------+------------+ > 9 rows selected (0.339 seconds) > {code} > IS DISTINCT FROM predicate returns correct result > {code} > select > count(*) > from > j1 INNER JOIN j2 ON > ( j1.c_double = j2.c_double) > where > j1.c_bigint IS DISTINCT FROM j2.c_bigint > {code} > Explain plan for query that returns incorrect result: > {code} > 00-01 StreamAgg(group=[{}], EXPR$0=[COUNT()]) > 00-02 Project($f0=[0]) > 00-03 SelectionVectorRemover > 00-04 Filter(condition=[CAST(CASE(IS NULL($1), IS NULL($3), IS NULL($3), IS NULL($1), =($1, $3))):BOOLEAN NOT NULL]) > 00-05 HashJoin(condition=[=($0, $2)], joinType=[inner]) > 00-07 Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath [path=maprfs:/joins/j1]], selectionRoot=/joins/j1, numFiles=1, columns=[`c_double`, `c_bigint`]]]) > 00-06 Project(c_double0=[$0], c_bigint0=[$1]) > 00-08 Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath [path=maprfs:/joins/j2]], selectionRoot=/joins/j2, numFiles=1, columns=[`c_double`, `c_bigint`]]]) > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)