mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-25 11:49:53 -05:00
### Does this PR have any customer impact? ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) ### Are you introducing any new config? If yes, do you have tests with and without them being set? ### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md)) ### Description ---- #### AI description (iteration 1) #### PR Classification New feature: Added support for `$shift` operator in `$setWindowFields`. #### PR Summary This pull request introduces the `$shift` operator for window functions in BSON aggregation, along with additional rank-based window functions. - Added `HandleDollarShiftWindowOperator` and related functions in `bson_aggregation_window_operators.c` to handle the `$shift` operator. - Implemented `bson_rank`, `bson_dense_rank`, and `bson_shift` functions in `bson_aggregation_window_functions.c`. - Added integration tests for rank-based window functions in `custom_rank.js`. - Updated `bson_aggregation_pipeline_stage_setWindowFields.sql` with tests for `$rank` and `$denseRank` accumulators. - Added OID lookup functions for new BSON window functions in `metadata_cache.c`.