fix(sync): 修复null字符串=null的识别
This commit is contained in:
@@ -10,8 +10,15 @@ import org.apache.hudi.org.apache.avro.Schema;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static com.lanyuanxiaoyao.service.sync.functions.type.TypeConverterV2.*;
|
||||
import static com.lanyuanxiaoyao.service.sync.functions.type.TypeConverterV2.NULLABLE_BOOLEAN_SCHEMA;
|
||||
import static com.lanyuanxiaoyao.service.sync.functions.type.TypeConverterV2.NULLABLE_DECIMAL_SCHEMA;
|
||||
import static com.lanyuanxiaoyao.service.sync.functions.type.TypeConverterV2.NULLABLE_DOUBLE_SCHEMA;
|
||||
import static com.lanyuanxiaoyao.service.sync.functions.type.TypeConverterV2.NULLABLE_FLOAT_SCHEMA;
|
||||
import static com.lanyuanxiaoyao.service.sync.functions.type.TypeConverterV2.NULLABLE_INT_SCHEMA;
|
||||
import static com.lanyuanxiaoyao.service.sync.functions.type.TypeConverterV2.NULLABLE_LONG_SCHEMA;
|
||||
import static com.lanyuanxiaoyao.service.sync.functions.type.TypeConverterV2.NULLABLE_STRING_SCHEMA;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
|
||||
/**
|
||||
@@ -91,6 +98,11 @@ public class TypeConvertTest {
|
||||
|
||||
// null
|
||||
assertNull(convertValue.exec(NULLABLE_BOOLEAN_SCHEMA, "test", null));
|
||||
assertNull(convertValue.exec(NULLABLE_STRING_SCHEMA, "test", "null"));
|
||||
assertNull(convertValue.exec(NULLABLE_STRING_SCHEMA, "test", "NULL"));
|
||||
assertNull(convertValue.exec(NULLABLE_STRING_SCHEMA, "test", null));
|
||||
assertNull(convertValue.exec(NULLABLE_STRING_SCHEMA, "test", ""));
|
||||
assertNotNull(convertValue.exec(NULLABLE_STRING_SCHEMA, "test", "Null"));
|
||||
|
||||
// boolean
|
||||
assertEquals(true, convertValue.exec(NULLABLE_BOOLEAN_SCHEMA, "test", "true"));
|
||||
|
||||
Reference in New Issue
Block a user