Investigate using FieldRef instead of FieldPath

XMLWordPrintableJSON

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

      FieldRef is a more relaxed version of FieldPath, i.e. some paths that are valid FieldRefs are invalid FieldPaths. As a result, it we try to convert a FieldRef to FieldPath when doing PathArrayness lookup, we might assert due to FieldPath validations failing. We should consider using FieldRef instead of FieldPath. We should also double check whether FieldRef asserts in any case and if it does, catch it and just return the conservative guarantee (i.e. isPathArray = true for invalid FieldRefs).

      We should:
      1. Audit the uses of FieldRef and FieldPath in the find, agg and SBE
      2. Determine the set of fields that are valid as FieldRef but not FieldPath

       

      Investigation and conclusions are summarized in this document.

      Ultimately, FieldPath appears to be the right choice as it is used in the most places throughout the agg, sbe, and find execution paths and thus will not require reparsing fieldpaths as often as FieldRef would.

            Assignee:
            Natalie Hill
            Reporter:
            Naafiyan Ahmed
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: