Dan Smith created GEODE-1881:
--------------------------------

             Summary: CompactMapRangeIndex doesn't handle null map keys
                 Key: GEODE-1881
                 URL: https://issues.apache.org/jira/browse/GEODE-1881
             Project: Geode
          Issue Type: Bug
          Components: querying
            Reporter: Dan Smith


When indexing map fields that have null keys, geode throws an NPE.

Steps to reproduce:
1. Create an index on a map field eg
{code}
create index --name="idx_positions" --expression="positions[*]" 
--region="region"
{code}
2. Add entries with null keys in the the indexed map
{code}
entry.positions  = new HashMap()
entry.positions.put(null, "somevalue);
region.put(entry);
{code}

You will get an NPE
{noformat}
Caused by: java.lang.NullPointerException
        at 
java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936)
        at 
com.gemstone.gemfire.cache.query.internal.index.CompactMapRangeIndex.saveIndexAddition(CompactMapRangeIndex.java:184)
        at 
com.gemstone.gemfire.cache.query.internal.index.CompactMapRangeIndex.saveMapping(CompactMapRangeIndex.java:111)
        at 
com.gemstone.gemfire.cache.query.internal.index.AbstractIndex$IMQEvaluator.applyProjection(AbstractIndex.java:1354)
        at 
com.gemstone.gemfire.cache.query.internal.index.AbstractIndex$IMQEvaluator.doNestedIterations(AbstractIndex.java:1304)
        at 
com.gemstone.gemfire.cache.query.internal.index.AbstractIndex$IMQEvaluator.doNestedIterations(AbstractIndex.java:1315)
        at 
com.gemstone.gemfire.cache.query.internal.index.AbstractIndex$IMQEvaluator.evaluate(AbstractIndex.java:1132)
        ... 44 more
{noformat}



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

Reply via email to