druid-io / pydruid

A Python connector for Druid
Other
506 stars 194 forks source link

adding support for Spatial filters #213

Closed lokkju closed 4 years ago

lokkju commented 4 years ago

This pull adds support for geographic queries using spatial filters.

Spatial filter can be used to filter by spatial bounds

    :ivar str dimension: Dimension to filter on.
    :ivar str bound_type: Spatial bound type: ['rectangle','radius','polygon'].
    :param `**kwargs`: addition arguments required for the selected bound type:
        'rectange': 'minCoords' and 'maxCoords'
        'radius': 'coords' and 'radius'
        'polygon': 'abscissa' and 'ordinate'
    """
filters.Spatial(dimension='dim', bound_type='rectangle',
                minCoords=[100.0,100.0], maxCoords=[100.1,100.1],
                radius=10.0))

see: https://druid.apache.org/docs//0.15.1-incubating/development/geo.html