You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by am...@apache.org on 2021/07/06 14:27:56 UTC

[ignite-3] branch ignite-14896 created (now 463742d)

This is an automated email from the ASF dual-hosted git repository.

amashenkov pushed a change to branch ignite-14896
in repository https://gitbox.apache.org/repos/asf/ignite-3.git.


      at 463742d  Minor.

This branch includes the following new commits:

     new 463742d  Minor.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[ignite-3] 01/01: Minor.

Posted by am...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

amashenkov pushed a commit to branch ignite-14896
in repository https://gitbox.apache.org/repos/asf/ignite-3.git

commit 463742d0a3ec8a93581e35313f01de8c7ea74f2d
Author: Andrew Mashenkov <an...@gmail.com>
AuthorDate: Tue Jul 6 17:27:37 2021 +0300

    Minor.
---
 .../runner/app/SchemaChangeTableViewTest.java      |   1 -
 .../org/apache/ignite/internal/schema/Row.java     |  79 ++---
 .../ignite/internal/schema/SchemaManager.java      |  12 +-
 .../internal/schema/mapping/ColumnMapper.java      |   9 +
 .../internal/schema/mapping/ColumnMapperImpl.java  |  25 +-
 .../internal/schema/mapping/ColumnMapping.java     |  23 +-
 .../schema/mapping/ColumnaMapperBuilder.java       |   6 +-
 .../schema/registry/SchemaRegistryImpl.java        |   2 +-
 .../schema/registry/UpgradingRowAdapter.java       | 331 ++++++++++++++++++++-
 9 files changed, 399 insertions(+), 89 deletions(-)

diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/SchemaChangeTableViewTest.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/SchemaChangeTableViewTest.java
index 4247ac3..dd1e280 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/SchemaChangeTableViewTest.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/SchemaChangeTableViewTest.java
@@ -284,7 +284,6 @@ class SchemaChangeTableViewTest extends AbstractSchemaChangeTest {
     /**
      * Check merge column default value changes.
      */
-    @Disabled("https://issues.apache.org/jira/browse/IGNITE-14479")
     @Test
     public void testMergeDefaultChanges() {
         List<Ignite> grid = startGrid();
diff --git a/modules/schema/src/main/java/org/apache/ignite/internal/schema/Row.java b/modules/schema/src/main/java/org/apache/ignite/internal/schema/Row.java
index 82aab99..665b611 100644
--- a/modules/schema/src/main/java/org/apache/ignite/internal/schema/Row.java
+++ b/modules/schema/src/main/java/org/apache/ignite/internal/schema/Row.java
@@ -81,10 +81,7 @@ public class Row implements BinaryRow {
     public byte byteValue(int col) throws InvalidTypeException {
         long off = findColumn(col, NativeTypeSpec.BYTE);
 
-        if (off < 0)
-            return off == -1 ? 0 : (byte)schema.column(col).defaultValue();
-
-        return readByte(offset(off));
+        return off < 0 ? 0 : readByte(offset(off));
     }
 
     /**
@@ -97,10 +94,7 @@ public class Row implements BinaryRow {
     public Byte byteValueBoxed(int col) throws InvalidTypeException {
         long off = findColumn(col, NativeTypeSpec.BYTE);
 
-        if (off < 0)
-            return off == -1 ? null : (Byte)schema.column(col).defaultValue();
-
-        return readByte(offset(off));
+        return off < 0 ? null : readByte(offset(off));
     }
 
     /**
@@ -113,10 +107,7 @@ public class Row implements BinaryRow {
     public short shortValue(int col) throws InvalidTypeException {
         long off = findColumn(col, NativeTypeSpec.SHORT);
 
-        if (off < 0)
-            return off == -1 ? 0 : (short)schema.column(col).defaultValue();
-
-        return readShort(offset(off));
+        return off < 0 ? 0 : readShort(offset(off));
     }
 
     /**
@@ -129,10 +120,7 @@ public class Row implements BinaryRow {
     public Short shortValueBoxed(int col) throws InvalidTypeException {
         long off = findColumn(col, NativeTypeSpec.SHORT);
 
-        if (off < 0)
-            return off == -1 ? null : (Short)schema.column(col).defaultValue();
-
-        return readShort(offset(off));
+        return off < 0 ? null : readShort(offset(off));
     }
 
     /**
@@ -145,10 +133,7 @@ public class Row implements BinaryRow {
     public int intValue(int col) throws InvalidTypeException {
         long off = findColumn(col, NativeTypeSpec.INTEGER);
 
-        if (off < 0)
-            return off == -1 ? 0 : (int)schema.column(col).defaultValue();
-
-        return readInteger(offset(off));
+        return off < 0 ? 0 : readInteger(offset(off));
     }
 
     /**
@@ -161,10 +146,7 @@ public class Row implements BinaryRow {
     public Integer intValueBoxed(int col) throws InvalidTypeException {
         long off = findColumn(col, NativeTypeSpec.INTEGER);
 
-        if (off < 0)
-            return off == -1 ? null : (Integer)schema.column(col).defaultValue();
-
-        return readInteger(offset(off));
+        return off < 0 ? null : readInteger(offset(off));
     }
 
     /**
@@ -177,10 +159,7 @@ public class Row implements BinaryRow {
     public long longValue(int col) throws InvalidTypeException {
         long off = findColumn(col, NativeTypeSpec.LONG);
 
-        if (off < 0)
-            return off == -1 ? 0L : (long)schema.column(col).defaultValue();
-
-        return readLong(offset(off));
+        return off < 0 ? 0 : readLong(offset(off));
     }
 
     /**
@@ -193,10 +172,7 @@ public class Row implements BinaryRow {
     public Long longValueBoxed(int col) throws InvalidTypeException {
         long off = findColumn(col, NativeTypeSpec.LONG);
 
-        if (off < 0)
-            return off == -1 ? null : (Long)schema.column(col).defaultValue();
-
-        return readLong(offset(off));
+        return off < 0 ? null : readLong(offset(off));
     }
 
     /**
@@ -209,10 +185,7 @@ public class Row implements BinaryRow {
     public float floatValue(int col) throws InvalidTypeException {
         long off = findColumn(col, NativeTypeSpec.FLOAT);
 
-        if (off < 0)
-            return off == -1 ? 0.f : (float)schema.column(col).defaultValue();
-
-        return readFloat(offset(off));
+        return off < 0 ? 0.f : readFloat(offset(off));
     }
 
     /**
@@ -225,10 +198,7 @@ public class Row implements BinaryRow {
     public Float floatValueBoxed(int col) throws InvalidTypeException {
         long off = findColumn(col, NativeTypeSpec.FLOAT);
 
-        if (off < 0)
-            return off == -1 ? null : (Float)schema.column(col).defaultValue();
-
-        return readFloat(offset(off));
+        return off < 0 ? null : readFloat(offset(off));
     }
 
     /**
@@ -241,10 +211,7 @@ public class Row implements BinaryRow {
     public double doubleValue(int col) throws InvalidTypeException {
         long off = findColumn(col, NativeTypeSpec.DOUBLE);
 
-        if (off < 0)
-            return off == -1 ? 0.d : (double)schema.column(col).defaultValue();
-
-        return readDouble(offset(off));
+        return off < 0 ? 0.d : readDouble(offset(off));
     }
 
     /**
@@ -257,10 +224,7 @@ public class Row implements BinaryRow {
     public Double doubleValueBoxed(int col) throws InvalidTypeException {
         long off = findColumn(col, NativeTypeSpec.DOUBLE);
 
-        if (off < 0)
-            return off == -1 ? null : (Double)schema.column(col).defaultValue();
-
-        return readDouble(offset(off));
+        return off < 0 ? null : readDouble(offset(off));
     }
 
     /**
@@ -286,7 +250,7 @@ public class Row implements BinaryRow {
         long offLen = findColumn(col, NativeTypeSpec.STRING);
 
         if (offLen < 0)
-            return offLen == -1 ? null : (String)rowSchema().column(col).defaultValue();
+            return null;
 
         int off = offset(offLen);
         int len = length(offLen);
@@ -305,7 +269,7 @@ public class Row implements BinaryRow {
         long offLen = findColumn(col, NativeTypeSpec.BYTES);
 
         if (offLen < 0)
-            return offLen == -1 ? null : (byte[])schema.column(col).defaultValue();
+            return null;
 
         int off = offset(offLen);
         int len = length(offLen);
@@ -321,12 +285,12 @@ public class Row implements BinaryRow {
      * @throws InvalidTypeException If actual column type does not match the requested column type.
      */
     public UUID uuidValue(int col) throws InvalidTypeException {
-        long offLen = findColumn(col, NativeTypeSpec.UUID);
+        long found = findColumn(col, NativeTypeSpec.UUID);
 
-        if (offLen < 0)
-            return offLen == -1 ? null : (UUID)schema.column(col).defaultValue();
+        if (found < 0)
+            return null;
 
-        int off = offset(offLen);
+        int off = offset(found);
 
         long lsb = readLong(off);
         long msb = readLong(off + 8);
@@ -345,7 +309,7 @@ public class Row implements BinaryRow {
         long offLen = findColumn(col, NativeTypeSpec.BITMASK);
 
         if (offLen < 0)
-            return offLen == -1 ? null : (BitSet)schema.column(col).defaultValue();
+            return null;
 
         int off = offset(offLen);
         int len = columnLength(col);
@@ -474,8 +438,7 @@ public class Row implements BinaryRow {
      * @param hasNullMap Has null map flag.
      * @return Encoded offset (from the row start) and length of the column with the given index.
      */
-    private long varlenColumnOffsetAndLength(Columns cols, int baseOff, int idx, boolean hasVarTbl,
-        boolean hasNullMap) {
+    private long varlenColumnOffsetAndLength(Columns cols, int baseOff, int idx, boolean hasVarTbl, boolean hasNullMap) {
         int vartableOff = baseOff + CHUNK_LEN_FIELD_SIZE;
 
         int numNullsBefore = 0;
@@ -595,7 +558,7 @@ public class Row implements BinaryRow {
 
     /** {@inheritDoc} */
     @Override public int schemaVersion() {
-        return schema.version();
+        return row.schemaVersion();
     }
 
     /** {@inheritDoc} */
diff --git a/modules/schema/src/main/java/org/apache/ignite/internal/schema/SchemaManager.java b/modules/schema/src/main/java/org/apache/ignite/internal/schema/SchemaManager.java
index 49dff9e..7554dc7 100644
--- a/modules/schema/src/main/java/org/apache/ignite/internal/schema/SchemaManager.java
+++ b/modules/schema/src/main/java/org/apache/ignite/internal/schema/SchemaManager.java
@@ -303,12 +303,14 @@ public class SchemaManager extends Producer<SchemaEvent, SchemaEventParameters>
             final ColumnView oldColView = oldTbl.columns().get(s);
 
             if (oldColView == null) {
-                assert !newDesc.isKeyColumn(newDesc.column(newColView.name()).schemaIndex());
+                final Column newCol = newDesc.column(newColView.name());
+
+                assert !newDesc.isKeyColumn(newCol.schemaIndex());
 
                 if (mapper == null)
-                    mapper = ColumnMapping.mapperBuilder(newDesc.length());
+                    mapper = ColumnMapping.mapperBuilder(newDesc);
 
-                mapper.add(newDesc.column(newColView.name()).schemaIndex(), -1); // New column added.
+                mapper.add(newCol.schemaIndex(), -1, newCol); // New column added.
             }
             else {
                 final Column newCol = newDesc.column(newColView.name());
@@ -321,9 +323,9 @@ public class SchemaManager extends Producer<SchemaEvent, SchemaEventParameters>
                     continue;
 
                 if (mapper == null)
-                    mapper = ColumnMapping.mapperBuilder(newDesc.length());
+                    mapper = ColumnMapping.mapperBuilder(newDesc);
 
-                mapper.add(newCol.schemaIndex(), oldCol.schemaIndex());
+                mapper.add(newCol.schemaIndex(), oldCol.schemaIndex(), null);
             }
         }
 
diff --git a/modules/schema/src/main/java/org/apache/ignite/internal/schema/mapping/ColumnMapper.java b/modules/schema/src/main/java/org/apache/ignite/internal/schema/mapping/ColumnMapper.java
index f7f060d..8bd61af 100644
--- a/modules/schema/src/main/java/org/apache/ignite/internal/schema/mapping/ColumnMapper.java
+++ b/modules/schema/src/main/java/org/apache/ignite/internal/schema/mapping/ColumnMapper.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal.schema.mapping;
 
 import java.io.Serializable;
+import org.apache.ignite.internal.schema.Column;
 
 /**
  * Column mapper interface.
@@ -30,4 +31,12 @@ public interface ColumnMapper extends Serializable {
      * @return Column index in target schema or {@code -1} if no column exists in target schema.
      */
     int map(int idx);
+
+    /**
+     * Column descriptor for given column idx.
+     *
+     * @param idx Column index in source schema.
+     * @return Column descriptor.
+     */
+    Column mappedColumn(int idx);
 }
diff --git a/modules/schema/src/main/java/org/apache/ignite/internal/schema/mapping/ColumnMapperImpl.java b/modules/schema/src/main/java/org/apache/ignite/internal/schema/mapping/ColumnMapperImpl.java
index 1b0e9b4..1d90425 100644
--- a/modules/schema/src/main/java/org/apache/ignite/internal/schema/mapping/ColumnMapperImpl.java
+++ b/modules/schema/src/main/java/org/apache/ignite/internal/schema/mapping/ColumnMapperImpl.java
@@ -17,6 +17,9 @@
 
 package org.apache.ignite.internal.schema.mapping;
 
+import org.apache.ignite.internal.schema.Column;
+import org.apache.ignite.internal.schema.SchemaDescriptor;
+
 /**
  * Column mapper implementation.
  */
@@ -24,19 +27,26 @@ class ColumnMapperImpl implements ColumnMapper, ColumnaMapperBuilder {
     /** Mapping. */
     private final int[] mapping;
 
+    /** Mapped columns. */
+    private final Column[] cols;
+
     /**
-     * @param cols Number of columns.
+     * @param schema Schema descriptor.
      */
-    ColumnMapperImpl(int cols) {
-        mapping = new int[cols];
+    ColumnMapperImpl(SchemaDescriptor schema) {
+        mapping = new int[schema.length()];
+        cols = new Column[schema.length()];
 
-        for (int i = 0; i < mapping.length; i++)
+        for (int i = 0; i < mapping.length; i++) {
             mapping[i] = i;
+            cols[i] = schema.column(i);
+        }
     }
 
     /** {@inheritDoc} */
-    @Override public void add(int from, int to) {
+    @Override public void add(int from, int to, Column col) {
         mapping[from] = to;
+        cols[from] = col;
     }
 
     /** {@inheritDoc} */
@@ -48,6 +58,11 @@ class ColumnMapperImpl implements ColumnMapper, ColumnaMapperBuilder {
     }
 
     /** {@inheritDoc} */
+    @Override public Column mappedColumn(int idx) {
+        return cols[idx];
+    }
+
+    /** {@inheritDoc} */
     @Override public ColumnMapper build() {
         return this;
     }
diff --git a/modules/schema/src/main/java/org/apache/ignite/internal/schema/mapping/ColumnMapping.java b/modules/schema/src/main/java/org/apache/ignite/internal/schema/mapping/ColumnMapping.java
index 3a19a98..02632fc 100644
--- a/modules/schema/src/main/java/org/apache/ignite/internal/schema/mapping/ColumnMapping.java
+++ b/modules/schema/src/main/java/org/apache/ignite/internal/schema/mapping/ColumnMapping.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal.schema.mapping;
 
 import java.io.Serializable;
+import org.apache.ignite.internal.schema.Column;
 import org.apache.ignite.internal.schema.SchemaDescriptor;
 
 /**
@@ -35,10 +36,10 @@ public class ColumnMapping {
     }
 
     /**
-     * @param cols Number of columns.
+     * @param schema Schema descriptor.
      */
-    public static ColumnaMapperBuilder mapperBuilder(int cols) {
-        return new ColumnMapperImpl(cols);
+    public static ColumnaMapperBuilder mapperBuilder(SchemaDescriptor schema) {
+        return new ColumnMapperImpl(schema);
     }
 
     /**
@@ -50,12 +51,7 @@ public class ColumnMapping {
      * @return Merged column mapper.
      */
     public static ColumnMapper mergeMapping(ColumnMapper mapping, SchemaDescriptor schema) {
-        if (mapping == identityMapping())
-            return schema.columnMapping();
-        else if (schema.columnMapping() == identityMapping())
-            return mapping;
-
-        ColumnaMapperBuilder builder = mapperBuilder(schema.length());
+        ColumnaMapperBuilder builder = mapperBuilder(schema);
 
         ColumnMapper schemaMapper = schema.columnMapping();
 
@@ -63,9 +59,9 @@ public class ColumnMapping {
             int idx = schemaMapper.map(i);
 
             if (idx < 0)
-                builder.add(i, -1);
+                builder.add(i, -1, schema.column(i));
             else
-                builder.add(i, mapping.map(idx));
+                builder.add(i, mapping.map(idx), mapping.mappedColumn(idx));
         }
 
         return builder.build();
@@ -85,5 +81,10 @@ public class ColumnMapping {
         @Override public int map(int idx) {
             return idx;
         }
+
+        /** {@inheritDoc} */
+        @Override public Column mappedColumn(int idx) {
+            return null;
+        }
     }
 }
diff --git a/modules/schema/src/main/java/org/apache/ignite/internal/schema/mapping/ColumnaMapperBuilder.java b/modules/schema/src/main/java/org/apache/ignite/internal/schema/mapping/ColumnaMapperBuilder.java
index 854b3be..74b2f99 100644
--- a/modules/schema/src/main/java/org/apache/ignite/internal/schema/mapping/ColumnaMapperBuilder.java
+++ b/modules/schema/src/main/java/org/apache/ignite/internal/schema/mapping/ColumnaMapperBuilder.java
@@ -17,6 +17,9 @@
 
 package org.apache.ignite.internal.schema.mapping;
 
+import org.apache.ignite.internal.schema.Column;
+import org.jetbrains.annotations.Nullable;
+
 /**
  * Column mapper builder interface.
  */
@@ -26,8 +29,9 @@ public interface ColumnaMapperBuilder {
      *
      * @param from Source column index.
      * @param to Target column index.
+     * @param col Target column descriptor.
      */
-    public void add(int from, int to);
+    public void add(int from, int to, @Nullable Column col);
 
     /**
      * @return Column mapper.
diff --git a/modules/schema/src/main/java/org/apache/ignite/internal/schema/registry/SchemaRegistryImpl.java b/modules/schema/src/main/java/org/apache/ignite/internal/schema/registry/SchemaRegistryImpl.java
index 51b4c6e..aac8a40 100644
--- a/modules/schema/src/main/java/org/apache/ignite/internal/schema/registry/SchemaRegistryImpl.java
+++ b/modules/schema/src/main/java/org/apache/ignite/internal/schema/registry/SchemaRegistryImpl.java
@@ -118,7 +118,7 @@ public class SchemaRegistryImpl implements SchemaRegistry {
 
         ColumnMapper mapping = resolveMapping(rowSchema, curSchema);
 
-        return new UpgradingRowAdapter(curSchema, row, mapping);
+        return new UpgradingRowAdapter(curSchema, rowSchema, row, mapping);
     }
 
     /**
diff --git a/modules/schema/src/main/java/org/apache/ignite/internal/schema/registry/UpgradingRowAdapter.java b/modules/schema/src/main/java/org/apache/ignite/internal/schema/registry/UpgradingRowAdapter.java
index 0f308ec..42ba191 100644
--- a/modules/schema/src/main/java/org/apache/ignite/internal/schema/registry/UpgradingRowAdapter.java
+++ b/modules/schema/src/main/java/org/apache/ignite/internal/schema/registry/UpgradingRowAdapter.java
@@ -17,7 +17,12 @@
 
 package org.apache.ignite.internal.schema.registry;
 
+import java.math.BigDecimal;
+import java.util.BitSet;
+import java.util.UUID;
 import org.apache.ignite.internal.schema.BinaryRow;
+import org.apache.ignite.internal.schema.Column;
+import org.apache.ignite.internal.schema.SchemaException;
 import org.apache.ignite.internal.schema.mapping.ColumnMapper;
 import org.apache.ignite.internal.schema.InvalidTypeException;
 import org.apache.ignite.internal.schema.NativeTypeSpec;
@@ -31,21 +36,333 @@ class UpgradingRowAdapter extends Row {
     /** Column mapper. */
     private final ColumnMapper mapping;
 
+    /** Adapter schema. */
+    private final SchemaDescriptor schema;
+
     /**
-     * @param schema Schema descriptor of new version.
+     * @param schema Row adapter schema descriptor.
+     * @param rowSchema Row schema descriptor.
      * @param row Row.
      * @param mapping Column mapping.
      */
-    UpgradingRowAdapter(SchemaDescriptor schema, BinaryRow row, ColumnMapper mapping) {
-        super(schema, row);
-
+    UpgradingRowAdapter(SchemaDescriptor schema, SchemaDescriptor rowSchema, BinaryRow row, ColumnMapper mapping) {
+        super(rowSchema, row);
+        this.schema = schema;
         this.mapping = mapping;
     }
 
     /** {@inheritDoc} */
-    @Override protected long findColumn(int colIdx, NativeTypeSpec type) throws InvalidTypeException {
-        int mapIdx = mapping.map(colIdx);
+    @Override public SchemaDescriptor rowSchema() {
+        return schema;
+    }
+
+    @Override public int schemaVersion() {
+        return schema.version();
+    }
+
+    /** {@inheritDoc} */
+    private int mapColumn(int colIdx) throws InvalidTypeException {
+        return mapping.map(colIdx);
+
+    }
+
+    /**
+     * Reads value for specified column.
+     *
+     * @param colIdx Column index.
+     * @return Column value.
+     * @throws InvalidTypeException If actual column type does not match the requested column type.
+     */
+    @Override public byte byteValue(int colIdx) throws InvalidTypeException {
+        int mappedId = mapColumn(colIdx);
+
+        Column column = mappedId < 0 ? mapping.mappedColumn(colIdx) : super.rowSchema().column(mappedId);
+
+        if (NativeTypeSpec.BYTE != column.type().spec())
+            throw new SchemaException("Type conversion is not supported yet.");
+
+        return mappedId < 0 ? (byte)column.defaultValue() : super.byteValue(mappedId);
+    }
+
+    /**
+     * Reads value for specified column.
+     *
+     * @param colIdx Column index.
+     * @return Column value.
+     * @throws InvalidTypeException If actual column type does not match the requested column type.
+     */
+    @Override public Byte byteValueBoxed(int colIdx) throws InvalidTypeException {
+        int mappedId = mapColumn(colIdx);
+
+        Column column = mappedId < 0 ? mapping.mappedColumn(colIdx) : super.rowSchema().column(mappedId);
+
+        if (NativeTypeSpec.BYTE != column.type().spec())
+            throw new SchemaException("Type conversion is not supported yet.");
+
+        return mappedId < 0 ? (Byte)column.defaultValue() : super.byteValueBoxed(mappedId);
+    }
+
+    /**
+     * Reads value for specified column.
+     *
+     * @param colIdx Column index.
+     * @return Column value.
+     * @throws InvalidTypeException If actual column type does not match the requested column type.
+     */
+    @Override public short shortValue(int colIdx) throws InvalidTypeException {
+        int mappedId = mapColumn(colIdx);
+
+        Column column = mappedId < 0 ? mapping.mappedColumn(colIdx) : super.rowSchema().column(mappedId);
+
+        if (NativeTypeSpec.SHORT != column.type().spec())
+            throw new SchemaException("Type conversion is not supported yet.");
+
+        return mappedId < 0 ? (short)column.defaultValue() : super.shortValue(mappedId);
+    }
+
+    /**
+     * Reads value for specified column.
+     *
+     * @param colIdx Column index.
+     * @return Column value.
+     * @throws InvalidTypeException If actual column type does not match the requested column type.
+     */
+    @Override public Short shortValueBoxed(int colIdx) throws InvalidTypeException {
+        int mappedId = mapColumn(colIdx);
+
+        Column column = mappedId < 0 ? mapping.mappedColumn(colIdx) : super.rowSchema().column(mappedId);
+
+        if (NativeTypeSpec.SHORT != column.type().spec())
+            throw new SchemaException("Type conversion is not supported yet.");
+
+        return mappedId < 0 ? (Short)column.defaultValue() : super.shortValueBoxed(mappedId);
+    }
+
+    /**
+     * Reads value for specified column.
+     *
+     * @param colIdx Column index.
+     * @return Column value.
+     * @throws InvalidTypeException If actual column type does not match the requested column type.
+     */
+    @Override public int intValue(int colIdx) throws InvalidTypeException {
+        int mappedId = mapColumn(colIdx);
+
+        Column column = mappedId < 0 ? mapping.mappedColumn(colIdx) : super.rowSchema().column(mappedId);
+
+        if (NativeTypeSpec.INTEGER != column.type().spec())
+            throw new SchemaException("Type conversion is not supported yet.");
+
+        return mappedId < 0 ? (int)column.defaultValue() : super.intValue(mappedId);
+    }
+
+    /**
+     * Reads value for specified column.
+     *
+     * @param colIdx Column index.
+     * @return Column value.
+     * @throws InvalidTypeException If actual column type does not match the requested column type.
+     */
+    @Override public Integer intValueBoxed(int colIdx) throws InvalidTypeException {
+        int mappedId = mapColumn(colIdx);
+
+        Column column = mappedId < 0 ? mapping.mappedColumn(colIdx) : super.rowSchema().column(mappedId);
+
+        if (NativeTypeSpec.INTEGER != column.type().spec())
+            throw new SchemaException("Type conversion is not supported yet.");
+
+        return mappedId < 0 ? (Integer)column.defaultValue() : super.intValueBoxed(mappedId);
+    }
+
+    /**
+     * Reads value for specified column.
+     *
+     * @param colIdx Column index.
+     * @return Column value.
+     * @throws InvalidTypeException If actual column type does not match the requested column type.
+     */
+    @Override public long longValue(int colIdx) throws InvalidTypeException {
+        int mappedId = mapColumn(colIdx);
+
+        Column column = mappedId < 0 ? mapping.mappedColumn(colIdx) : super.rowSchema().column(mappedId);
+
+        if (NativeTypeSpec.LONG != column.type().spec())
+            throw new SchemaException("Type conversion is not supported yet.");
+
+        return mappedId < 0 ? (long)column.defaultValue() : super.longValue(mappedId);
+    }
+
+    /**
+     * Reads value for specified column.
+     *
+     * @param colIdx Column index.
+     * @return Column value.
+     * @throws InvalidTypeException If actual column type does not match the requested column type.
+     */
+    @Override public Long longValueBoxed(int colIdx) throws InvalidTypeException {
+        int mappedId = mapColumn(colIdx);
+
+        Column column = mappedId < 0 ? mapping.mappedColumn(colIdx) : super.rowSchema().column(mappedId);
+
+        if (NativeTypeSpec.LONG != column.type().spec())
+            throw new SchemaException("Type conversion is not supported yet.");
+
+        return mappedId < 0 ? (Long)column.defaultValue() : super.longValueBoxed(mappedId);
+    }
+
+    /**
+     * Reads value for specified column.
+     *
+     * @param colIdx Column index.
+     * @return Column value.
+     * @throws InvalidTypeException If actual column type does not match the requested column type.
+     */
+    @Override public float floatValue(int colIdx) throws InvalidTypeException {
+        int mappedId = mapColumn(colIdx);
+
+        Column column = mappedId < 0 ? mapping.mappedColumn(colIdx) : super.rowSchema().column(mappedId);
+
+        if (NativeTypeSpec.FLOAT != column.type().spec())
+            throw new SchemaException("Type conversion is not supported yet.");
+
+        return mappedId < 0 ? (float)column.defaultValue() : super.floatValue(mappedId);
+    }
+
+    /**
+     * Reads value for specified column.
+     *
+     * @param colIdx Column index.
+     * @return Column value.
+     * @throws InvalidTypeException If actual column type does not match the requested column type.
+     */
+    @Override public Float floatValueBoxed(int colIdx) throws InvalidTypeException {
+        int mappedId = mapColumn(colIdx);
+
+        Column column = mappedId < 0 ? mapping.mappedColumn(colIdx) : super.rowSchema().column(mappedId);
+
+        if (NativeTypeSpec.FLOAT != column.type().spec())
+            throw new SchemaException("Type conversion is not supported yet.");
+
+        return mappedId < 0 ? (Float)column.defaultValue() : super.floatValueBoxed(mappedId);
+    }
+
+    /**
+     * Reads value for specified column.
+     *
+     * @param colIdx Column index.
+     * @return Column value.
+     * @throws InvalidTypeException If actual column type does not match the requested column type.
+     */
+    @Override public double doubleValue(int colIdx) throws InvalidTypeException {
+        int mappedId = mapColumn(colIdx);
+
+        Column column = mappedId < 0 ? mapping.mappedColumn(colIdx) : super.rowSchema().column(mappedId);
+
+        if (NativeTypeSpec.DOUBLE != column.type().spec())
+            throw new SchemaException("Type conversion is not supported yet.");
+
+        return mappedId < 0 ? (double)column.defaultValue() : super.doubleValue(mappedId);
+    }
+
+    /**
+     * Reads value for specified column.
+     *
+     * @param colIdx Column index.
+     * @return Column value.
+     * @throws InvalidTypeException If actual column type does not match the requested column type.
+     */
+    @Override public Double doubleValueBoxed(int colIdx) throws InvalidTypeException {
+        int mappedId = mapColumn(colIdx);
+
+        Column column = mappedId < 0 ? mapping.mappedColumn(colIdx) : super.rowSchema().column(mappedId);
+
+        if (NativeTypeSpec.DOUBLE != column.type().spec())
+            throw new SchemaException("Type conversion is not supported yet.");
+
+        return mappedId < 0 ? (Double)column.defaultValue() : super.doubleValueBoxed(mappedId);
+    }
+
+    /**
+     * Reads value from specified column.
+     *
+     * @param colIdx Column index.
+     * @return Column value.
+     * @throws InvalidTypeException If actual column type does not match the requested column type.
+     */
+    @Override public BigDecimal decimalValue(int colIdx) throws InvalidTypeException {
+        // TODO: IGNITE-13668 decimal support
+        return null;
+    }
+
+    /**
+     * Reads value for specified column.
+     *
+     * @param colIdx Column index.
+     * @return Column value.
+     * @throws InvalidTypeException If actual column type does not match the requested column type.
+     */
+    @Override public String stringValue(int colIdx) throws InvalidTypeException {
+        int mappedId = mapColumn(colIdx);
+
+        Column column = mappedId < 0 ? mapping.mappedColumn(colIdx) : super.rowSchema().column(mappedId);
+
+        if (NativeTypeSpec.STRING != column.type().spec())
+            throw new SchemaException("Type conversion is not supported yet.");
+
+        return mappedId < 0 ? (String)column.defaultValue() : super.stringValue(mappedId);
+    }
+
+    /**
+     * Reads value for specified column.
+     *
+     * @param colIdx Column index.
+     * @return Column value.
+     * @throws InvalidTypeException If actual column type does not match the requested column type.
+     */
+    @Override public byte[] bytesValue(int colIdx) throws InvalidTypeException {
+        int mappedId = mapColumn(colIdx);
+
+        Column column = mappedId < 0 ? mapping.mappedColumn(colIdx) : super.rowSchema().column(mappedId);
+
+        if (NativeTypeSpec.STRING != column.type().spec())
+            throw new SchemaException("Type conversion is not supported yet.");
+
+        return mappedId < 0 ? (byte[])column.defaultValue() : super.bytesValue(mappedId);
+    }
+
+    /**
+     * Reads value for specified column.
+     *
+     * @param colIdx Column index.
+     * @return Column value.
+     * @throws InvalidTypeException If actual column type does not match the requested column type.
+     */
+    @Override public UUID uuidValue(int colIdx) throws InvalidTypeException {
+        int mappedId = mapColumn(colIdx);
+
+        Column column = mappedId < 0 ? mapping.mappedColumn(colIdx) : super.rowSchema().column(mappedId);
+
+        if (NativeTypeSpec.UUID != column.type().spec())
+            throw new SchemaException("Type conversion is not supported yet.");
+
+        return mappedId < 0 ? (UUID)column.defaultValue() : super.uuidValue(mappedId);
+    }
+
+    /**
+     * Reads value for specified column.
+     *
+     * @param colIdx Column index.
+     * @return Column value.
+     * @throws InvalidTypeException If actual column type does not match the requested column type.
+     */
+    @Override public BitSet bitmaskValue(int colIdx) throws InvalidTypeException {
+        int mappedId = mapColumn(colIdx);
+
+        Column column = mappedId < 0 ? mapping.mappedColumn(colIdx) : super.rowSchema().column(mappedId);
+
+        if (NativeTypeSpec.BITMASK != column.type().spec())
+            throw new SchemaException("Type conversion is not supported yet.");
 
-        return (mapIdx < 0) ? Long.MIN_VALUE : super.findColumn(mapIdx, type);
+        return mappedId < 0 ? (BitSet)column.defaultValue() : super.bitmaskValue(mappedId);
     }
 }