spark-instrumented-optimizer/sql/catalyst/src/main
Maxim Gekk 64ce1c9f93 [SPARK-26657][SQL] Use Proleptic Gregorian calendar in DayWeek and in WeekOfYear
## What changes were proposed in this pull request?

The expressions `DayWeek`, `DayOfWeek`, `WeekDay` and `WeekOfYear` are changed to use Proleptic Gregorian calendar instead of the hybrid one (Julian+Gregorian). This was achieved by using Java 8 API for date/timestamp manipulation, in particular the `LocalDate` class.

Week of year calculation is performed according to ISO-8601. The first week of a week-based-year is the first Monday-based week of the standard ISO year that has at least 4 days in the new year (see https://docs.oracle.com/javase/8/docs/api/java/time/temporal/IsoFields.html).

## How was this patch tested?

The changes were tested by `DateExpressionsSuite` and `DateFunctionsSuite`.

Closes #23594 from MaxGekk/dayweek-gregorian.

Lead-authored-by: Maxim Gekk <max.gekk@gmail.com>
Co-authored-by: Maxim Gekk <maxim.gekk@databricks.com>
Signed-off-by: Herman van Hovell <hvanhovell@databricks.com>
2019-01-22 17:33:29 +01:00
..
antlr4/org/apache/spark/sql/catalyst/parser [SPARK-26435][SQL] Support creating partitioned table using Hive CTAS by specifying partition column names 2018-12-27 16:03:14 +08:00
java/org/apache/spark/sql [SPARK-26621][CORE] Use ConfigEntry for hardcoded configs for shuffle categories. 2019-01-17 12:29:17 -06:00
scala/org/apache/spark/sql [SPARK-26657][SQL] Use Proleptic Gregorian calendar in DayWeek and in WeekOfYear 2019-01-22 17:33:29 +01:00