fix(sync): 优化TypeConverterV2的空值判断逻辑

This commit is contained in:
v-zhangjc9
2024-06-13 16:26:44 +08:00
parent 1f9b7fbd08
commit 5bad6b6e1e

View File

@@ -20,7 +20,11 @@ import org.apache.hudi.org.apache.avro.Schema;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.apache.hudi.org.apache.avro.Schema.*;
import static org.apache.hudi.org.apache.avro.Schema.Field;
import static org.apache.hudi.org.apache.avro.Schema.Type;
import static org.apache.hudi.org.apache.avro.Schema.create;
import static org.apache.hudi.org.apache.avro.Schema.createFixed;
import static org.apache.hudi.org.apache.avro.Schema.createUnion;
/**
* 类型转换第二版本
@@ -184,6 +188,6 @@ public class TypeConverterV2 implements TypeConverter {
}
private boolean isNullValue(Object value) {
return StrUtil.isBlankIfStr(value) || ObjectUtil.equals("null", value);
return StrUtil.isBlankIfStr(value) || (value instanceof String ? "null".equalsIgnoreCase((String) value) : value == null);
}
}