You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Sergey Kalashnikov (JIRA)" <ji...@apache.org> on 2017/07/05 16:52:00 UTC

[jira] [Updated] (IGNITE-5483) SqlQuery fails with WHERE clause on LocalDateTime field

     [ https://issues.apache.org/jira/browse/IGNITE-5483?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Kalashnikov updated IGNITE-5483:
---------------------------------------
    Attachment: Java8Test_Ignite5483.zip

Attached the archive Java8Test_Ignite5483.zip with java8 test to verify the fix.

How to run the test:

1. Get Ignite Sources.

2. Apply the patch from pull request.

3. Install Ignite Locally using the following command:
mvn package install -DskipTests   

In the end, you should see the version like 2.1.0-SNAPSHOT.
If it something else, you will need to modify pom.xml inside test archive.

4. Unzip the attached archive Java8Test_Ignite5483.zip.

5. Start IntelliJ IDEA and choose "Import Project".

6. Locate pom.xml in the unzipped folder, Click OK.

7. Follow IDEA's instructions through the following dialogs, but be sure to select JDK 1.8 when prompted.

8. Build the project.

9. Locate the test SQLQueryOnLocalDateTimeTest and run it.

> SqlQuery fails with WHERE clause on LocalDateTime field
> -------------------------------------------------------
>
>                 Key: IGNITE-5483
>                 URL: https://issues.apache.org/jira/browse/IGNITE-5483
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 2.0
>         Environment: Ignite 2.0.0
> Oracle JDK 1.8.0_121
>            Reporter: Benjamin Garaude
>            Assignee: Sergey Kalashnikov
>             Fix For: 2.1
>
>         Attachments: Java8Test_Ignite5483.zip
>
>
> 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?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)