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

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

{panel:title=Branch: [pull/11952/head] Base: [master] : No blockers 
found!|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1}{panel}
{panel:title=Branch: [pull/11952/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=8358673&buildTypeId=IgniteTests24Java8_RunAll]

> Calcite. Unable to process default date literal on DDL.
> -------------------------------------------------------
>
>                 Key: IGNITE-24797
>                 URL: https://issues.apache.org/jira/browse/IGNITE-24797
>             Project: Ignite
>          Issue Type: Bug
>    Affects Versions: 2.17
>            Reporter: Vladimir Steshin
>            Assignee: Vladimir Steshin
>            Priority: Minor
>              Labels: calcite, ignite-2, ise
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> *Reproducer:*
> {code:java}
> public class DateTimeTest extends AbstractBasicIntegrationTransactionalTest {
> @Test
>     public void testDefaultTemporalValues() throws Exception {
>         sql(client, "CREATE TABLE TBL(ID INTEGER, DT DATE DEFAULT 
> '2020-07-07', TT TIME DEFAULT '14:30:43', " +
>             "TS TIMESTAMP DEFAULT '2023-07-05 01:02:03.456')");
>         sql("INSERT INTO TBL(ID) VALUES(1)");
>         assertQuery("SELECT * FROM TBL")
>             .returns(1, sqlDate("2020-07-07"), sqlTime("14:30:43"), 
> sqlTimestamp("2023-07-05 01:02:03.456'"))
>             .check();
>     }
> }
> {code}
> *Result:*
> {code:java}
> java.lang.ClassCastException: class 
> org.apache.calcite.sql.SqlCharStringLiteral cannot be cast to class 
> org.apache.calcite.sql.SqlUnknownLiteral 
> (org.apache.calcite.sql.SqlCharStringLiteral and 
> org.apache.calcite.sql.SqlUnknownLiteral are in unnamed module of loader 
> 'app')
>       at 
> org.apache.ignite.internal.processors.query.calcite.util.TypeUtils.fromLiteral(TypeUtils.java:476)
>       at 
> org.apache.ignite.internal.processors.query.calcite.prepare.ddl.DdlSqlToCommandConverter.convertCreateTable(DdlSqlToCommandConverter.java:236)
>       at 
> org.apache.ignite.internal.processors.query.calcite.prepare.ddl.DdlSqlToCommandConverter.convert(DdlSqlToCommandConverter.java:158)
>       at 
> org.apache.ignite.internal.processors.query.calcite.prepare.PrepareServiceImpl.prepareDdl(PrepareServiceImpl.java:132)
> {code}
> Same for TIME and TIMESTAMP. 
> *Reason:*
> We cast SqlCharStringLiteral to SqlUnknownLiteral. Different types.



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

Reply via email to