Unexpected SQL error when running sql with conditions

classic Classic list List threaded Threaded
4 messages Options
jan.swaelens jan.swaelens
Reply | Threaded
Open this post in threaded view
|

Unexpected SQL error when running sql with conditions

Hello,

As a next step in my tests I am trying to run a sql query via the JDBC driver against my loaded 'activity' cache.

A first test works fine:
rs = conn.createStatement().executeQuery("select * from activity");

Adding a condition to that results in a weird error, for example:
rs = conn.createStatement().executeQuery("select * from activity WHERE activityId > 1");

generates an error 'org.h2.jdbc.JdbcSQLException: Hexadecimal string with odd number of characters: "1"'

Changing the condition to something else, for example:
rs = conn.createStatement().executeQuery("select * from activity WHERE activityId > 100000");

generates another error 'org.h2.jdbc.JdbcSQLException: Deserialization failed, cause: "class org.apache.ignite.binary.BinaryObjectException: Not enough data to read the value [position=1, requiredBytes=4, remainingBytes=2]"'

See attached log(s)
sqllog.txt
sqllog2.txt

To me the sql looks fine, not sure what's the problem here. This is running against the 1.6.0 nightly as obtained this morning.

Information on the pojo's, database tables etc. can be found here:
http://apache-ignite-users.70518.x6.nabble.com/Ignite-Schema-Import-Utility-Mismatch-when-loading-data-between-Date-and-Timestamp-tp3790p3806.html

thanks
jan
Artem Shutak Artem Shutak
Reply | Threaded
Open this post in threaded view
|

Re: Unexpected SQL error when running sql with conditions

Hello!

I've reproduced your issue.

As I see, Ignite has a bug at Ignite Schema Import utility. I've filed one: https://issues.apache.org/jira/browse/IGNITE-2958.

As a workaround you need just fix **queryEntityActivity** method and use there full names of classes, like String.class.getName() and Long.class.getName().

Also, you should change primitive types with wrappers like "long" on Long.class.getName().

Thanks,
Artem.
jan.swaelens jan.swaelens
Reply | Threaded
Open this post in threaded view
|

Re: Unexpected SQL error when running sql with conditions

Thanks,

I will try as you suggest to see what it does! I assume the changes will be hitting a nightly build somewhere next week as well so depending on my availability I might just regenerate using the new code instead.

br
jan
jan.swaelens jan.swaelens
Reply | Threaded
Open this post in threaded view
|

Re: Unexpected SQL error when running sql with conditions

This works great now on latest nightly, thanks!