Re: Date and time formats in the standard operator table

2020-02-20 Thread Danny Chan
Maybe the format for CAST in SQL 2016 [1] is what you need, it’s not 
implemented yet.

[1] https://issues.apache.org/jira/browse/CALCITE-2980

Best,
Danny Chan
在 2020年2月20日 +0800 PM7:02,Soma Mondal ,写道:
> Hi,
>
>
> We are seeing that in many dialects, there is support for formatting dates,
> times and timestamps (please see THIS
> 
> link for information about SqlServer, MySql, Oracle, Teradata).
>
>
> In the current standard operator table, we don't see any operator that does
> such a thing. We were thinking that we should add a new standard operator
> which follows the formatting standard followed by SimpleDateFormat.java
>
>
> Can you please share your inputs regarding this? Should we go ahead and do
> so or do you have other thoughts regarding this?
>
>
> *Regards,*
> *Soma Mondal*


Re: Date and time formats in the standard operator table

2020-02-20 Thread Julian Hyde
I don’t think there’s a standard, and we wouldn’t be solving the problem if we 
create our own “standard”. (See https://xkcd.com/927/ .) 
So it’s better to implement everyone else’s “standard” and let our users choose.

It would be a great start if someone were to contribute an implementation of 
Oracle’s TO_CHAR function that works for number, date, time, timestamp, 
interval.

It’s one of a long list of functions in 
https://issues.apache.org/jira/browse/CALCITE-759 
. 

(Not to play favorites - we’d be happy to also accept implementations of every 
other database’s TO_CHAR function, or equivalent.)

Julian


> On Feb 20, 2020, at 3:02 AM, Soma Mondal  wrote:
> 
> Hi,
> 
> 
> We are seeing that in many dialects, there is support for formatting dates,
> times and timestamps (please see THIS
> 
> link for information about SqlServer, MySql, Oracle, Teradata).
> 
> 
> In the current standard operator table, we don't see any operator that does
> such a thing. We were thinking that we should add a new standard operator
> which follows the formatting standard followed by SimpleDateFormat.java
> 
> 
> Can you please share your inputs regarding this? Should we go ahead and do
> so or do you have other thoughts regarding this?
> 
> 
> *Regards,*
> *Soma Mondal*



Date and time formats in the standard operator table

2020-02-20 Thread Soma Mondal
Hi,


We are seeing that in many dialects, there is support for formatting dates,
times and timestamps (please see THIS

link for information about SqlServer, MySql, Oracle, Teradata).


In the current standard operator table, we don't see any operator that does
such a thing. We were thinking that we should add a new standard operator
which follows the formatting standard followed by SimpleDateFormat.java


Can you please share your inputs regarding this? Should we go ahead and do
so or do you have other thoughts regarding this?


*Regards,*
*Soma Mondal*