@Test
public void truncate_missing_value() {

  FunctionExpression truncate =
      dsl.truncate(DSL.ref(INT_TYPE_MISSING_VALUE_FIELD, INTEGER), DSL.literal(1));
  assertEquals(LONG, truncate.type());
  assertTrue(truncate.valueOf(valueEnv()).isMissing());
  truncate = dsl.truncate(DSL.literal(1), DSL.ref(INT_TYPE_MISSING_VALUE_FIELD, INTEGER));
  assertEquals(LONG, truncate.type());
  assertTrue(truncate.valueOf(valueEnv()).isMissing());
  truncate = dsl.truncate(
      DSL.ref(INT_TYPE_MISSING_VALUE_FIELD, INTEGER),
      DSL.ref(INT_TYPE_MISSING_VALUE_FIELD, INTEGER));
  assertEquals(LONG, truncate.type());
  assertTrue(truncate.valueOf(valueEnv()).isMissing());
}