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){ if(column.getRawData() != null){
switch (columnType) { switch (columnType) {
case INT: case INT:
bytes = Bytes.toBytes(column.asLong().intValue()); bytes = Bytes.toBytes(String.valueOf(column.asLong().intValue()));
break; break;
case LONG: case LONG:
bytes = Bytes.toBytes(column.asLong()); bytes = Bytes.toBytes(String.valueOf(column.asLong()));
break; break;
case DOUBLE: case DOUBLE:
bytes = Bytes.toBytes(column.asDouble()); bytes = Bytes.toBytes(String.valueOf(column.asDouble()));
break; break;
case FLOAT: case FLOAT:
bytes = Bytes.toBytes(column.asDouble().floatValue()); bytes = Bytes.toBytes(String.valueOf(column.asDouble().floatValue()));
break; break;
case SHORT: case SHORT:
bytes = Bytes.toBytes(column.asLong().shortValue()); bytes = Bytes.toBytes(String.valueOf(column.asLong().shortValue()));
break; break;
case BOOLEAN: case BOOLEAN:
bytes = Bytes.toBytes(column.asBoolean()); bytes = Bytes.toBytes(String.valueOf(column.asBoolean()));
break; break;
case STRING: case STRING:
bytes = this.getValueByte(columnType,column.asString()); bytes = this.getValueByte(columnType,column.asString());