public static String formatIntervalDayTime(long v) {
    final int scale = 3;
    final StringBuilder buf = new StringBuilder();
    if (v >= 0) {
      buf.append('+');
    } else {
      buf.append('-');
      v = -v;
    }
    final long ms;
    final long s;
    final long m;
    final long h;
    final long d;
    v = roundUp(v, powerX(10, 3 - scale));
    ms = v % 1000;
    v /= 1000;
    s = v % 60;
    v /= 60;
    m = v % 60;
    v /= 60;
    h = v % 24;
    v /= 24;
    d = v;
    buf.append((int) d);
    buf.append(' ');
    number(buf, (int) h, 2);
    buf.append(':');
    number(buf, (int) m, 2);
    buf.append(':');
    number(buf, (int) s, 2);
    fraction(buf, scale, ms);
    return buf.toString();
  }
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