ptupitsyn commented on a change in pull request #513:
URL: https://github.com/apache/ignite-3/pull/513#discussion_r771432627



##########
File path: 
modules/client/src/main/java/org/apache/ignite/internal/client/table/ClientTable.java
##########
@@ -291,39 +284,22 @@ public void writeKvTuple(
             ClientMessagePacker out,
             boolean skipHeader
     ) {
-        // TODO: Handle missing values and null values differently 
(IGNITE-16093).
-        var vals = new Object[schema.columns().length];
-
-        for (var i = 0; i < key.columnCount(); i++) {
-            var colName = key.columnName(i);
-            var col = schema.column(colName);
-
-            if (!col.key()) {
-                continue;
-            }
-
-            vals[col.schemaIndex()] = key.value(i);
-        }
-
-        if (val != null) {
-            for (var i = 0; i < val.columnCount(); i++) {
-                var colName = val.columnName(i);
-                var col = schema.column(colName);
-
-                if (col.key()) {
-                    continue;
-                }
-
-                vals[col.schemaIndex()] = val.value(i);
-            }
-        }
-
         if (!skipHeader) {
             out.packIgniteUuid(id);
             out.packInt(schema.version());
         }
 
-        for (var v : vals) {
+        var columns = schema.columns();
+
+        for (var i = 0; i < columns.length; i++) {
+            var col = columns[i];
+
+            Object v = col.key()
+                    ? key.valueOrDefault(col.name(), NO_VALUE)

Review comment:
       > user key-tuple may miss some columns
   
   Yes, and this is client-side logic that serializes user-provided tuple. If a 
required column is missing, we'll get an error from the server. 




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