ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IGNITE-6772) SQL exception messages are not descriptive
Date Tue, 09 Jan 2018 16:20:03 GMT

    [ 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 <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.<init>(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)

Mime
View raw message