[ https://issues.apache.org/jira/browse/CALCITE-6252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17815815#comment-17815815 ]
Mihai Budiu commented on CALCITE-6252: -------------------------------------- I used "Julian dates" to refer to a date before the date when the Gregorian calendar was first introduced. I am not an expert on dates, I just tried to summarize what the observed problem is. There is clearly an issue here, because two expressions which are supposed to be equivalent return different results when executed in BigQuery and Calcite. Maybe the issue is in the implementation of the implicit cast of the string literal to a date, or maybe the issue is in the implementation of the format_date function. I will have to investigate. > BigQuery FORMAT_DATE uses the wrong calendar for Julian dates > ------------------------------------------------------------- > > Key: CALCITE-6252 > URL: https://issues.apache.org/jira/browse/CALCITE-6252 > Project: Calcite > Issue Type: Bug > Components: core > Affects Versions: 1.36.0 > Reporter: Mihai Budiu > Priority: Minor > > For the following query: > {code:sql} > SELECT format_date('%A %d %B %Y', '0001-02-28') > {code} > the BigQuery playground returns the following result: > {code} > Monday 01 January 1 > {code} > However, Calcite returns the following result: > {code} > Saturday 01 Jan 1 > {code} > There are actually two bugs here: > - the day of the week is wrong > - the month name is displayed incorrectly. The latter is because of the > Locale.ROOT used in SimpleDateFormat. -- This message was sent by Atlassian Jira (v8.20.10#820010)