-
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.
- is depended on by
-
SERVER-135983 Implement inference for ExpressionConstant and ExpressionFieldPath
-
- Needs Scheduling
-
-
SERVER-135985 Implement aggregation pipeline logical operators
-
- Needs Scheduling
-