Hey everyone :wave: I'm trying to add a geospatial...
# troubleshooting
f
Hey everyone 👋 I'm trying to add a geospatial index to one of the columns. When I try to create the table with this index, the logs for Pinot server show a null pointer exception. They are attached as a snippet with this message. How'd I go about resolving this?
r
have you defined the
resolutions
field correctly ?
f
@Rajat Venkatesh I'm sure I did. I was following the example given in the documentation and simply changed the field name to match the one I have in my table. Here's how I've defined it in my table configuration with the newer syntax.
Copy code
{
  "name": "location",
  "encodingType": "RAW",
  "indexes": {
    "h3": {
      "resolutions": [
        13,
        5,
        6
      ]
    }
  }
}
r
The config looks fine. I asked because the error points to a line which is getting the resolutions field.
f
@Rajat Venkatesh How'd I go about debugging this?
r
I re-read the code. Can you recheck the table config ? The code is not finding the resolutions field in the index config.
f
@Rajat Venkatesh What would you like me to check? I've tried both the old and new way of adding the index and gotten the same exception. Here's the snippet from my table configuration.
Copy code
"fieldConfigList": [
    {
      "name": "location",
      "encodingType": "RAW",
      "indexes": {
        "h3": {
          "resolutions": [
            13,
            5,
            6
          ]
        }
      }
    }
  ]
r
I created a quickstart and played around with the example in docs. I could not reproduce the same error. Ref: https://github.com/apache/pinot/pull/14816
can you give instructions to reproduce ?
also can you upgrade to a new version ? I think 1.3.0 has been released. If not, can you check with 1.2.0 ?
the two possibilities I am considering are there is an issue in setup AND there is a bug in an older version
f
@Rajat Venkatesh I'm on 1.1.0. Let me upgrade to 1.2.0 and report back.
@Rajat Venkatesh I'm on version 1.2.0 and I still face the same issue. I'm attaching my table and schema config in the following messages.
Here's my schema. The
lat
and
lng
columns are converted into a
location
column.
Here's my table. It extracts value from Debezium payloads so you may have to tweak it a little bit. Simply POST-ing the schema raises an error in the logs.
FYI, I'm using the 1.2.0 Docker image.
r
few differences. My first priority is that the following is missing from your table config. You need to specify that
location
should not have dictionary column
Copy code
"noDictionaryColumns": [
      "location_st_point"
    ]
f
Okay, let me try adding that.
Still persists.
I have the following
Copy code
"tableIndexConfig": {
    "noDictionaryColumns": ["location"],
    "loadMode": "MMAP"
  }
The error is a bit more descriptive now.
Copy code
Caused by: java.lang.NullPointerException: Cannot invoke "org.apache.pinot.segment.spi.index.reader.H3IndexResolution.getLowestResolution()" because "resolution" is null
r
Can you try this instead in index property ?
Copy code
"resolutions": "13,5,6"
instead of a json array
this is the code I see. So it is looking for a comma-separated string of integers.
Copy code
for (String resolution : StringUtils.split(properties.get(RESOLUTIONS_KEY), ',')) {
        resolutions.add(Integer.parseInt(resolution));
      }
f
@Rajat Venkatesh Let me try this. As an aside, the
String resolution
needs a call to
trim()
to avoid subtle bugs when there are spaces in the string.
r
ok. can you please file an issue ?
f
Sure thing. I'd be happy to raise this as my first PR, too.
@Rajat Venkatesh The following worked. It's the old way of specifying the index with no spaces between numbers in the resolution string.
Copy code
"fieldConfigList": [
    {
      "name": "location",
      "encodingType": "RAW",
      "indexTypes": ["H3"],
      "properties": {
        "resolutions": "13,5,6"
      }
    }
  ]
r
can you file an issue ? maybe the community might know why the documented configs are not working
f
Will do.