[SERVER-57629] change $integral&$derivative argument from 'outputUnit' to 'unit' Created: 10/Jun/21  Updated: 08/Jul/21  Resolved: 25/Jun/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.0.0-rc5

Type: Bug Priority: Major - P3
Reporter: David Percy Assignee: Jacob Evans
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Documented
is documented by DOCS-14604 Investigate changes in SERVER-57629: ... Closed
Gantt End to End
has to be finished together with SERVER-58093 update fuzzer for change to $integral... Closed
Backwards Compatibility: Minor Change
Operating System: ALL
Backport Requested:
v5.0
Sprint: Query Optimization 2021-07-26
Participants:

 Description   

In the $integral and the $derivative window functions, 'outputUnit' specifies how to express time deltas as a number. We originally called it 'outputUnit' to avoid a name collision with the 'unit' used for the window bounds.

This name is confusing though, because often the measurements implicitly have a unit involving time. For example, suppose you have numbers representing meters/second, and times represented as a datetime. The result will have units of meters, so writing outputUnit: 'second' is counterintuitive.

Now that the 'window' arguments are separate, we could go back to calling this argument just 'unit':

{$integral: {
   input: "$rate",
   unit: "second"
 },
 window: {
   range: [-1, 0],
   unit: "hour"
 }
}



 Comments   
Comment by Githook User [ 25/Jun/21 ]

Author:

{'name': 'Jacob Evans', 'email': 'jacob.evans@10gen.com'}

Message: SERVER-57629 Change $integral&$derivative args
Branch: v5.0
https://github.com/mongodb/mongo/commit/77ca833f40024000c351605ad7c96a0cc147fc20

Comment by Githook User [ 25/Jun/21 ]

Author:

{'name': 'Jacob Evans', 'email': 'jacob.evans@10gen.com'}

Message: SERVER-57629 Change $integral&$derivative args
Branch: master
https://github.com/mongodb/mongo/commit/803a3be9e6438d73aa4be6559c5795d2c3a99c99

Comment by Joe Kanaan [ 17/Jun/21 ]

Potentially need to update the fuzzer and a benchmark

Generated at Thu Feb 08 05:42:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.