Update HbaseAbstractTask.java

修复hbase11xwriter插件指定字段类型为boolean、short、int、long、float、double时目标端写入乱码问题。
This commit is contained in:
airyv 2023-09-08 14:28:15 +08:00 committed by GitHub
parent 0cd1472bf8
commit dd662ab1f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,22 +90,22 @@ public abstract class HbaseAbstractTask {
if(column.getRawData() != null){
switch (columnType) {
case INT:
bytes = Bytes.toBytes(column.asLong().intValue());
bytes = Bytes.toBytes(String.valueOf(column.asLong().intValue()));
break;
case LONG:
bytes = Bytes.toBytes(column.asLong());
bytes = Bytes.toBytes(String.valueOf(column.asLong()));
break;
case DOUBLE:
bytes = Bytes.toBytes(column.asDouble());
bytes = Bytes.toBytes(String.valueOf(column.asDouble()));
break;
case FLOAT:
bytes = Bytes.toBytes(column.asDouble().floatValue());
bytes = Bytes.toBytes(String.valueOf(column.asDouble().floatValue()));
break;
case SHORT:
bytes = Bytes.toBytes(column.asLong().shortValue());
bytes = Bytes.toBytes(String.valueOf(column.asLong().shortValue()));
break;
case BOOLEAN:
bytes = Bytes.toBytes(column.asBoolean());
bytes = Bytes.toBytes(String.valueOf(column.asBoolean()));
break;
case STRING:
bytes = this.getValueByte(columnType,column.asString());