@Test public void test_null_equal_missing() { FunctionExpression equal = dsl.equal(DSL.ref(BOOL_TYPE_MISSING_VALUE_FIELD, BOOLEAN), DSL.ref(BOOL_TYPE_MISSING_VALUE_FIELD, BOOLEAN)); assertEquals(BOOLEAN, equal.type()); assertEquals(LITERAL_MISSING, equal.valueOf(valueEnv())); equal = dsl.equal(DSL.ref(BOOL_TYPE_NULL_VALUE_FIELD, BOOLEAN), DSL.ref(BOOL_TYPE_NULL_VALUE_FIELD, BOOLEAN)); assertEquals(BOOLEAN, equal.type()); assertEquals(LITERAL_NULL, equal.valueOf(valueEnv())); equal = dsl.equal(DSL.ref(BOOL_TYPE_NULL_VALUE_FIELD, BOOLEAN), DSL.ref(BOOL_TYPE_MISSING_VALUE_FIELD, BOOLEAN)); assertEquals(BOOLEAN, equal.type()); assertEquals(LITERAL_MISSING, equal.valueOf(valueEnv())); equal = dsl.equal(DSL.ref(BOOL_TYPE_MISSING_VALUE_FIELD, BOOLEAN), DSL.ref(BOOL_TYPE_NULL_VALUE_FIELD, BOOLEAN)); assertEquals(BOOLEAN, equal.type()); assertEquals(LITERAL_MISSING, equal.valueOf(valueEnv())); equal = dsl.equal(DSL.literal(LITERAL_TRUE), DSL.ref(BOOL_TYPE_MISSING_VALUE_FIELD, BOOLEAN)); assertEquals(BOOLEAN, equal.type()); assertEquals(LITERAL_MISSING, equal.valueOf(valueEnv())); equal = dsl.equal(DSL.literal(LITERAL_TRUE), DSL.ref(BOOL_TYPE_NULL_VALUE_FIELD, BOOLEAN)); assertEquals(BOOLEAN, equal.type()); assertEquals(LITERAL_NULL, equal.valueOf(valueEnv())); equal = dsl.equal(DSL.ref(BOOL_TYPE_MISSING_VALUE_FIELD, BOOLEAN), DSL.literal(LITERAL_TRUE)); assertEquals(BOOLEAN, equal.type()); assertEquals(LITERAL_MISSING, equal.valueOf(valueEnv())); equal = dsl.equal(DSL.ref(BOOL_TYPE_NULL_VALUE_FIELD, BOOLEAN), DSL.literal(LITERAL_TRUE)); assertEquals(BOOLEAN, equal.type()); assertEquals(LITERAL_NULL, equal.valueOf(valueEnv())); }
private static FunctionResolver equal() { return FunctionDSL.define(BuiltinFunctionName.EQUAL.getName(), ExprCoreType.coreTypes().stream() .map(type -> FunctionDSL.impl( FunctionDSL.nullMissingHandling((v1, v2) -> ExprBooleanValue.of(v1.equals(v2))), BOOLEAN, type, type)) .collect( Collectors.toList())); }
BinaryPredicateOperator { private static FunctionResolver equal() { return FunctionDSL.define(BuiltinFunctionName.EQUAL.getName(), ExprCoreType.coreTypes().stream() .map(type -> FunctionDSL.impl( FunctionDSL.nullMissingHandling((v1, v2) -> ExprBooleanValue.of(v1.equals(v2))), BOOLEAN, type, type)) .collect( Collectors.toList())); } }
BinaryPredicateOperator { private static FunctionResolver equal() { return FunctionDSL.define(BuiltinFunctionName.EQUAL.getName(), ExprCoreType.coreTypes().stream() .map(type -> FunctionDSL.impl( FunctionDSL.nullMissingHandling((v1, v2) -> ExprBooleanValue.of(v1.equals(v2))), BOOLEAN, type, type)) .collect( Collectors.toList())); }  }
BinaryPredicateOperator { private static FunctionResolver equal() { return FunctionDSL.define(BuiltinFunctionName.EQUAL.getName(), ExprCoreType.coreTypes().stream() .map(type -> FunctionDSL.impl( FunctionDSL.nullMissingHandling((v1, v2) -> ExprBooleanValue.of(v1.equals(v2))), BOOLEAN, type, type)) .collect( Collectors.toList())); }  static void register(BuiltinFunctionRepository repository); }
BinaryPredicateOperator { private static FunctionResolver equal() { return FunctionDSL.define(BuiltinFunctionName.EQUAL.getName(), ExprCoreType.coreTypes().stream() .map(type -> FunctionDSL.impl( FunctionDSL.nullMissingHandling((v1, v2) -> ExprBooleanValue.of(v1.equals(v2))), BOOLEAN, type, type)) .collect( Collectors.toList())); }  static void register(BuiltinFunctionRepository repository);  }