AMashenkov commented on code in PR #2964:
URL: https://github.com/apache/ignite-3/pull/2964#discussion_r1432823690
##########
modules/schema/src/main/java/org/apache/ignite/internal/schema/registry/UpgradingRowAdapter.java:
##########
@@ -160,7 +163,7 @@ public Byte byteValueBoxed(int colIdx) throws
InvalidTypeException {
Column column = mappedId < 0 ? mapper.mappedColumn(colIdx) :
super.schema().column(mappedId);
- if (NativeTypeSpec.INT8 != column.type().spec()) {
+ if (!isSupportedColumnTypeChange(column.type().spec().asColumnType(),
ColumnType.INT8)) {
Review Comment:
```suggestion
ensureColumnOfCompatibleType(column.type().spec().asColumnType(),
ColumnType.INT8);
```
Let's move this check to a separate method:
```
void ensureColumnOfCompatibleType(ColumnType from, ColumnType to) {
if (!isSupportedColumnTypeChange(from ,to)) {
throw new SchemaException("Type conversion is not allowed: {} ->
{}", from, to);
}
}
```
--
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]