[ https://issues.apache.org/jira/browse/IGNITE-23946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17907527#comment-17907527 ]
Ignite TC Bot commented on IGNITE-23946: ---------------------------------------- {panel:title=Branch: [pull/11760/head] Base: [master] : No blockers found!|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1}{panel} {panel:title=Branch: [pull/11760/head] Base: [master] : No new tests found!|borderStyle=dashed|borderColor=#ccc|titleBGColor=#F7D6C1}{panel} [TeamCity *--> Run :: All* Results|https://ci2.ignite.apache.org/viewLog.html?buildId=8224321&buildTypeId=IgniteTests24Java8_RunAll] > Improve clarity of 'Cache is already indexed' exception message > --------------------------------------------------------------- > > Key: IGNITE-23946 > URL: https://issues.apache.org/jira/browse/IGNITE-23946 > Project: Ignite > Issue Type: Task > Reporter: Oleg Valuyskiy > Assignee: Oleg Valuyskiy > Priority: Minor > Labels: ise > Time Spent: 10m > Remaining Estimate: 0h > > When a user sets an SQL schema for a cache and then attempts to execute a > "CREATE TABLE" query, the "Cache is already indexed" exception is thrown. > This happens because using the setSqlSchema method marks the cache as > supporting SQL. However, "CREATE TABLE" queries should only be executed on > caches without this marking. > It appears that for some users, the "Cache is already indexed" message isn't > sufficiently informative since it's not entirely clear which user actions > trigger this exception. > Therefore, it appears to be beneficial to revise the wording of this > exception to ensure greater clarity for users. > A short reproducer: > {code:java} > private String schemaName = "PUBLIC"; > private String tableName = "TABLE1"; > ClientCacheConfiguration cacheCfg = new ClientCacheConfiguration() > .setName("SQL_" + schemaName + "_" + tableName); > ClientConfiguration ccfg = new > ClientConfiguration().setAddresses("127.0.0.1:10800"); > String createQuery = String.format("CREATE TABLE IF NOT EXISTS %s (id INT > PRIMARY KEY, name VARCHAR) WITH \"CACHE_NAME=%s\"", > tableName, cacheCfg.getName()); > cacheCfg.setSqlSchema(schemaName); > startGrid(0); > IgniteClient cli = Ignition.startClient(ccfg); > cli.getOrCreateCache(cacheCfg); > assertThrows(log, > () -> cli.query(new SqlFieldsQuery(createQuery)).getAll(), > ClientException.class, > "Cache is already indexed"); > stopAllGrids(); > cli.close(); > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)