You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/02/08 08:20:18 UTC

[GitHub] [ignite-3] AMashenkov commented on a change in pull request #606: IGNITE-16422 Table API fix

AMashenkov commented on a change in pull request #606:
URL: https://github.com/apache/ignite-3/pull/606#discussion_r801366125



##########
File path: modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/schema/IgniteTableImpl.java
##########
@@ -303,46 +304,75 @@ public void removeIndex(String idxName) {
     }
 
     private <RowT> BinaryRow updateTuple(RowT row, List<String> updateColList, ExecutionContext<RowT> ectx) {
-        int nonNullVarlenKeyCols = 0;
-        int nonNullVarlenValCols = 0;
-
         RowHandler<RowT> hnd = ectx.rowHandler();
-        int offset = desc.columnsCount();
-        Set<String> toUpdate = new HashSet<>(updateColList);
 
-        for (ColumnDescriptor colDesc : columnsOrderedByPhysSchema) {
-            if (colDesc.physicalType().spec().fixedLength()) {
-                continue;
-            }
+        Object2IntMap<String> columnToIndex = new Object2IntOpenHashMap<>(updateColList.size());
 
-            Object val = toUpdate.contains(colDesc.name())
-                    ? hnd.get(colDesc.logicalIndex() + offset, row)
-                    : hnd.get(colDesc.logicalIndex(), row);
+        for (int i = 0; i < updateColList.size(); i++) {
+            columnToIndex.put(updateColList.get(i), i + desc.columnsCount());
+        }
 
-            if (val != null) {
-                if (colDesc.key()) {
-                    nonNullVarlenKeyCols++;
-                } else {
-                    nonNullVarlenValCols++;
-                }
-            }
+        int nonNullVarlenKeyCols;
+        int nonNullVarlenValCols;
+
+        int keyOffset = schemaDescriptor.keyColumns().firstVarlengthColumn();
+
+        if (keyOffset == -1) {
+            nonNullVarlenKeyCols = 0;
+        } else {

Review comment:
       ```suggestion
           if (keyOffset > -1) {
   ```




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org