Skip to content

Commit

Permalink
fix the logging problem in some datatypes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasmine-ge committed Jul 31, 2024
1 parent c57d951 commit 164f444
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
import com.timeplus.data.type.DataTypeDate32;
import com.timeplus.data.type.DataTypeFloat32;
import com.timeplus.data.type.DataTypeFloat64;
import com.timeplus.data.type.DataTypeIPv4;
import com.timeplus.data.type.DataTypeIPv6;
import com.timeplus.data.type.DataTypeInt16;
import com.timeplus.data.type.DataTypeInt256;
import com.timeplus.data.type.DataTypeInt32;
Expand All @@ -57,6 +59,8 @@
import com.timeplus.data.type.complex.DataTypeDateTime;
import com.timeplus.data.type.complex.DataTypeDateTime64;
import com.timeplus.data.type.complex.DataTypeDecimal;
import com.timeplus.data.type.complex.DataTypeEnum16;
import com.timeplus.data.type.complex.DataTypeEnum8;
import com.timeplus.data.type.complex.DataTypeFixedString;
import com.timeplus.data.type.complex.DataTypeMap;
import com.timeplus.data.type.complex.DataTypeNothing;
Expand Down Expand Up @@ -282,7 +286,7 @@ private Object convertToCkDataType(IDataType<?, ?> type, Object obj) throws Time
if (obj instanceof Number)
return ((Number) obj).longValue();
}
if (type instanceof DataTypeUInt64 || type instanceof DataTypeInt128 || type instanceof DataTypeInt256 || type instanceof DataTypeUInt128 || type instanceof DataTypeUInt256) {
if (type instanceof DataTypeUInt64 || type instanceof DataTypeInt128 || type instanceof DataTypeInt256 || type instanceof DataTypeUInt128 || type instanceof DataTypeUInt256 || type instanceof DataTypeIPv6) {
if (obj instanceof BigInteger)
return obj;
if (obj instanceof BigDecimal)
Expand Down Expand Up @@ -313,6 +317,20 @@ private Object convertToCkDataType(IDataType<?, ?> type, Object obj) throws Time
return UUID.fromString((String) obj);
}
}
if (type instanceof DataTypeEnum8 || type instanceof DataTypeEnum16) {
if (obj instanceof String)
return obj;
}
if (type instanceof DataTypeIPv4) {
if (obj instanceof Long)
return obj;
if (obj instanceof Number)
return ((Number) obj).longValue();
}
if (type instanceof DataTypeBool) {
if (obj instanceof Byte)
return obj;
}
if (type instanceof DataTypeNothing) {
return null;
}
Expand Down

0 comments on commit 164f444

Please sign in to comment.