private static long mod(long res, BigDecimal value) {
    if (value.equals(BigDecimal.ONE)) {
      return res;
    } else {
      return res % value.longValue();
    }
  }
Helper for CAST({date} AS VARCHAR(n)).
amoro-format-mixed/amoro-mixed-flink/amoro-mixed-flink-common/src/main/java/org/apache/amoro/flink/util/DateTimeUtils.java