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

Calcite engine. Cast to INTERVAL data type is not working

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      Postfix cast of any expression to INTERVAL data type, for example:

      select null::interval day
      

      Fails with the exception: 

      class org.apache.ignite.internal.processors.query.IgniteSQLException: Failed to parse query.
      	at org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImpl.prepareQuery(ExecutionServiceImpl.java:527)
      	at org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.queryPlan(QueryPlanCacheImpl.java:84)
      	at org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImpl.executeQuery(ExecutionServiceImpl.java:390)
      	at org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.query(CalciteQueryProcessor.java:259)
      	at org.apache.ignite.internal.processors.query.calcite.integration.TableDmlIntegrationTest.executeSql(TableDmlIntegrationTest.java:284)
      	at org.apache.ignite.internal.processors.query.calcite.integration.TableDmlIntegrationTest.test(TableDmlIntegrationTest.java:95)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      	at org.apache.ignite.testframework.junits.GridAbstractTest$7.run(GridAbstractTest.java:2432)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: org.apache.calcite.sql.parser.SqlParseException: Encountered " "::" ":: "" at line 1, column 12.
      Was expecting:
          <EOF> 
      

       

       Whereas vanilla CAST(null as interval day) works well.

      Attachments

        Issue Links

          Activity

            People

              alex_pl Aleksey Plekhanov
              alex_pl Aleksey Plekhanov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: