joooger commented on a change in pull request #5676: IGNITE-10654 Print warn 
message in case of index creating with already existing fields.
URL: https://github.com/apache/ignite/pull/5676#discussion_r267228341
 
 

 ##########
 File path: 
modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridH2Table.java
 ##########
 @@ -822,6 +841,70 @@ public boolean rebuildFromHashInProgress() {
         return commitUserIndex(ses, idxName);
     }
 
+    /**
+     * Checks and replace if provided column id matches value alias column.
+     *
+     * @param col Input column.
+     * @return Transformed result if needed.
+     */
+    private String aliasNameTransformer(IndexColumn col) {
+        if (desc.isKeyAliasColumn(col.column.getColumnId()))
+            return QueryUtils.KEY_FIELD_NAME;
+        else if (desc.isValueAliasColumn(col.column.getColumnId()))
+            return QueryUtils.VAL_FIELD_NAME;
+
+        return col.columnName;
+    }
+
+    /**
+     * Check index presence, throw exception if index with same name already 
exist or return {@code True} if
+     * index with same fields and search direction found.
+     *
+     * @param curIdx Index to check.
+     * @return {@code True} if equal index exist.
+     * @throws IgniteCheckedException If failed.
+     */
+    private @Nullable Index checkIndexPresence(Index curIdx) throws 
IgniteCheckedException {
+        IndexColumn[] curColumns = curIdx.getIndexColumns();
+
+        Index registredIdx = null;
+
+        for (Index idx : idxs) {
+            if (!(idx instanceof H2TreeIndex))
 
 Review comment:
   it should check H2TreeIndexBase, due to we have two variant of such indexes: 
for affinity nodes, for other nodes.
   
   Will be good to add test to check create index from client node

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to