ademakov commented on code in PR #898:
URL: https://github.com/apache/ignite-3/pull/898#discussion_r906090621


##########
modules/schema/src/main/java/org/apache/ignite/internal/schema/BinaryTuple.java:
##########
@@ -0,0 +1,58 @@
+package org.apache.ignite.internal.schema;
+
+import java.math.BigDecimal;
+import java.nio.ByteBuffer;
+import org.apache.ignite.internal.schema.row.InternalTuple;
+
+/**
+ * Utility for access to binary tuple elements as typed values and with schema 
knowledge that allows to read
+ * elements as objects.
+ */
+public class BinaryTuple extends BinaryTupleReader implements InternalTuple {
+    /** Tuple schema. */
+    private final BinaryTupleSchema schema;
+
+    /**
+     * Constructor.
+     *
+     * @param schema Tuple schema.
+     * @param bytes Binary tuple.
+     */
+    public BinaryTuple(BinaryTupleSchema schema, byte[] bytes) {
+        super(schema.elementCount(), bytes);
+        this.schema = schema;
+    }
+
+    /**
+     * Constructor.
+     *
+     * @param schema Tuple schema.
+     * @param buffer Buffer with a binary tuple.
+     */
+    public BinaryTuple(BinaryTupleSchema schema, ByteBuffer buffer) {
+        super(schema.elementCount(), buffer);
+        this.schema = schema;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public int count() {
+        return elementCount();
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public BigDecimal decimalValue(int index) {

Review Comment:
   Currently such a change would conflict with the NativeTypeSpec.objectValue() 
mechanism. Let postpone this until this mechanism is improved.



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