MathematicalFunction { private static FunctionResolver abs() { return FunctionDSL.define(BuiltinFunctionName.ABS.getName(), FunctionDSL.impl( FunctionDSL.nullMissingHandling(v -> new ExprShortValue(Math.abs(v.shortValue()))), SHORT, SHORT), FunctionDSL.impl( FunctionDSL.nullMissingHandling(v -> new ExprIntegerValue(Math.abs(v.integerValue()))), INTEGER, INTEGER), FunctionDSL.impl( FunctionDSL.nullMissingHandling(v -> new ExprLongValue(Math.abs(v.longValue()))), LONG, LONG), FunctionDSL.impl( FunctionDSL.nullMissingHandling(v -> new ExprFloatValue(Math.abs(v.floatValue()))), FLOAT, FLOAT), FunctionDSL.impl( FunctionDSL.nullMissingHandling(v -> new ExprDoubleValue(Math.abs(v.doubleValue()))), DOUBLE, DOUBLE) ); }  static void register(BuiltinFunctionRepository repository);  }
@Test public void abs_null_value() { assertTrue(dsl.abs(DSL.ref(INT_TYPE_NULL_VALUE_FIELD, INTEGER)).valueOf(valueEnv()).isNull()); }
@Test public void abs_missing_value() { assertTrue( dsl.abs(DSL.ref(INT_TYPE_MISSING_VALUE_FIELD, INTEGER)).valueOf(valueEnv()).isMissing()); }