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

Ignite TC Bot commented on IGNITE-23468:
----------------------------------------

{panel:title=Branch: [pull/11600/head] Base: [master] : No blockers 
found!|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1}{panel}
{panel:title=Branch: [pull/11600/head] Base: [master] : No new tests 
found!|borderStyle=dashed|borderColor=#ccc|titleBGColor=#F7D6C1}{panel}
[TeamCity *--> Run :: All* 
Results|https://ci2.ignite.apache.org/viewLog.html?buildId=8118109&buildTypeId=IgniteTests24Java8_RunAll]

> Calcite. Fix error of unsupported 'FORMAT' in 'CAST'.
> -----------------------------------------------------
>
>                 Key: IGNITE-23468
>                 URL: https://issues.apache.org/jira/browse/IGNITE-23468
>             Project: Ignite
>          Issue Type: Bug
>    Affects Versions: 2.17
>            Reporter: Vladimir Steshin
>            Assignee: Vladimir Steshin
>            Priority: Minor
>              Labels: calcite, ignite-2, ise
>             Fix For: 2.17
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Calcite v1.37 introduced 'FORMAT' operand in 'CAST. We should support it or 
> raise an unsupporting error. Since the operator seems not to be popular among 
> DBs, let's rise an error. At least for now.
> Currently, with '-ea' JVM option
> {code:java}
> sql("SELECT CAST('2021-01-01' AS DATE FORMAT 'DD-MM-YY')")
> {code}
> produces:
> {code:java}
>  java.lang.AssertionError: null
>       at 
> org.apache.ignite.internal.processors.query.calcite.exec.exp.RexImpTable$CastImplementor.implementSafe(RexImpTable.java:1517)
>  ~[classes/:?]
>       at 
> org.apache.ignite.internal.processors.query.calcite.exec.exp.RexImpTable$AbstractRexCallImplementor.genValueStatement(RexImpTable.java:1956)
>  ~[classes/:?]
>       at 
> org.apache.ignite.internal.processors.query.calcite.exec.exp.RexImpTable$AbstractRexCallImplementor.implement(RexImpTable.java:1917)
>  ~[classes/:?]
>       at 
> org.apache.ignite.internal.processors.query.calcite.exec.exp.RexToLixTranslator.visitCall(RexToLixTranslator.java:1052)
>  ~[classes/:?]
>       at 
> org.apache.ignite.internal.processors.query.calcite.exec.exp.RexToLixTranslator.visitCall(RexToLixTranslator.java:81)
>  ~[classes/:?]
> {code}
> Without '-ea':
> {code:java}
> assertQuery("SELECT CAST('2021-01-02' AS DATE FORMAT 'DD-MM-YYYY')")
>             .returns(sqlTime("02-01-2021")).check();
> {code}
> produces:
> {code:java}
> java.lang.AssertionError: Collections are not equal (position 0):
> Expected: [[02-01-2021]]
> Actual:   [[2021-01-02]]
> {code}



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

Reply via email to