Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-1881

CompactMapRangeIndex doesn't handle null map keys

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0.0-incubating
    • querying
    • None

    Description

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

      Steps to reproduce:
      1. Create an index on a map field eg

      create index --name="idx_positions" --expression="positions[*]" --region="region"
      

      2. Add entries with null keys in the the indexed map

      entry.positions  = new HashMap()
      entry.positions.put(null, "somevalue);
      region.put(entry);
      

      You will get an NPE

      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
      

      Attachments

        Activity

          People

            upthewaterspout Dan Smith
            upthewaterspout Dan Smith
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: