Generation of $expr doesn't use type information

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • Fully Compatible
    • QE 2024-02-19
    • 35
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      We currently support dateDiff() only because the time field has a declared type that allows the removal of the extra checks on the input type.
      Writing the query

      [{$match:  {
                      "$expr": {
                          "$gt": [
                              {
                                  "$dateDiff": {
                                      "startDate": "$time",
                                      "endDate": new Date(datePrefix + 150),
                                      "unit": "millisecond"
                                  }
                              },
                              0
                          ]
                      }
                  }
      }]
      

      generates a plan using the non-optimized tree that includes a few calls to typeMatch() that, being not yet supported, don't allow the vectorized execution of dateDiff().

      Probably this is caused by not forwarding the type information into the conversion from ABT to EExpr

              Assignee:
              Projjal Chanda
              Reporter:
              Alberto Massari
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: