mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-25 11:49:53 -05:00
### Does this PR have any customer impact? Yes ### 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 Adding support for $rank and $denseRank setWindowFields operator ---- #### AI description (iteration 1) #### PR Classification New feature: Implementation of `$rank` and `$denseRank` functions in pgmongo. #### PR Summary This pull request introduces the `$rank` window function to the pgmongo implementation, enabling rank-based aggregation operations. - Added `BsonRankFunctionOid` and `HandleDollarRankWindowOperator` in `metadata_cache.c` and `bson_aggregation_window_operators.c` respectively. - Implemented `bson_rank` function and `RankContext` struct in `bson_aggregates.c`. - Updated SQL scripts `window_aggregate_support--1.20-0.sql` and `window_aggregate_support--latest.sql` to include the new `bson_rank` function. - Declared `BsonRankFunctionOid` in `metadata_cache.h`.