korlov42 commented on code in PR #2728:
URL: https://github.com/apache/ignite-3/pull/2728#discussion_r1368448955


##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/framework/ArrayRowHandler.java:
##########
@@ -108,17 +129,137 @@ public Object[] create(Object... fields) {
                 return fields;
             }
 
-            /** {@inheritDoc} */
-            @Override
-            public Object[] create(ByteBuffer raw) {
-                return ByteUtils.fromBytes(raw.array());
-            }
-
             /** {@inheritDoc} */
             @Override
             public Object[] create(InternalTuple tuple) {
-                throw new UnsupportedOperationException();
+                Object[] row = new Object[tuple.elementCount()];
+
+                for (int i = 0; i < row.length; i++) {
+                    NativeType nativeType = 
RowSchemaTypes.toNativeType(rowSchema.fields().get(i));
+
+                    if (nativeType == null) {
+                        row[i] = null;
+
+                        continue;
+                    }
+
+                    row[i] = readValue(tuple, nativeType, i);
+                }
+
+                return row;
             }
         };
     }
+
+    private static void appendValue(BinaryTupleBuilder builder, @Nullable 
Object value) {
+        if (value == null) {
+            builder.appendNull();
+
+            return;
+        }
+
+        NativeType nativeType = NativeTypes.fromObject(value);
+
+        assert nativeType != null;
+
+        value = TypeUtils.fromInternal(value, 
NativeTypeSpec.toClass(nativeType.spec(), true));

Review Comment:
   I'm wondering which tests do you expect to fail?
   
   Currently, ArrayRowHandler is used only in tests which primary goal is to 
verify behaviour of particular execution nodes. These tests are usually using 
primitive rows with integers or strings in it, so conversion is not required 
indeed. 



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