MathematicalFunction { private static FunctionResolver crc32() { return FunctionDSL.define(BuiltinFunctionName.CRC32.getName(), FunctionDSL.impl( FunctionDSL.nullMissingHandling(v -> { CRC32 crc = new CRC32(); crc.update(v.stringValue().getBytes()); return new ExprLongValue(crc.getValue()); }), LONG, STRING) ); }  static void register(BuiltinFunctionRepository repository);  }
@Test public void crc32_null_value() { FunctionExpression crc = dsl.crc32(DSL.ref(STRING_TYPE_NULL_VALUE_FILED, STRING)); assertEquals(LONG, crc.type()); assertTrue(crc.valueOf(valueEnv()).isNull()); }
@Test public void crc32_missing_value() { FunctionExpression crc = dsl.crc32(DSL.ref(STRING_TYPE_MISSING_VALUE_FILED, STRING)); assertEquals(LONG, crc.type()); assertTrue(crc.valueOf(valueEnv()).isMissing()); }