• 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

      Signature:

      Type type_system::getOutputType(Type input, const Expression* expr);
      Type type_system::narrowType(Type input, const Expression* expr, bool assumeTrue);
      

      This should dispatch via a visitor similar to matcher::narrowType.

      So that we can call getOutputType(ExpressionConstant, ...) or getOutputType(ExpressionFieldPath, ...) and get the output type of the expression.
      And narrowType on ExpressionCompare etc.

      Make $expr call narrowType when the output of the expression is boolean, to wire things together. We  should check the expression is boolean to match cases $expr: {$eq: [...]} but not $expr: {$add: [...]}} which is valid, but requires the type system to model the thruthy check (which we will not do).

      Separate tickets will provide implementations.

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

              Created:
              Updated: