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

SqlQuery fails with WHERE clause on LocalDateTime field

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.1
    • sql
    • None
    • Ignite 2.0.0
      Oracle JDK 1.8.0_121

    Description

      When performing a SqlQuery with a WHERE clause containing an = predicate on a field of type LocalDateTime, the query fails with org.apache.ignite.IgniteCheckedException:Failed to execute SQL query.

      This bug occurred in 2.0, the same SqlQuery was working fine on 1.9.

      If we dig into the details,the original exception is a ClassCastException on IgniteH2Indexing:3663.

      When doing the same kind of query with a WHERE clause on a String type, it works.
      You can find a test case showing that here: https://github.com/bgaraude/IgniteTest

      I think this is related to IGNITE-4172, but this ticket says that the patch has to be updated once H2 has been updated.
      It seems that ignite 2.0 uses an updated version of H2: 1.4.195. This H2 version supports LocalDateTime. At least org.h2.value.DataType.getTypeFromClass returns TimeStamp for the LocalDateTime class. But IgniteH2Indexing$RowDescriptor.wrap() has not been updated accordingly. Hence, the ClassCastException.

      Do you know a workaround i can use while this issue is fixed?

      Attachments

        1. Java8Test_Ignite5483.zip
          3 kB
          Sergey Kalashnikov

        Issue Links

          Activity

            People

              skalashnikov Sergey Kalashnikov
              bgaraude Benjamin Garaude
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: