Merge pull request #821 from lawlessluo/master

修复hbase20 reader task 字段值为null的bug
This commit is contained in:
jtchen-study 2025-03-28 11:38:29 +08:00 committed by GitHub
commit cbb098f35f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -86,16 +86,18 @@ public class HBase20xSQLReaderTask {
column = new LongColumn((Integer) value);
break;
case Types.TINYINT:
column = new LongColumn(((Byte) value).longValue());
Byte aByte = (Byte) value;
column = new LongColumn(null == aByte ? null : aByte.longValue());
break;
case Types.SMALLINT:
column = new LongColumn(((Short) value).longValue());
Short aShort = (Short) value;
column = new LongColumn(null == aShort ? null : aShort.longValue());
break;
case Types.BIGINT:
column = new LongColumn((Long) value);
break;
case Types.FLOAT:
column = new DoubleColumn((Float.valueOf(value.toString())));
column = new DoubleColumn(null == value ? null : (Float.valueOf(value.toString())));
break;
case Types.DECIMAL:
column = new DoubleColumn((BigDecimal)value);