Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 67A702009EE for ; Wed, 18 May 2016 11:10:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 666B6160A1B; Wed, 18 May 2016 09:10:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B73321609B1 for ; Wed, 18 May 2016 11:10:13 +0200 (CEST) Received: (qmail 49172 invoked by uid 500); 18 May 2016 09:10:13 -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 49146 invoked by uid 99); 18 May 2016 09:10:12 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 May 2016 09:10:12 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id D228A2C14E1 for ; Wed, 18 May 2016 09:10:12 +0000 (UTC) Date: Wed, 18 May 2016 09:10:12 +0000 (UTC) From: "Egbert van der Veen (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (DRILL-4684) Incorrect behavior when joining RDBMS table on itself MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 18 May 2016 09:10:14 -0000 [ https://issues.apache.org/jira/browse/DRILL-4684?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Egbert van der Veen updated DRILL-4684: --------------------------------------- Attachment: actual result.png expected result.png > Incorrect behavior when joining RDBMS table on itself > ----------------------------------------------------- > > Key: DRILL-4684 > URL: https://issues.apache.org/jira/browse/DRILL-4684 > Project: Apache Drill > Issue Type: Bug > Reporter: Egbert van der Veen > Attachments: actual result.png, expected result.png > > > When joining a RDBMS table on itself (for instance; with a table that contains both subitems and main items), Drill fails to correctly retrieve the result columns. This has been tested using both MySQL and PostgreSQL databases as storage providers. > Code to reproduce: > ``` > CREATE TABLE `join_test` ( > `id` int(11) NOT NULL, > `type` varchar(50) DEFAULT NULL, > `mainItem` int(11) DEFAULT NULL, > `description` varchar(255) DEFAULT NULL, > PRIMARY KEY (`id`), > UNIQUE KEY `id` (`id`) > ) ; > INSERT INTO join_test (id, type, mainItem, description) VALUES (1, 'mainItem', null, 'First main item'); > INSERT INTO join_test (id, type, mainItem, description) VALUES (2, 'subItem', 1, 'First subitem of first main item'); > INSERT INTO join_test (id, type, mainItem, description) VALUES (3, 'subItem', 1, 'Second subitem of first main item'); > SELECT main.type firsttype, main.description firstdescription, sub.type secondtype, sub.description seconddescription > FROM join_test sub > JOIN join_test main ON sub.mainItem = main.id > ``` -- This message was sent by Atlassian JIRA (v6.3.4#6332)