• Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Add API with the following signature:

      Type DependencyGraph::getPathType(DocumentSource* ds, PathRef path, *); 

      Returns a Type value which describes the type of the path at the input of the DocumentSource.

      MatchExpression and Expressions use different methods to traverse paths. Some code also calls getNestedField. We should return a Type that cannot be misused to misinterpret what the result of any of these will be.

      As part of this work we should determine if we need the API to differentiate between the possible traversal strategies, or whether a lowest common denominator approach will suffice. Since differentiating at the API will make it more complicated to use, it is preferable to have a generic implementation.

      The type that is returned should be the broadest of any possible execution-time evaluation:

       - Via Matcher and ElementPath logic

       - Via ExpressionFieldPath logic

       - Via document.getNestedField logic

      Note that the matcher matches numeric components as indexes or field names. Whereas ExpressionFieldPath and getNestedFields treat components exclusively as field names. The matcher can match empty fields at the root, ExpressionFieldPath cannot.

      Therefore, we need to evaluate ElementPath, ExpressionFieldPath and getNestedField on a corpus and verify that whatever type we infer is a superset.

      The graph method and the ExpressionContext accessor for the schema should use the same logic, so please extend getPathType if needed.

       

            Assignee:
            Unassigned
            Reporter:
            Vesko Karaganev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: