Skip to content

queryRectangle throws ValidationException for rangeKey predicate #43

@ranchodeluxe

Description

@ranchodeluxe

Hello,
We are doing a simple bbox request that results in this ValidationError below.

box_request = dynamodbgeo.QueryRectangleRequest(
dynamodbgeo.GeoPoint(lower_left["Latitude"], lower_left["Longitude"]),
dynamodbgeo.GeoPoint(upper_right["Latitude"], upper_right["Longitude"]), 
{
            "ProjectionExpression": "geoJson, hashKey, rangeKey",
})
response = gdm.queryRectangle(box_request)

We are trying to figure out why this error is only occurring for general geographic region. Our data has geohash keys and it works fine in other regions. I feel like queryRectangle might be changing the query condition while paginating? Wondering if anyone here has seen this type of behavior before?

{
  "errorMessage": "An error occurred (ValidationException) when calling the Query operation: The provided starting key does not match the range key predicate",
  "errorType": "ClientError",
  "stackTrace": [
    "  File \"/var/task/handler.py\", line 142, in handler\n    result_point = search_database_box(event_body)\n",
    "  File \"/var/task/handler.py\", line 102, in search_database_box\n    result_points = geo_load_box(datarequest['lower_left'],datarequest['upper_right'])\n",
    "  File \"/var/task/handler.py\", line 86, in geo_load_box\n    response = gdm.queryRectangle(box_request)\n",
    "  File \"/var/task/dynamodbgeo/GeoDataManager.py\", line 49, in queryRectangle\n    results = self.dispatchQueries(covering, QueryRectangleInput)\n",
    "  File \"/var/task/dynamodbgeo/GeoDataManager.py\", line 40, in dispatchQueries\n    geoQueryInput.QueryInput, hashKey, range))\n",
    "  File \"/var/task/dynamodbgeo/DynamoDBManager.py\", line 37, in queryGeohash\n    response = self.config.dynamoDBClient.query(**params)\n",
    "  File \"/var/task/botocore/client.py\", line 357, in _api_call\n    return self._make_api_call(operation_name, kwargs)\n",
    "  File \"/var/task/botocore/client.py\", line 676, in _make_api_call\n    raise error_class(parsed_response, operation_name)\n"
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions