You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2019/06/11 17:43:01 UTC

[jira] [Commented] (CALCITE-2995) Add the DAYNAME,MONTHNAME function

    [ https://issues.apache.org/jira/browse/CALCITE-2995?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16861258#comment-16861258 ] 

Julian Hyde commented on CALCITE-2995:
--------------------------------------

I saw some new changes. Looks like an improvement:
* Does forbiddenApis give errors when you call {{Locale.getDefault()}}? I thought it should.
* I don't think you should call {{Locale.getLanguage()}} to convert it to a string. 
* In SqlFunctions, why do we need {{monthName(int date)}}? Library code must not use default locale. There should be only one line of code that reads the default locale. Everywhere else must use locale from the current context.

> Add the DAYNAME,MONTHNAME function
> ----------------------------------
>
>                 Key: CALCITE-2995
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2995
>             Project: Calcite
>          Issue Type: New Feature
>            Reporter: Forward Xu
>            Assignee: Forward Xu
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 3h
>  Remaining Estimate: 0h
>
> MONTHNAME(date)
>  Returns the full name of the month for date. The language used for the name is controlled by the system time config.
> SQL:
> {code:java}
> SELECT MONTHNAME('2018-01-01') monthname;{code}
> Result:
> ||monthname||
> |January|
> DAYNAME(date)
>  Returns the name of the weekday for date. The language used for the name is controlled by the system time config.
> SQL:
> {code:java}
> SELECT DAYNAME('2018-01-01') dayname;{code}
> Result:
> ||dayname||
> |Monday|



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)