From issues-return-54611-archive-asf-public=cust-asf.ponee.io@ignite.apache.org Tue Jan 9 17:20:15 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 24242180718 for ; Tue, 9 Jan 2018 17:20:15 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 13F41160C3F; Tue, 9 Jan 2018 16:20:15 +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 32425160C13 for ; Tue, 9 Jan 2018 17:20:14 +0100 (CET) Received: (qmail 81194 invoked by uid 500); 9 Jan 2018 16:20:12 -0000 Mailing-List: contact issues-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list issues@ignite.apache.org Received: (qmail 81105 invoked by uid 99); 9 Jan 2018 16:20:12 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Jan 2018 16:20:12 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 38403C1261 for ; Tue, 9 Jan 2018 16:20:12 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.911 X-Spam-Level: X-Spam-Status: No, score=-99.911 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 7LPOZ8-RDXxc for ; Tue, 9 Jan 2018 16:20:10 +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 259A85FB87 for ; Tue, 9 Jan 2018 16:20:10 +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 B7D72E0EFA for ; Tue, 9 Jan 2018 16:20:08 +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 D33682411F for ; Tue, 9 Jan 2018 16:20:03 +0000 (UTC) Date: Tue, 9 Jan 2018 16:20:03 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (IGNITE-6772) SQL exception messages are not descriptive 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/IGNITE-6772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16318675#comment-16318675 ] ASF GitHub Bot commented on IGNITE-6772: ---------------------------------------- GitHub user dolphin1414 opened a pull request: https://github.com/apache/ignite/pull/3342 IGNITE-6772: SQL exception messages made more informative. SQL exception messages made more informative. You can merge this pull request into a Git repository by running: $ git pull https://github.com/gridgain/apache-ignite ignite-6772 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/ignite/pull/3342.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3342 ---- commit 2d3a681632e972ec647f41e9c5940a394cad3817 Author: rkondakov Date: 2018-01-09T16:14:39Z IGNITE-6772: SQL exception messages became more informative. ---- > SQL exception messages are not descriptive > ------------------------------------------ > > Key: IGNITE-6772 > URL: https://issues.apache.org/jira/browse/IGNITE-6772 > Project: Ignite > Issue Type: Bug > Components: sql > Reporter: Pavel Tupitsyn > Labels: usability > Fix For: 2.4 > > > Top level SQL exception messages are cryptic and not descriptive. Real details are buried deep inside inner exceptions. > For example, when there is a typo in table name, exception looks like this: > {code} > class org.apache.ignite.IgniteCheckedException: Failed to parse query: SELECT "persons-sql"."PERSON"._KEY, "persons-sql"."PERSON"._VAL from Person1, "orgs-sql".Organization where Person.OrgId = "orgs-sql".Organization._key and "orgs-sql".Organization.Name = ? > at org.apache.ignite.internal.processors.platform.utils.PlatformUtils.unwrapQueryException(PlatformUtils.java:510) > at org.apache.ignite.internal.processors.platform.cache.PlatformCache.runQuery(PlatformCache.java:1219) > at org.apache.ignite.internal.processors.platform.cache.PlatformCache.processInStreamOutObject(PlatformCache.java:875) > at org.apache.ignite.internal.processors.platform.PlatformTargetProxyImpl.inStreamOutObject(PlatformTargetProxyImpl.java:77) > Caused by: javax.cache.CacheException: class org.apache.ignite.internal.processors.query.IgniteSQLException: Failed to parse query: SELECT "persons-sql"."PERSON"._KEY, "persons-sql"."PERSON"._VAL from Person1, "orgs-sql".Organization where Person.OrgId = "orgs-sql".Organization._key and "orgs-sql".Organization.Name = ? > at org.apache.ignite.internal.processors.cache.IgniteCacheProxy.query(IgniteCacheProxy.java:807) > at org.apache.ignite.internal.processors.platform.cache.PlatformCache.runQuery(PlatformCache.java:1213) > ... 2 more > Caused by: class org.apache.ignite.internal.processors.query.IgniteSQLException: Failed to parse query: SELECT "persons-sql"."PERSON"._KEY, "persons-sql"."PERSON"._VAL from Person1, "orgs-sql".Organization where Person.OrgId = "orgs-sql".Organization._key and "orgs-sql".Organization.Name = ? > at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.queryDistributedSqlFields(IgniteH2Indexing.java:1293) > at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.queryDistributedSql(IgniteH2Indexing.java:1198) > at org.apache.ignite.internal.processors.query.GridQueryProcessor$8.applyx(GridQueryProcessor.java:1957) > at org.apache.ignite.internal.processors.query.GridQueryProcessor$8.applyx(GridQueryProcessor.java:1955) > at org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36) > at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:2293) > at org.apache.ignite.internal.processors.query.GridQueryProcessor.queryDistributedSql(GridQueryProcessor.java:1954) > at org.apache.ignite.internal.processors.query.GridQueryProcessor.querySql(GridQueryProcessor.java:1934) > at org.apache.ignite.internal.processors.cache.IgniteCacheProxy.query(IgniteCacheProxy.java:792) > ... 3 more > Caused by: org.h2.jdbc.JdbcSQLException: Table "PERSON1" not found; SQL statement: > SELECT "persons-sql"."PERSON"._KEY, "persons-sql"."PERSON"._VAL from Person1, "orgs-sql".Organization where Person.OrgId = "orgs-sql".Organization._key and "orgs-sql".Organization.Name = ? [42102-195] > at org.h2.message.DbException.getJdbcSQLException(DbException.java:345) > at org.h2.message.DbException.get(DbException.java:179) > at org.h2.message.DbException.get(DbException.java:155) > at org.h2.command.Parser.readTableOrView(Parser.java:5506) > at org.h2.command.Parser.readTableFilter(Parser.java:1260) > at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1940) > at org.h2.command.Parser.parseSelectSimple(Parser.java:2089) > at org.h2.command.Parser.parseSelectSub(Parser.java:1934) > at org.h2.command.Parser.parseSelectUnion(Parser.java:1749) > at org.h2.command.Parser.parseSelect(Parser.java:1737) > at org.h2.command.Parser.parsePrepared(Parser.java:448) > at org.h2.command.Parser.parse(Parser.java:320) > at org.h2.command.Parser.parse(Parser.java:292) > at org.h2.command.Parser.prepareCommand(Parser.java:257) > at org.h2.engine.Session.prepareLocal(Session.java:573) > at org.h2.engine.Session.prepareCommand(Session.java:514) > at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1204) > at org.h2.jdbc.JdbcPreparedStatement.(JdbcPreparedStatement.java:73) > at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:288) > at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.prepareStatement(IgniteH2Indexing.java:398) > at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.queryDistributedSqlFields(IgniteH2Indexing.java:1273) > {code} > As we can see, top level message is {{Failed to parse query}}, but the real problem that user needs to know is {{Table "PERSON1" not found}}. We should make sure that top level message includes the useful information and not some internal implementation details. > Make sure to add unit tests for common SQL query problems: > * Incorrect table name > * Incorrect column name > * Syntax error (shoukd include character index) > Error messages are part of the API. -- This message was sent by Atlassian JIRA (v6.4.14#64029)