@Override
    public Object parse(SourceData sourceData, int rowIndex, Context context) {
        Object dateObj = dateParser.parse(sourceData, rowIndex, context);
        Date date = OperatorTools.parseDate(dateObj);
        LocalDate localDate = date.toLocalDate();
        switch (type) {
            // year
            case YEAR:
                return localDate.getYear();
            // quarter(between 1 and 4)
            case QUARTER:
                return (localDate.getMonthValue() - 1) / 3 + 1;
            // month(between 1 and 12)
            case MONTH:
                return localDate.getMonthValue();
            // week(between 1 and 53)
            case WEEK:
                return localDate.get(weekOfYearField);
            // dayofyear(between 1 and 366)
            case DAY_OF_YEAR:
                return localDate.getDayOfYear();
            // dayofmonth(between 1 and 31)
            case DAY_OF_MONTH:
                return localDate.getDayOfMonth();
            // dayofweek(between 1 and 7)
            case DAY_OF_WEEK:
                return localDate.getDayOfWeek().getValue() % 7 + 1;
            // dayname(between Sunday and Saturday)
            case DAY_NAME:
                return localDate.getDayOfWeek().name();
            default:
                return null;
        }
    }
DateExtractFunction
description:
- year(date)--returns the year from SQL date
- quarter(date)--returns the quarter of a year (an integer between 1 and 4) from SQL date
- month(date)--returns the month of a year (an integer between 1 and 12) from SQL date
- week(date)--returns the week of a year (an integer between 1 and 53) from SQL date
- dayofyear(date)--returns the day of a year (an integer between 1 and 366) from SQL date
- dayofmonth(date)--returns the day of a month (an integer between 1 and 31) from SQL date
- dayofweek(date)--returns the day of a week (an integer between 1(Sunday) and 7(Saturday)) from SQL date
- dayname(date)--returns the name of the day of the week from SQL date
inlong-sdk/transform-sdk/src/main/java/org/apache/inlong/sdk/transform/process/function/temporal/DateExtractFunction.java