[SERVER-69433] Slot-Based Query Execution Engine not support Time Series Collection Created: 05/Sep/22  Updated: 27/Oct/23  Resolved: 22/Sep/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 6.0.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: 显卓 刘 Assignee: Edwin Zhou
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-54613 [SBE] Use classic engine to execute q... Closed
Operating System: ALL
Participants:

 Comments   
Comment by Edwin Zhou [ 22/Sep/22 ]

Hi xianzhuo.sky@gmail.com,

Thank you for your patience while I investigate this issue. Per SERVER-54613, we currently do not support SBE on time-series collections so $lookup using the classic engine is working as designed. I will now close this ticket.

Best,
Edwin

Comment by 显卓 刘 [ 08/Sep/22 ]

db.createCollection(
    "weather",
    {
       timeseries: {
          timeField: "timestamp",
          metaField: "metadata",
          granularity: "hours"
       }
    }
)
 
db.weather.insertMany( [
   {
      "metadata": { "sensorId": 5578, "type": "temperature" },
      "timestamp": ISODate("2021-05-18T00:00:00.000Z"),
      "temp": 12
   },
   {
      "metadata": { "sensorId": 5578, "type": "temperature" },
      "timestamp": ISODate("2021-05-18T04:00:00.000Z"),
      "temp": 11
   },
   {
      "metadata": { "sensorId": 5578, "type": "temperature" },
      "timestamp": ISODate("2021-05-18T08:00:00.000Z"),
      "temp": 11
   },
   {
      "metadata": { "sensorId": 5578, "type": "temperature" },
      "timestamp": ISODate("2021-05-18T12:00:00.000Z"),
      "temp": 12
   },
   {
      "metadata": { "sensorId": 5578, "type": "temperature" },
      "timestamp": ISODate("2021-05-18T16:00:00.000Z"),
      "temp": 16
   },
   {
      "metadata": { "sensorId": 5578, "type": "temperature" },
      "timestamp": ISODate("2021-05-18T20:00:00.000Z"),
      "temp": 15
   }, {
      "metadata": { "sensorId": 5578, "type": "temperature" },
      "timestamp": ISODate("2021-05-19T00:00:00.000Z"),
      "temp": 13
   },
   {
      "metadata": { "sensorId": 5578, "type": "temperature" },
      "timestamp": ISODate("2021-05-19T04:00:00.000Z"),
      "temp": 12
   },
   {
      "metadata": { "sensorId": 5578, "type": "temperature" },
      "timestamp": ISODate("2021-05-19T08:00:00.000Z"),
      "temp": 11
   },
   {
      "metadata": { "sensorId": 5578, "type": "temperature" },
      "timestamp": ISODate("2021-05-19T12:00:00.000Z"),
      "temp": 12
   },
   {
      "metadata": { "sensorId": 5578, "type": "temperature" },
      "timestamp": ISODate("2021-05-19T16:00:00.000Z"),
      "temp": 17
   },
   {
      "metadata": { "sensorId": 5578, "type": "temperature" },
      "timestamp": ISODate("2021-05-19T20:00:00.000Z"),
      "temp": 12
   }
] )
 
db.sensor_detail.insertOne({
    "sensor": { "sensorId": 5578, "type": "temperature" },
    "description":"This is a temperature sensor"
})

example:
1.

db.weather.aggregate( [
   {
      $group: {
         _id: "metadata.sensorId",
         avgTmp: { $avg: "$temp" }
      }
   }
] )

2.

db.weather.aggregate( [
   {
      $lookup: {
         from: "sensor_detail",
         localField: "metadata",
         foreignField: "sensor",
         as: "sensor_info"
      }
   }
] )

Comment by Edwin Zhou [ 07/Sep/22 ]

Hi xianzhuo.sky@gmail.com,

Thank you for your report! Can you provide more information of this use case including details such as:

  1. The aggregation pipeline you're using to fulfill this use case
  2. A set of example documents you are running the pipeline against

Best,
Edwin

Generated at Thu Feb 08 06:13:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.