yaooqinn opened a new pull request #26399: [SPARK-29757][SQL] Move calendar interval constants together URL: https://github.com/apache/spark/pull/26399 <!-- Thanks for sending a pull request! Here are some tips for you: 1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html 2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html 3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'. 4. Be sure to keep the PR description updated to reflect all changes. 5. Please write your PR title to summarize what this PR proposes. 6. If possible, provide a concise example to reproduce the issue for a faster review. --> ### What changes were proposed in this pull request? ```java public static final Byte DAYS_PER_MONTH = 30; public static final Byte MONTHS_PER_QUARTER = 3; public static final int MONTHS_PER_YEAR = 12; public static final int YEARS_PER_MILLENNIUM = 1000; public static final int YEARS_PER_CENTURY = 100; public static final int YEARS_PER_DECADE = 10; public static final long NANOS_PER_MICRO = 1000L; public static final long MILLIS_PER_SECOND = 1000L; public static final long MICROS_PER_MILLI = 1000L; public static final long SECONDS_PER_DAY = 24L * 60 * 60; public static final long MILLIS_PER_MINUTE = 60 * MILLIS_PER_SECOND; public static final long MILLIS_PER_HOUR = 60 * MILLIS_PER_MINUTE; public static final long MILLIS_PER_DAY = SECONDS_PER_DAY * MILLIS_PER_SECOND; public static final long MICROS_PER_SECOND = MILLIS_PER_SECOND * MICROS_PER_MILLI; public static final long MICROS_PER_MINUTE = MILLIS_PER_MINUTE * MICROS_PER_MILLI; public static final long MICROS_PER_HOUR = MILLIS_PER_HOUR * MICROS_PER_MILLI; public static final long MICROS_PER_DAY = SECONDS_PER_DAY * MICROS_PER_SECOND; public static final long MICROS_PER_WEEK = MICROS_PER_DAY * 7; public static final long MICROS_PER_MONTH = DAYS_PER_MONTH * MICROS_PER_DAY; /* 365.25 days per year assumes leap year every four years */ public static final long MICROS_PER_YEAR = (36525L * MICROS_PER_DAY) / 100; public static final long NANOS_PER_SECOND = NANOS_PER_MICRO * MICROS_PER_SECOND; public static final long NANOS_PER_MILLIS = NANOS_PER_MICRO * MICROS_PER_MILLI; ``` The above parameters are defined in IntervalUtils, DateTimeUtils, and CalendarInterval, some of them are redundant, some of them are cross-referenced. ### Why are the changes needed? To simplify code, enhance consistency and reduce risks ### Does this PR introduce any user-facing change? no ### How was this patch tested? modified uts
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
