Source:
<code>protected JdbcDeserializationConverter createInternalConverter(LogicalType type) { switch (type.getTypeRoot()) { case NULL: return (val, sqlType, unsigned) -> null; case BOOLEAN: case FLOAT: case DOUBLE: case INTERVAL_YEAR_MONTH: case INTERVAL_DAY_TIME: return (val, sqlType, unsigned) -> val; case TINYINT: return (val, sqlType, unsigned) -> ((Integer) val).byteValue(); case SMALLINT: <START> return (val, sqlType, unsigned) -> (Integer.valueOf(val.toString())).shortValue(); <END> case INTEGER: return (val, sqlType, unsigned) -> sqlType == Types.SMALLINT && unsigned ? Integer.valueOf(val.toString()) : val; case BIGINT: return (val, sqlType, unsigned) -> sqlType == Types.INTEGER && unsigned ? Long.valueOf(val.toString()) : val; case DECIMAL: final int precision = ((DecimalType) type).getPrecision(); final int scale = ((DecimalType) type).getScale(); return (val, sqlType, unsigned) -> sqlType == Types.BIGINT && unsigned ? DecimalData.fromBigDecimal(new BigDecimal((BigInteger) val, 0), 20, 0) : DecimalData.fromBigDecimal((BigDecimal) val, precision, scale); case DATE: return (val, sqlType, unsigned) -> (int) (((Date) val).toLocalDate().toEpochDay()); case TIME_WITHOUT_TIME_ZONE: return (val, sqlType, unsigned) -> (int) (((Time) val).toLocalTime().toNanoOfDay() / 1_000_000L); case TIMESTAMP_WITH_TIME_ZONE: case TIMESTAMP_WITHOUT_TIME_ZONE: return (val, sqlType, unsigned) -> TimestampData.fromTimestamp((Timestamp) val); case CHAR: case VARCHAR: return (val, sqlType, unsigned) -> StringData.fromString((String) val); case BINARY: case VARBINARY: return (val, sqlType, unsigned) -> (byte[]) val; case ARRAY: case ROW: case MAP: case MULTISET: case RAW: default: throw new UnsupportedOperationException("Unsupported type:" + type); } }</code><technical_language>if (val instanceOf Integer) instead of string parse</technical_language>

Target:
protected JdbcDeserializationConverter createInternalConverter(LogicalType type) { switch (type.getTypeRoot()) { case NULL: return val -> null; case BOOLEAN: case FLOAT: case DOUBLE: case INTERVAL_YEAR_MONTH: case INTERVAL_DAY_TIME: return val -> val; case TINYINT: return val -> ((Integer) val).byteValue(); case SMALLINT: return val -> val instanceof Integer ? ((Integer) val).shortValue() : val; case INTEGER: return val -> val; case BIGINT: return val -> val; case DECIMAL: final int precision = ((DecimalType) type).getPrecision(); final int scale = ((DecimalType) type).getScale(); return val -> val instanceof BigInteger ? DecimalData.fromBigDecimal(new BigDecimal((BigInteger) val, 0), precision, scale) : DecimalData.fromBigDecimal((BigDecimal) val, precision, scale); case DATE: return val -> (int) (((Date) val).toLocalDate().toEpochDay()); case TIME_WITHOUT_TIME_ZONE: return val -> (int) (((Time) val).toLocalTime().toNanoOfDay() / 1_000_000L); case TIMESTAMP_WITH_TIME_ZONE: case TIMESTAMP_WITHOUT_TIME_ZONE: return val -> TimestampData.fromTimestamp((Timestamp) val); case CHAR: case VARCHAR: return val -> StringData.fromString((String) val); case BINARY: case VARBINARY: return val -> (byte[]) val; case ARRAY: case ROW: case MAP: case MULTISET: case RAW: default: throw new UnsupportedOperationException("Unsupported type:" + type); } }