You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Jason Huynh (JIRA)" <ji...@apache.org> on 2017/09/25 16:22:00 UTC

[jira] [Commented] (GEODE-3688) Query engine cannot compare int to long

    [ https://issues.apache.org/jira/browse/GEODE-3688?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16179255#comment-16179255 ] 

Jason Huynh commented on GEODE-3688:
------------------------------------

The query would work if you add the L to let the query engine know to covert it to a long.
"select c.name from /customer c where c.id=9L"



> Query engine cannot compare int to long
> ---------------------------------------
>
>                 Key: GEODE-3688
>                 URL: https://issues.apache.org/jira/browse/GEODE-3688
>             Project: Geode
>          Issue Type: Bug
>          Components: querying
>            Reporter: Swapnil Bawaskar
>
> I created an object with a long field:
> {noformat}
> public class Customer implements Serializable {
>   private long id;
>   private String name;
>   private String address;
>   private List<Account> accounts;
> ...
> }
> {noformat}
> and inserted 10 objects (with id 0 to 9) but the simple query to get customer with id=9 did not give any results
> {noformat}
> gfsh>query --query=" select c.name from /customer c where c.id=9"
> Result : true
> Limit  : 100
> Rows   : 0
> {noformat}
> I then changed the domain object to make id an {{int}} type after which the query worked:
> {noformat}
> gfsh>query --query=" select c.name from /customer c where c.id=9"
> Result : true
> Limit  : 100
> Rows   : 1
> Result
> ----------
> Customer_9
> {noformat}



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