@Test public void rand_null_value() { FunctionExpression rand = dsl.rand(DSL.ref(INT_TYPE_NULL_VALUE_FIELD, INTEGER)); assertEquals(FLOAT, rand.type()); assertTrue(rand.valueOf(valueEnv()).isNull()); }
private static FunctionResolver rand() { return FunctionDSL.define(BuiltinFunctionName.RAND.getName(), FunctionDSL.impl(() -> new ExprFloatValue(new Random().nextFloat()), FLOAT), FunctionDSL.impl( FunctionDSL.nullMissingHandling( v -> new ExprFloatValue(new Random(v.integerValue()).nextFloat())), FLOAT, INTEGER) ); }
MathematicalFunction { private static FunctionResolver rand() { return FunctionDSL.define(BuiltinFunctionName.RAND.getName(), FunctionDSL.impl(() -> new ExprFloatValue(new Random().nextFloat()), FLOAT), FunctionDSL.impl( FunctionDSL.nullMissingHandling( v -> new ExprFloatValue(new Random(v.integerValue()).nextFloat())), FLOAT, INTEGER) ); } }
MathematicalFunction { private static FunctionResolver rand() { return FunctionDSL.define(BuiltinFunctionName.RAND.getName(), FunctionDSL.impl(() -> new ExprFloatValue(new Random().nextFloat()), FLOAT), FunctionDSL.impl( FunctionDSL.nullMissingHandling( v -> new ExprFloatValue(new Random(v.integerValue()).nextFloat())), FLOAT, INTEGER) ); }  }
MathematicalFunction { private static FunctionResolver rand() { return FunctionDSL.define(BuiltinFunctionName.RAND.getName(), FunctionDSL.impl(() -> new ExprFloatValue(new Random().nextFloat()), FLOAT), FunctionDSL.impl( FunctionDSL.nullMissingHandling( v -> new ExprFloatValue(new Random(v.integerValue()).nextFloat())), FLOAT, INTEGER) ); }  static void register(BuiltinFunctionRepository repository); }
MathematicalFunction { private static FunctionResolver rand() { return FunctionDSL.define(BuiltinFunctionName.RAND.getName(), FunctionDSL.impl(() -> new ExprFloatValue(new Random().nextFloat()), FLOAT), FunctionDSL.impl( FunctionDSL.nullMissingHandling( v -> new ExprFloatValue(new Random(v.integerValue()).nextFloat())), FLOAT, INTEGER) ); }  static void register(BuiltinFunctionRepository repository);  }