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

Norman Jordan commented on CALCITE-6585:
----------------------------------------

A first step here is to split the operations of compiling a DateTime format 
string and applying that format to a DateTime value. A compiled format string 
would be a sequence of individual format patterns and literal strings. For 
example "YYYY-MM-DD" would end up with the following sequence:
 # Pattern for YYYY
 # Literal string "-"
 # Pattern for MM
 # Literal string "-"
 # Pattern for DD

This sequence is analogous to a compiled RegEx pattern and could be cached.

> In the Postgres TO_CHAR function, improve caching
> -------------------------------------------------
>
>                 Key: CALCITE-6585
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6585
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Julian Hyde
>            Assignee: Norman Jordan
>            Priority: Major
>
> In the Postgres TO_CHAR function (and similar functions added in 
> CALCITE-6358), cache the formatter using the same technique used in 
> CALCITE-5914.
> Also pass the {{DataContext}} into the constructor of {{class 
> DataFormatFunction}}, so that it does not need to be passed to each call to 
> {{toCharPg}}.
> In {{DateFormatFunction}} obsolete static field {{LOCAL_ZONE}} and instead 
> populate a non-static field {{zoneId}} from the {{DataContext}} constructor 
> parameter.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to