private static int getIso8601WeekNumber(int julian, int year, int month, int day) {
    long fmofw = firstMondayOfFirstWeek(year);
    if (month == 12 && day > 28) {
      return 31 - day + 4 > 7 - ((int) floorMod(julian, 7L) + 1)
              && 31 - day + (int) (floorMod(julian, 7L) + 1L) >= 4
          ? (int) ((long) julian - fmofw) / 7 + 1
          : 1;
    } else if (month == 1 && day < 5) {
      return 4 - day <= 7 - ((int) floorMod(julian, 7L) + 1)
              && day - (int) (floorMod(julian, 7L) + 1L) >= -3
          ? 1
          : (int) ((long) julian - firstMondayOfFirstWeek(year - 1)) / 7 + 1;
    } else {
      return (int) ((long) julian - fmofw) / 7 + 1;
    }
  }
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