ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel Kuznetsov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IGNITE-10069) SQL implicit schema is incorrectly resolved in native api.
Date Tue, 12 Feb 2019 15:14:00 GMT

    [ https://issues.apache.org/jira/browse/IGNITE-10069?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16766132#comment-16766132
] 

Pavel Kuznetsov commented on IGNITE-10069:
------------------------------------------

The root of the problem is the same: "TESTCACHE" schema is used instead of "testCache"

> SQL implicit schema is incorrectly resolved in native api.
> ----------------------------------------------------------
>
>                 Key: IGNITE-10069
>                 URL: https://issues.apache.org/jira/browse/IGNITE-10069
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>            Reporter: Pavel Kuznetsov
>            Assignee: Pavel Kuznetsov
>            Priority: Major
>
> Without explicit schema declaration (either sql syntax SCHEMA.TABLE or SqlFieldsQuery#setSchema),
do:
> 1) Create table using cache.query()
> 2) Perform select to this table
> reproducer:
> {noformat}
> public void testSchema(){
>         IgniteCache<?,?> c = ignite.getOrCreateCache("testCache");
>         c.query(new SqlFieldsQuery("CREATE TABLE TEST1 (ID LONG PRIMARY KEY, VAL LONG)
WITH \"template=replicated\";")).getAll();
>         c.query(new SqlFieldsQuery("SELECT * FROM TEST1")).getAll();
>     }
> {noformat}
> Got exception:
> {noformat}
> javax.cache.CacheException: Failed to parse query. Таблица "TEST1" не найдена
> Table "TEST1" not found; SQL statement:
> SELECT * FROM TEST1 [42102-197]
> 	at org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.query(IgniteCacheProxyImpl.java:697)
> 	at org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.query(IgniteCacheProxyImpl.java:636)
> 	at org.apache.ignite.internal.processors.cache.GatewayProtectedCacheProxy.query(GatewayProtectedCacheProxy.java:388)
> 	at org.apache.ignite.internal.processors.query.h2.sql.ExplainSelfTest.testSchema(ExplainSelfTest.java:119)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:497)
> 	at junit.framework.TestCase.runTest(TestCase.java:176)
> 	at org.apache.ignite.testframework.junits.GridAbstractTest.runTestInternal(GridAbstractTest.java:2209)
> 	at org.apache.ignite.testframework.junits.GridAbstractTest.access$000(GridAbstractTest.java:144)
> 	at org.apache.ignite.testframework.junits.GridAbstractTest$5.run(GridAbstractTest.java:2124)
> 	at java.lang.Thread.run(Thread.java:745)
> Caused by: class org.apache.ignite.internal.processors.query.IgniteSQLException: Failed
to parse query. Таблица "TEST1" не найдена
> Table "TEST1" not found; SQL statement:
> SELECT * FROM TEST1 [42102-197]
> 	at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.prepareStatementAndCaches(IgniteH2Indexing.java:2628)
> 	at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.parseAndSplit(IgniteH2Indexing.java:2327)
> 	at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.querySqlFields(IgniteH2Indexing.java:2171)
> 	at org.apache.ignite.internal.processors.query.GridQueryProcessor$4.applyx(GridQueryProcessor.java:2141)
> 	at org.apache.ignite.internal.processors.query.GridQueryProcessor$4.applyx(GridQueryProcessor.java:2136)
> 	at org.apache.ignite.internal.util.lang.IgniteOutClosureX.apply(IgniteOutClosureX.java:36)
> 	at org.apache.ignite.internal.processors.query.GridQueryProcessor.executeQuery(GridQueryProcessor.java:2713)
> 	at org.apache.ignite.internal.processors.query.GridQueryProcessor.querySqlFields(GridQueryProcessor.java:2150)
> 	at org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.query(IgniteCacheProxyImpl.java:685)
> 	... 12 more
> Caused by: org.h2.jdbc.JdbcSQLException: Таблица "TEST1" не найдена
> Table "TEST1" not found; SQL statement:
> SELECT * FROM TEST1 [42102-197]
> 	at org.h2.message.DbException.getJdbcSQLException(DbException.java:357)
> 	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:5920)
> 	at org.h2.command.Parser.readTableFilter(Parser.java:1430)
> 	at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:2138)
> 	at org.h2.command.Parser.parseSelectSimple(Parser.java:2287)
> 	at org.h2.command.Parser.parseSelectSub(Parser.java:2133)
> 	at org.h2.command.Parser.parseSelectUnion(Parser.java:1946)
> 	at org.h2.command.Parser.parseSelect(Parser.java:1919)
> 	at org.h2.command.Parser.parsePrepared(Parser.java:463)
> 	at org.h2.command.Parser.parse(Parser.java:335)
> 	at org.h2.command.Parser.parse(Parser.java:307)
> 	at org.h2.command.Parser.prepareCommand(Parser.java:278)
> 	at org.h2.engine.Session.prepareLocal(Session.java:611)
> 	at org.h2.engine.Session.prepareCommand(Session.java:549)
> 	at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1247)
> 	at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:76)
> 	at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:694)
> 	at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.prepare0(IgniteH2Indexing.java:539)
> 	at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.prepareStatement(IgniteH2Indexing.java:509)
> 	at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.prepareStatement(IgniteH2Indexing.java:476)
> 	at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.prepareStatementAndCaches(IgniteH2Indexing.java:2610)
> 	... 20 more
> {noformat}
> reproduced on 18c02b5fee8



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message