mirror of https://github.com/apache/druid.git
20de7fd95a
This PR creates an interface for ImmutableRTree and moved the existing implementation to new class which represent 32 bit implementation (stores coordinate as floats). This PR makes the ImmutableRTree extendable to create higher precision implementation as well (64 bit). In all spatial bound filters, we accept float as input which might not be accurate in the case of high precision implementation of ImmutableRTree. This PR changed the bound filters to accepts the query bounds as double instead of float and it is backward compatible change as it compares double to existing float values in RTree. Previously it was comparing input float to RTree floats which can cause precision loss, now it is little better as it compares double to float which is still not 100% accurate. There are no changes in the way that we query spatial dimension today except input bound parsing. There is little improvement in string filter predicate which now parse double strings instead of float and compares double to double which is 100% accurate but string predicate is only called when we dont have spatial index. With allowing the interface to extend ImmutableRTree, we allow to create high precision (HP) implementation and defines new search strategies to perform HP search Iterable<ImmutableBitmap> search(ImmutableDoubleNode node, Bound bound); With possible HP implementations, Radius bound filter can not really focus on accuracy, it is calculating Euclidean distance in comparing. As EARTH 🌍 is round and not flat, Euclidean distances are not accurate in geo system. This PR adds new param called 'radiusUnit' which allows you to specify units like meters, km, miles etc. It uses https://en.wikipedia.org/wiki/Haversine_formula to check if given geo point falls inside circle or not. Added a test that generates set of points inside and outside in RadiusBoundTest. |
||
---|---|---|
.. | ||
aggregations.md | ||
arrays.md | ||
caching.md | ||
datasource.md | ||
datasourcemetadataquery.md | ||
dimensionspecs.md | ||
filters.md | ||
geo.md | ||
granularities.md | ||
groupbyquery.md | ||
having.md | ||
hll-old.md | ||
joins.md | ||
limitspec.md | ||
lookups.md | ||
math-expr.md | ||
multi-value-dimensions.md | ||
multitenancy.md | ||
nested-columns.md | ||
post-aggregations.md | ||
query-context.md | ||
query-execution.md | ||
query-from-deep-storage.md | ||
query-processing.md | ||
querying.md | ||
scan-query.md | ||
searchquery.md | ||
segmentmetadataquery.md | ||
select-query.md | ||
sorting-orders.md | ||
sql-aggregations.md | ||
sql-array-functions.md | ||
sql-data-types.md | ||
sql-functions.md | ||
sql-json-functions.md | ||
sql-metadata-tables.md | ||
sql-multivalue-string-functions.md | ||
sql-operators.md | ||
sql-query-context.md | ||
sql-scalar.md | ||
sql-translation.md | ||
sql-window-functions.md | ||
sql.md | ||
timeboundaryquery.md | ||
timeseriesquery.md | ||
tips-good-queries.md | ||
topnmetricspec.md | ||
topnquery.md | ||
troubleshooting.md | ||
using-caching.md | ||
virtual-columns.md |