Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-18817

Sql. Calcite 1.33.0+. TIMESTAMPDIFF requires modification.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • None
    • None
    • sql

    Description

      After updating to calcite 1.33.0 TIMESTAMPDIFF requires some updates as well otherwise we get an error.

      Query:

      SELECT TIMESTAMPDIFF(SECOND, TIMESTAMP '2022-02-01 10:30:28.123', TIMESTAMP '2022-02-01 10:32:26')
      

      Error:

      Caused by: org.apache.ignite.lang.IgniteException: IGN-CMN-65535 TraceId:1d8b4f81-efdf-4208-bff1-e90c607b3981 class org.apache.calcite.sql.SqlIntervalQualifier cannot be cast to class org.apache.calcite.sql.SqlLiteral (org.apache.calcite.sql.SqlIntervalQualifier and org.apache.calcite.sql.SqlLiteral are in unnamed module of loader 'app')
      	at app//org.apache.ignite.lang.IgniteException.wrap(IgniteException.java:289)
      	at app//org.apache.ignite.sql.Session.execute(Session.java:60)
      	at app//org.apache.ignite.internal.sqllogic.ScriptContext.executeQuery(ScriptContext.java:89)
      	at app//org.apache.ignite.internal.sqllogic.Query.execute(Query.java:263)
      	at app//org.apache.ignite.internal.sqllogic.SqlScriptRunner.run(SqlScriptRunner.java:70)
      	... 6 more
      Caused by: java.lang.ClassCastException: class org.apache.calcite.sql.SqlIntervalQualifier cannot be cast to class org.apache.calcite.sql.SqlLiteral (org.apache.calcite.sql.SqlIntervalQualifier and org.apache.calcite.sql.SqlLiteral are in unnamed module of loader 'app')
      	at org.apache.ignite.internal.sql.engine.prepare.IgniteConvertletTable$TimestampDiffConvertlet.convertCall(IgniteConvertletTable.java:69)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            mzhuravkov Maksim Zhuravkov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: