osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What's the alternative scheme of EXTRACT_DATE


EXTRACT_DATE was only ever an internal operator, so you should not have been calling it from SQL. It was removed in https://github.com/apache/calcite/commit/796a28f9a. If you read through the test changes in that commit you will see that it can be replaced by EXTRACT. IIRC, it returns a value in milliseconds since epoch, so if you want days since epoch you will need to divide the value by 86,400,000.

> On Nov 10, 2018, at 8:01 PM, Lijun Cao <641507577@xxxxxx> wrote:
> 
> Hi all,
> 
> I upgraded Calcite from 1.13 to 1.16 recently, and then I have found that SqlstdOperatorTable.EXTRACT_DATE had been removed which caused my source code doesn’t work.
> 
> Are there any alternative scheme to solve it ?
> 
> Really grateful if someone can help me.
> 
> Best Regards
> 
> Lijun Cao
>