@Test public void sign_missing_value() { FunctionExpression sign = dsl.sign(DSL.ref(INT_TYPE_MISSING_VALUE_FIELD, INTEGER)); assertEquals(INTEGER, sign.type()); assertTrue(sign.valueOf(valueEnv()).isMissing()); }
private static FunctionResolver sign() { return FunctionDSL.define(BuiltinFunctionName.SIGN.getName(), ExprCoreType.numberTypes().stream() .map(type -> FunctionDSL.impl(FunctionDSL.nullMissingHandling( v -> new ExprIntegerValue(Math.signum(v.doubleValue()))), INTEGER, type)).collect(Collectors.toList())); }
MathematicalFunction { private static FunctionResolver sign() { return FunctionDSL.define(BuiltinFunctionName.SIGN.getName(), ExprCoreType.numberTypes().stream() .map(type -> FunctionDSL.impl(FunctionDSL.nullMissingHandling( v -> new ExprIntegerValue(Math.signum(v.doubleValue()))), INTEGER, type)).collect(Collectors.toList())); } }
MathematicalFunction { private static FunctionResolver sign() { return FunctionDSL.define(BuiltinFunctionName.SIGN.getName(), ExprCoreType.numberTypes().stream() .map(type -> FunctionDSL.impl(FunctionDSL.nullMissingHandling( v -> new ExprIntegerValue(Math.signum(v.doubleValue()))), INTEGER, type)).collect(Collectors.toList())); }  }
MathematicalFunction { private static FunctionResolver sign() { return FunctionDSL.define(BuiltinFunctionName.SIGN.getName(), ExprCoreType.numberTypes().stream() .map(type -> FunctionDSL.impl(FunctionDSL.nullMissingHandling( v -> new ExprIntegerValue(Math.signum(v.doubleValue()))), INTEGER, type)).collect(Collectors.toList())); }  static void register(BuiltinFunctionRepository repository); }
MathematicalFunction { private static FunctionResolver sign() { return FunctionDSL.define(BuiltinFunctionName.SIGN.getName(), ExprCoreType.numberTypes().stream() .map(type -> FunctionDSL.impl(FunctionDSL.nullMissingHandling( v -> new ExprIntegerValue(Math.signum(v.doubleValue()))), INTEGER, type)).collect(Collectors.toList())); }  static void register(BuiltinFunctionRepository repository);  }