private static int digitCount(int v) {
    for (int n = 1; ; n++) {
      v /= 10;
      if (v == 0) {
        return n;
      }
    }
  }
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