timoninmaxim commented on code in PR #10316:
URL: https://github.com/apache/ignite/pull/10316#discussion_r1001449982


##########
modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcUtils.java:
##########
@@ -253,10 +254,13 @@ public static List<List<Object>> indexRows(JdbcIndexMeta 
idxMeta) {
         for (int i = 0; i < idxMeta.fields().size(); ++i) {
             List<Object> row = new ArrayList<>(13);
 
+            // Now, only primary key index (and PK proxy) can be unique.
+            boolean nonUnique = 
!idxMeta.indexName().startsWith(PRIMARY_KEY_INDEX);

Review Comment:
   equals?



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcIndexMeta.java:
##########
@@ -58,26 +63,33 @@ public class JdbcIndexMeta implements JdbcRawBinarylizable {
     }
 
     /**
-     * @param schemaName Schema name.
-     * @param tblName Table name.
-     * @param idx Index info.
+     * @param view SqlIndex system view.
      */
-    JdbcIndexMeta(String schemaName, String tblName, GridQueryIndexDescriptor 
idx) {
-        assert tblName != null;
-        assert idx != null;
-        assert idx.fields() != null;
+    JdbcIndexMeta(SqlIndexView view) {
+        assert view != null;

Review Comment:
   No need in this assert. Constructor is called only in single place and there 
is no chances to have nullable view.



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcIndexMeta.java:
##########
@@ -58,26 +63,33 @@ public class JdbcIndexMeta implements JdbcRawBinarylizable {
     }
 
     /**
-     * @param schemaName Schema name.
-     * @param tblName Table name.
-     * @param idx Index info.
+     * @param view SqlIndex system view.
      */
-    JdbcIndexMeta(String schemaName, String tblName, GridQueryIndexDescriptor 
idx) {
-        assert tblName != null;
-        assert idx != null;
-        assert idx.fields() != null;
+    JdbcIndexMeta(SqlIndexView view) {
+        assert view != null;
+
+        schemaName = view.schemaName();
+        tblName = view.tableName();
+        idxName = view.indexName();
+
+        type = QueryIndexType.valueOf(QueryIndexType.class, view.indexType());
 
-        this.schemaName = schemaName;
-        this.tblName = tblName;
+        String[] columns = view.columns().split(", ");

Review Comment:
   Doesn't look good. Can we instead use Index object? indexView -> filter by 
patterns -> extact Index from IndexProcessor by name. 



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to