You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Stanislav Lukyanov (JIRA)" <ji...@apache.org> on 2019/01/30 15:07:00 UTC

[jira] [Commented] (IGNITE-11146) SQL: QueryIndex and DDL generate indexes with different default names

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

Stanislav Lukyanov commented on IGNITE-11146:
---------------------------------------------

The method which generates default names for indexes is `QueryUtils::indexName`.
The problem is that `QueryUtils::indexName` uses lower-case characters (and even forces lower-case on table and column names).
`CREATE INDEX` uses the value generated by that method as is, while `QueryIndex` is being normalized during cache creation (see `QueryUtils::normalizeQueryEntities`).

An easy fix would be to make indexName use upper-case letters in generated parts and take table and column names as is. But that would change the behavior for existing indexes, with all kinds of possible compatibility issues. Need to approach this with care.

> SQL: QueryIndex and DDL generate indexes with different default names
> ---------------------------------------------------------------------
>
>                 Key: IGNITE-11146
>                 URL: https://issues.apache.org/jira/browse/IGNITE-11146
>             Project: Ignite
>          Issue Type: Task
>          Components: sql
>            Reporter: Stanislav Lukyanov
>            Priority: Major
>
> `QueryIndex` with a name set and `CREATE INDEX` without a specified name create indexes with different names, even if all parameters are the same - `CREATE INDEX` produces a lower-case name, and `QueryIndex` produces an upper-case one.
> For example
> {code}
> new QueryIndex("a")
> {code}
> in a table "Foo" creates an index with name
> {code}
> FOO_A_ASC_IDX
> {code}
> while the query
> {code}
> CREATE INDEX ON PUBLIC.FOO (a)
> {code}
> creates an index
> {code}
> foo_a_asc_idx
> {code}
> It would be better if DDL generated an upper-case name since that's the default in SQL.



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