geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Huynh (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GEODE-76) Running ordered queries on PDX Instances.
Date Fri, 10 Jul 2015 22:18:04 GMT

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

Jason Huynh commented on GEODE-76:
----------------------------------

I think this issue has been fixed with the latest merge from GEODE-8 to develop.  There have
been changes to the OrderByComparator that appears to have addressed this issue.  I ran the
following test and was unable to reproduce the issue after  GEODE-8 was merged in.  

Please let update with more information or a failing test if possible or if the test listed
in this ticket is incorrect.

public void testPdxOrderByQueryWithNumericalTypes() throws Exception {
    List<String> classes = new ArrayList<String>();
    classes.add(PortfolioPdx.class.getCanonicalName());
    ReflectionBasedAutoSerializer serializer = new ReflectionBasedAutoSerializer(classes.toArray(new
String[0]));

    CacheFactory cf = new CacheFactory();
    cf.setPdxSerializer(serializer);
    cf.setPdxReadSerialized(false);
    cache = cf.create();

    Region region = cache.createRegionFactory(RegionShortcut.PARTITION).create("SimpleObjects");
    QueryService qs = cache.getQueryService();
    for (int i = 0; i < 10; i++) {
        String obj1 = "{\"FirstName\": \"MyName\", \"LastName\": \"MyLastName\", \"ShortNumber\":"
+ (i * 65536)  + "}";
        region.put(i, JSONFormatter.fromJSON(obj1));
    }

    SelectResults rs = (SelectResults)qs.newQuery("select * from /SimpleObjects ORDER BY ShortNumber").execute();
    assertEquals(10, rs.size());
  }


> Running ordered queries on PDX Instances.
> -----------------------------------------
>
>                 Key: GEODE-76
>                 URL: https://issues.apache.org/jira/browse/GEODE-76
>             Project: Geode
>          Issue Type: Bug
>          Components: querying, serialization
>            Reporter: Altan Gokcek
>            Assignee: Jason Huynh
>            Priority: Critical
>
> When we create PDX instances by sending json to gemfire, if a filed is number type gemfire
decides in which datatype it will save it to region (<128 byte, >128 short, >65536
Integer etc...) this is totally normal. 
> Problem is in order to run a ordered query. For example,
> "select * from /myRegion ORDERY BY myNumberField"
> We get such errors "byte and short cannot be compared or short and Integer cannot be
compared"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message