Uploaded image for project: 'Apache AsterixDB'
  1. Apache AsterixDB
  2. ASTERIXDB-2389

Integrate new ESRI-based spatial support with R-Trees

    XMLWordPrintableJSON

Details

    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.
         
         

      Attachments

        Activity

          People

            aseldawy Ahmed Eldawy
            dtabass Michael J. Carey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 672h
                672h
                Remaining:
                Remaining Estimate - 672h
                672h
                Logged:
                Time Spent - Not Specified
                Not Specified