[
https://issues.apache.org/jira/browse/IGNITE-10654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16757074#comment-16757074
]
Vladimir Ozerov edited comment on IGNITE-10654 at 1/31/19 9:53 AM:
-------------------------------------------------------------------
[~zstan], my comments:
# {{GridH2Table}}: not clear why null logger is used (copy-paste?), {{ctx.log}}
should be enough.
# Styling: abbreviations are not allowed in method names. {{checkIdxPresence}}
-> {{checkIndexPresence}}
# {{checkIdxPresence}}: only {{H2TreeIndex}}-es should be checked, because this
is the only type which could be created by user. Others (scan, hash, proxy,
spatial) should be skipped
# {{checkIdxPresence}}: "index already exists" check should not be performed
here; it is aleady performed earlier
# {{checkIdxPresence}}: check for column name is not very accurate here. The
reason is that we have special hidden collumns {{_KEY}} and {{_VAL}} which may
have aliases. So if for example {{_KAY}} has an alias of {{pk_id}}, then both
index {{[my_col, _KEY]}} and {{[my_col, pk_id]}} are essentially equal and we
should warn user, but this will not work in current implementation. Fix is
simple - remap columns if needed. See {{desc.isKeyAliasColumn}},
{{desc.isValueAliasColumn}}. If {{true}} - then change current column to either
{{_KEY}} or {{_VAL}} and use them for comparison. Indexes of {{_KEY}} and
{{_VAL}} columns could be found in {{GridH2KeyValueRowOnheap}}
# {{proposeUserIndex}}: {{U.warn}} should be used instead of {{log.warning}}
# {{proposeUserIndex}}: I propose to simplify warning message and use our
standard {{key=val, ,,,}} format. E.g.:
{code}
Index with the given set of columns already exists (consider dropping either
new or existing index) [cacheName=?, schemaName=?, tableName=?, newIndexName=?,
existingIndexName=?]
{code}
was (Author: vozerov):
[~zstan], my comments:
# {{GridH2Table}}: not clear why null logger is used (copy-paste?), {{ctx.log}}
should be enough.
# Styling: abbreviations are not allowed in method names. {{checkIdxPresence}}
-> {{checkIndexPresence}}
# {{checkIdxPresence}}: only {{H2TreeIndex}}-es should be checked, because this
is the only type which could be created by user. Others (scan, hash, proxy,
spatial) should be skipped
# {{checkIdxPresence}}: "index already exists" check should not be performed
here; it is aleady performed earlier
# {{checkIdxPresence}}: check for column name is not very accurate here. The
reason is that we have special hidden collumns {{_KEY}} and {{_VAL}} which may
have aliases. So if for example {{_KAY}} has an alias of {{pk_id}}, then both
index {{my_col, _KEY}} and {{my_col, pk_id}} are essentially equal and we
should warn user, but this will not work in current implementation. Fix is
simple - remap columns if needed. See {{desc.isKeyAliasColumn}},
{{desc.isValueAliasColumn}}. If {{true}} - then change current column to either
{{_KEY}} or {{_VAL}} and use them for comparison. Indexes of {{_KEY}} and
{{_VAL}} columns could be found in {{GridH2KeyValueRowOnheap}}
# {{proposeUserIndex}}: {{U.warn}} should be used instead of {{log.warning}}
# {{proposeUserIndex}}: I propose to simplify warning message and use our
standard {{key=val, ,,,}} format. E.g.:
{code}
Index with the given set of columns already exists (consider dropping either
new or existing index) [cacheName=?, schemaName=?, tableName=?, newIndexName=?,
existingIndexName=?]
{code}
> Report in case of creating index with already existing fields collection.
> -------------------------------------------------------------------------
>
> Key: IGNITE-10654
> URL: https://issues.apache.org/jira/browse/IGNITE-10654
> Project: Ignite
> Issue Type: Improvement
> Components: sql
> Affects Versions: 2.7
> Reporter: Stanilovsky Evgeny
> Assignee: Stanilovsky Evgeny
> Priority: Major
> Fix For: 2.8
>
>
> Report in log if new index creating with already existing fields collection.
> for example, need to log warn here:
> {code:java}
> cache.query(new SqlFieldsQuery("create index \"idx1\" on Val(keyStr,
> keyLong)"));
> cache.query(new SqlFieldsQuery("create index \"idx3\" on Val(keyStr,
> keyLong)"));
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)