Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
0.9.4
-
None
Description
This is the starting point in the codebase to add geometry type to RTree index.
Index creation:
QueryTranslator.java
- handleCreateIndexStatement()
- validateIndexKeyFields() : checks the key field type
- ValidateUtil.validateKeyFields()
case RTREE:
switch (fieldType.getTypeTag()) { case POINT: case LINE: case RECTANGLE: case CIRCLE: case POLYGON: case UNION: break; default: throw new AsterixException("The field \"" + fieldName + "\" which is of type " + fieldType.getTypeTag() + " cannot be indexed using the RTree index."); }break;
- doCreateIndex
- IndexUtil.buildSecondaryIndexCreationJobSpec()
- SecondaryIndexOperationsHelper.createIndexOperationsHelper()
- case RTREE:
indexOperationsHelper =
new SecondaryRTreeOperationsHelper(dataset, index, physOptConf, metadataProvider);
break;
- runJob(hcc, spec, jobFlags);
For picking an index, the RTree relevant class is RTreeAccessMethod.
Index pick during a query:
IntroduceSelectAccessMethodRule.java: select access transformation
IntroduceJoinAccessMethodRule.java: join access transformation
RTreeAccessMethod: specific to RTree
- FUNC_IDENTIFIERS has a list of supported functions.
- createIndexSearchPlan: creates an MBR for the search predicate - currently for "spatial_intersect" function only
- So, for each function that you want to support, you need to generate a suitable MBR that can generate a candidate set
of the actual answer.