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 4CC0D200D27 for ; Wed, 25 Oct 2017 12:52:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4B129160BDA; Wed, 25 Oct 2017 10:52:07 +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 6A1DB1609E5 for ; Wed, 25 Oct 2017 12:52:06 +0200 (CEST) Received: (qmail 62913 invoked by uid 500); 25 Oct 2017 10:52:05 -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 62904 invoked by uid 99); 25 Oct 2017 10:52:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Oct 2017 10:52:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id D38D61A1275 for ; Wed, 25 Oct 2017 10:52:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Z_nR2PKqj_3t for ; Wed, 25 Oct 2017 10:52:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 880575F3E1 for ; Wed, 25 Oct 2017 10:52:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 735FAE0FC2 for ; Wed, 25 Oct 2017 10:52:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 3A34921300 for ; Wed, 25 Oct 2017 10:52:00 +0000 (UTC) Date: Wed, 25 Oct 2017 10:52:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-5878) TableNotFound exception is being reported for a wrong storage plugin. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 25 Oct 2017 10:52:07 -0000 [ https://issues.apache.org/jira/browse/DRILL-5878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16218394#comment-16218394 ] ASF GitHub Bot commented on DRILL-5878: --------------------------------------- Github user arina-ielchiieva commented on a diff in the pull request: https://github.com/apache/drill/pull/996#discussion_r146815141 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/SqlConverter.java --- @@ -481,6 +485,19 @@ public RelOptTableImpl getTable(final List names) { .message("Temporary tables usage is disallowed. Used temporary table name: %s.", names) .build(logger); } + + // Check the schema and throw a valid SchemaNotFound exception instead of TableNotFound exception. --- End diff -- Could you please factor out this logic in a separate method? > TableNotFound exception is being reported for a wrong storage plugin. > --------------------------------------------------------------------- > > Key: DRILL-5878 > URL: https://issues.apache.org/jira/browse/DRILL-5878 > Project: Apache Drill > Issue Type: Bug > Components: SQL Parser > Affects Versions: 1.11.0 > Reporter: Hanumath Rao Maduri > Assignee: Hanumath Rao Maduri > Priority: Minor > Fix For: 1.12.0 > > > Drill is reporting TableNotFound exception for a wrong storage plugin. > Consider the following query where employee.json is queried using cp plugin. > {code} > 0: jdbc:drill:zk=local> select * from cp.`employee.json` limit 10; > +--------------+--------------------+-------------+------------+--------------+-------------------------+-----------+----------------+-------------+------------------------+----------+----------------+-------------------+-----------------+---------+--------------------+ > | employee_id | full_name | first_name | last_name | position_id | position_title | store_id | department_id | birth_date | hire_date | salary | supervisor_id | education_level | marital_status | gender | management_role | > +--------------+--------------------+-------------+------------+--------------+-------------------------+-----------+----------------+-------------+------------------------+----------+----------------+-------------------+-----------------+---------+--------------------+ > | 1 | Sheri Nowmer | Sheri | Nowmer | 1 | President | 0 | 1 | 1961-08-26 | 1994-12-01 00:00:00.0 | 80000.0 | 0 | Graduate Degree | S | F | Senior Management | > | 2 | Derrick Whelply | Derrick | Whelply | 2 | VP Country Manager | 0 | 1 | 1915-07-03 | 1994-12-01 00:00:00.0 | 40000.0 | 1 | Graduate Degree | M | M | Senior Management | > | 4 | Michael Spence | Michael | Spence | 2 | VP Country Manager | 0 | 1 | 1969-06-20 | 1998-01-01 00:00:00.0 | 40000.0 | 1 | Graduate Degree | S | M | Senior Management | > | 5 | Maya Gutierrez | Maya | Gutierrez | 2 | VP Country Manager | 0 | 1 | 1951-05-10 | 1998-01-01 00:00:00.0 | 35000.0 | 1 | Bachelors Degree | M | F | Senior Management | > | 6 | Roberta Damstra | Roberta | Damstra | 3 | VP Information Systems | 0 | 2 | 1942-10-08 | 1994-12-01 00:00:00.0 | 25000.0 | 1 | Bachelors Degree | M | F | Senior Management | > | 7 | Rebecca Kanagaki | Rebecca | Kanagaki | 4 | VP Human Resources | 0 | 3 | 1949-03-27 | 1994-12-01 00:00:00.0 | 15000.0 | 1 | Bachelors Degree | M | F | Senior Management | > | 8 | Kim Brunner | Kim | Brunner | 11 | Store Manager | 9 | 11 | 1922-08-10 | 1998-01-01 00:00:00.0 | 10000.0 | 5 | Bachelors Degree | S | F | Store Management | > | 9 | Brenda Blumberg | Brenda | Blumberg | 11 | Store Manager | 21 | 11 | 1979-06-23 | 1998-01-01 00:00:00.0 | 17000.0 | 5 | Graduate Degree | M | F | Store Management | > | 10 | Darren Stanz | Darren | Stanz | 5 | VP Finance | 0 | 5 | 1949-08-26 | 1994-12-01 00:00:00.0 | 50000.0 | 1 | Partial College | M | M | Senior Management | > | 11 | Jonathan Murraiin | Jonathan | Murraiin | 11 | Store Manager | 1 | 11 | 1967-06-20 | 1998-01-01 00:00:00.0 | 15000.0 | 5 | Graduate Degree | S | M | Store Management | > +--------------+--------------------+-------------+------------+--------------+-------------------------+-----------+----------------+-------------+------------------------+----------+----------------+-------------------+-----------------+---------+--------------------+ > {code} > However if cp1 is used instead of cp then Drill reports TableNotFound exception. > {code} > 0: jdbc:drill:zk=local> select * from cp1.`employee.json` limit 10; > Oct 16, 2017 1:40:02 PM org.apache.calcite.sql.validate.SqlValidatorException > SEVERE: org.apache.calcite.sql.validate.SqlValidatorException: Table 'cp1.employee.json' not found > Oct 16, 2017 1:40:02 PM org.apache.calcite.runtime.CalciteException > SEVERE: org.apache.calcite.runtime.CalciteContextException: From line 1, column 15 to line 1, column 17: Table 'cp1.employee.json' not found > Error: VALIDATION ERROR: From line 1, column 15 to line 1, column 17: Table 'cp1.employee.json' not found > SQL Query null > [Error Id: 280cb38f-4d71-4027-afbc-86df542f8f9a on laptop-npjh4dhd.corp.maprtech.com:31010] (state=,code=0) > {code} > Ideally this should report an error similar to invalid schema. -- This message was sent by Atlassian JIRA (v6.4.14#64029)