### 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?
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
Error message:
HEAD is now at 8c80bd84d Fix configure with CMake < 3.x
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 has been removed from CMake.
Reference of this fix:
Reference: https://github.com/citusdata/citus/blob/main/STYLEGUIDE.md#using-citus_indent
----
#### AI description (iteration 1)
#### PR Classification
Bug fix
#### PR Summary
This pull request fixes a CMake version error when installing Uncrustify by switching from `git clone` to `curl` for downloading the source.
- `oss/scripts/install_citus_indent.sh`: Replaced `git clone` with `curl` to download Uncrustify and updated installation commands.
- `cgmanifest.json`: Updated Uncrustify component type and download URL.
- `oss/scripts/setup_versions.sh`: Added function to get Uncrustify version and defined `CRUSTIFY_VERSION`.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### 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?
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request introduces CRUD operations for Entra users in the DataPlane.
- `authentication.c`: Added functions to create users with external identity providers, validate identity provider info, and check if the current user is an Entra admin.
- `users.h`: Added new header file defining user CRUD functions and related structures.
- `users.c`: Updated user creation logic to handle external identity providers and added parsing for custom data.
- `api_hooks.c`: Added hooks for creating users with external identity providers and checking user privileges.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
- This is the second part of the plumbing for composite indexes.
- Add the planner and query integration to push $eq filters in the composite index
Still not done:
- Correctness of query
- inequality and other operators (`$in/$regex/etc`)
- Type bracketing
- Truncation
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request integrates a planner and adds basic plumbing for composite index operations.
- `bson_gin_composite_entrypoint.c`: Added functions for handling composite index paths, parsing bounds, and modifying scan keys.
- `bson_composite_index_tests_insert_terms.out`: Added tests to validate composite index functionality and queries.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### Does this PR have any customer impact? No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
Support advanced locales
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request introduces a collation add-on to enhance locale and collation type handling in the collation module.
- `collation.c`: Added support for parsing and handling collation types within locale strings, including replacing underscores with hyphens.
- `bson_dollar_ops_collation_tests_runtime.out`: Added new test cases to validate collation functionality with various locales and collation types.
- `bson_dollar_ops_collation_tests_runtime.sql`: Updated SQL test scripts to include new collation scenarios and validate query matching with different collation settings.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
yes
### Are you introducing any new config? If yes, do you have tests with and without them being set?
Yes
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
As part of testing out the composite operator classes, introduce a new composite operator class for Bson. This will be behind a test only GUC and will be for testing composite index pushdown.
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request introduces a new composite operator class for BSON GIN indexes in PostgreSQL.
- Added `bson_gin_composite_entrypoint.c` to implement GIN operator functions for BSON composite indexes.
- Created test cases in `bson_composite_index_tests_insert_terms.out` to validate term generation for composite paths.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### Does this PR have any customer impact?
Support users with setting up on arm64
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
DevOps
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
Support users with setting up DocumentDB on arm64
### Description
tested with Azure VM on ARM64
----
#### AI description (iteration 1)
#### PR Classification
Code update to support ARM64 architecture in Dockerfile.
#### PR Summary
This pull request updates the Dockerfile to support ARM64 architecture and upgrades the base image to Ubuntu 22.04. It also refactors installation scripts and environment variables.
- `Dockerfile`: Upgraded base image to Ubuntu 22.04, added support for ARM64, refactored installation scripts.
- `install_setup_intel_decimal_math_lib.sh`: Changed source retrieval method from tarball to git.
- `setup_versions.sh`: Updated version for Intel Decimal Math Library.
- `.devcontainer/Dockerfile`: Upgraded base image to Ubuntu 22.04, added support for ARM64.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### Does this PR have any customer impact?
Yes
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Bugfix
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
Fix list databases for databases > 2GB - make the size an int8 instead of int4
----
#### AI description (iteration 1)
#### PR Classification
Bug fix
#### PR Summary
This pull request addresses a bug where listing databases fails for databases larger than 2GB.
- `db_stats.c`: Changed the data type for `totalSize` from `int4` to `int8` to handle sizes greater than 2GB.
- `CHANGELOG.md`: Added an entry for the bug fix related to listing databases with size > 2GB.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### Does this PR have any customer impact? No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No
### Are you introducing any new config? If yes, do you have tests with and without them being set? No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
Support conversion to binData from string and vice versa.
$convert to BinData
```
"$convert": {
"input": <string>,
"to": {
"type": "binData",
"subtype": <bson_subtype_t>
},
"format": <"base64"/"string"/"hex"/"uuid"/"base64url">
}
```
OR
```
--- subtype will default to 0
"$convert": {
"input": <string>,
"to": "binData",
"format": <"base64"/"string"/"hex"/"uuid"/"base64url">
}
```
BinData $toString
```
{ $toString: <binData expression> }
```
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request introduces support for converting data to `BinData` using the `$convert` operator.
- `src/operators/bson_expression_type_operators.c`: Added new functions and modified existing ones to handle `BinData` conversion, including `ProcessDollarToBinData`, `GetToTypeAndSubTypeForBinDataConversion`, and `ValidateAndGetBinDataConversionSubTypeAndFormat`.
- Refactored `ParseDollarConvert` and `ApplyDollarConvert` to accommodate the new `BinData` conversion logic.
- Introduced a new struct `ConvertToTypeArguments` to manage conversion arguments.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### Does this PR have any customer impact?
Yes
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Bugfix(ish)
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
Yes
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
0.102-0 had changes that are non-idempotent. Given there were some incorrect dependencies taken on the 0.102 release (independently) introduce a 0.102-1 version that applies all the delta of 0.102-0 in an idempotent manner so that dependencies taken partially on 0.102 and dependencies taken on 0.102 fully work side-by-side.
----
#### AI description (iteration 1)
#### PR Classification
Hotfix for DocumentDB version upgrade.
#### PR Summary
This pull request introduces a hotfix for DocumentDB, ensuring an idempotent upgrade from version 0.102-0 to 0.102-1.
- Added `documentdb--0.102-0--0.102-1.sql` to handle partial upgrades and repeat UDF upgrades.
- Modified `data_table_utils.c` to check for both 0.102-0 and 0.102-1 versions during data table upgrades.
- Updated `pgmongo.control` to set the default version to 1.102-1.
- Added `pgmongo--1.102-1--1.103-0.sql` for version transition.
- Updated SHA1 checksums in multiple `pgmongo/sql/sha1` files to reflect changes.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
Yes
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
Fix up issues with rebalance grant support - make rebalance_start/stop/status work for the admin user.
----
#### AI description (iteration 1)
#### PR Classification
Bug fix
#### PR Summary
This pull request addresses issues with shard rebalance grant support by updating table ownership and schema usage permissions.
- `cluster_operations.c`: Added function to update the owner of the changes table to the cluster admin role and integrated it into the cluster setup process.
- `pgmongo--1.102-0--1.103-0.sql`: Granted usage on the `helio_api_distributed` schema to `pgmongo_role` and `helio_admin_role`.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### Does this PR have any customer impact?
Yes
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Perf
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
Yes
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
Improve the consistent function performance for $in in the index.
----
#### AI description (iteration 1)
#### PR Classification
Performance improvement
#### PR Summary
This pull request improves the performance of index pushed down large `$in` queries by introducing a fast path for certain conditions.
- `bson_gin_core.c`: Added a fast path for `$in` queries without truncation, nulls, or regex.
- `feature_flag_configs.c`: Introduced a new feature flag `EnableRumInOperatorFastPath`.
- Updated regression tests in `regex.sql` and `regex.out` to include scenarios for the new fast path feature.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
Yes
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
Enable support for running streaming cursors based on the primary key index. Do this optionally behind a feature flag.
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request enables support for primary key-based cursor scans in the system.
- Added new test cases in `bson_aggregation_cursor_tests_txn.sql` and `bson_aggregation_cursor_tests_txn.out` to validate primary key cursor scan functionality.
- Updated `custom_scan_continuation.c` to handle primary key cursor scans and build primary key index clauses.
- Modified `metadata_cache.c` to include functions for retrieving OIDs for integer and BSON B-tree operation families.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### 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?
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
Version update for 102 release
### 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?
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
Support for pushdown of to PFE indexes
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request adds support for pushdown operations to PFE indexes, enhancing query performance and index utilization.
- Added new functions in `sql/udfs/index_mgmt/bson_indexbounds_functions--0.102-0.sql` for BSON index bounds operations.
- Introduced new operators in `sql/operators/bson_btree_pfe_operators--0.102-0.sql` for BSON and BSON query comparisons.
- Updated `src/query/query_operator.c` to handle new index bounds operators and expressions.
- Added new type definitions in `sql/types/bsonindexbounds--0.102-0.sql` for BSON index bounds.
- Modified `src/metadata/metadata_cache.c` to include OIDs and functions for BSON index bounds types and operators.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### 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?
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
Altering creation_time column removing not null and default constraint.
----
#### AI description (iteration 1)
#### PR Classification
Performance improvement
#### PR Summary
This pull request alters the `creation_time` column in the database schema to improve performance.
- Added `AlterCreationTime` function in `cluster_operations.c` to modify the `creation_time` column.
- Updated `SetupCluster` function in `cluster_operations.c` to call `AlterCreationTime`.
- Created new SQL scripts `extension_upgrade_alter_creation_time_1.102-0.sql` and `extension_upgrade_alter_creation_time_1.102-0.out` for testing the changes.
- Modified multiple test output files to reflect the changes in the `creation_time` column constraints.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### 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?
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
[Infra] adding support for documentdb_distributed extension in start_oss_server
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request adds support for the `documentdb_distributed` extension in the `start_oss_server` script.
- `start_oss_server.sh`: Added a new option `-x` to start the server with the `documentdb_distributed` extension and updated the script to handle this new option.
- `utils.sh`: Added a new function `AddNodeToCluster` to add nodes to the cluster when the `documentdb_distributed` extension is used.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### Does this PR have any customer impact?
Yes
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
Support new syntax of $getField
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request adds support for the extended `$getField` operator for version 8.0.
- Added new test file `postgresjs/expression_get_field_80_custom.js` to validate `$getField` operator behavior.
- Updated `bson_expression_object_operators.c` to handle new error codes and validation for `$getField`.
- Modified `bson_aggregation_object_operators_tests.sql` and related expected output files to include new test cases for `$getField`.
- Added new error code mappings in `documentdb_errors.csv` and `error_mappings.csv`.
- Updated `documentdb_codes.txt` and `mongo_codes.csv` to include new error codes.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### Does this PR have any customer impact?
Yes, this PR improve the ability of $dateFromString.
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
N/A
### Are you introducing any new config? If yes, do you have tests with and without them being set?
N/A
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
N/A (need to confirm later)
### Description
1. Add support to infer date format automatically if the field `format` is not specified.
2. Add support for some wacky format.
3. Add support for more timezone format.
3. Fix some corner case when processing null/empty values both in `format` and `inputString`
3. Make JS test passed for date_from_string.js
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request introduces new functions to parse and validate date strings based on various formats.
- `oss/pg_documentdb/src/operators/bson_expression_date_operators.c`: Added `VerifyAndParseFormatStringToParts` and several helper functions to handle different date formats and validate date parts.
- Defined new constants for timezone mappings and preset date format parsers.
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
support $toUUID operator
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request introduces the `$toUUID` operator for MongoDB 8.0, enabling conversion of strings to UUIDs.
- Added `ProcessDollarToUUID` function in `bson_expression_type_operators.c` to handle the conversion logic.
- Updated `bson_expression_operators.h` to declare new parsing and handling functions for `$toUUID`.
- Included new test cases in `bson_aggregation_type_operators_tests.sql` and `bson_aggregation_type_operators_tests.out` to validate the `$toUUID` functionality.
- Modified `feature_counter.h` and `feature_counter.c` to include the new `$toUUID` feature in the feature count and mapping.
### 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?
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
----
#### AI description (iteration 1)
#### PR Classification
Code cleanup
#### PR Summary
This pull request cleans up the codebase by removing obsolete test files and updating configuration parameters for index build wait times.
- Deleted multiple obsolete test files across `pg_helio_api`, `pg_helio_core`, and `pg_helio_distributed` directories.
- Updated `TenantConfigurationBase.cs` to change index build wait time from seconds to milliseconds.
- Modified `pgmongo.c` to update index build wait time configuration from seconds to milliseconds.
- Adjusted `dynamic.rs` and `indexing.rs` to reflect the change in index build wait time units.
- Updated `PostgresMongoClient.cs` to use milliseconds for index build wait time.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Refactoring
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
Yes
### Are you introducing any new config? If yes, do you have tests with and without them being set?
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
1) Remove all Citus references from pg_documentdb tests
2) Remove some citus references from documentdb c files (Comments)
3) Remove dead code for bson_out aggregates
4) Remove all References to IsClusterVersionAtLeast less than 0.24 (since those are now deployed)
----
#### AI description (iteration 1)
#### PR Classification
Code cleanup
#### PR Summary
This pull request introduces code cleanups and enhancements related to aggregation functions in DocumentDB.
- `oss/pg_documentdb/sql/udfs/aggregation/group_aggregates--0.102-0.sql`: Added new aggregation functions for BSON data types, including BSONSUM, BSONAVERAGE, BSONMAX, BSONMIN, BSONFIRST, BSONLAST, BSONFIRSTN, BSONLASTN, BSON_ARRAY_AGG, BSON_OBJECT_AGG, BSON_ADD_TO_SET, BSON_MERGE_OBJECTS, BSONSTDDEVPOP, BSONSTDDEVSAMP, BSONPERCENTILE, and BSONMEDIAN.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### Does this PR have any customer impact? No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) Yes
### Are you introducing any new config? If yes, do you have tests with and without them being set? No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
Support collation with `find` queries.
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request adds support for the `project find` functionality with collation in the engine.
- Added new SQL functions in `sql/udfs/projection/bson_projection--0.102-0.sql` for handling BSON projection with collation.
- Updated `metadata_cache.c` to include OID caching for the new `bson_dollar_project_find` function with collation.
- Modified `bson_project.c` to handle additional arguments for collation in the `bson_dollar_project_find` function.
- Updated `bson_projection--latest.sql` to include the new function definition.
- Added function declaration in `metadata_cache.h` for the new `bson_dollar_project_find` function with collation.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
Related work items: #3924476
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Bugfix
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
1) Log Connection open events in the GW
2) Add current backend PID to notices from BE in GW
3) Add ErrDetail_log support for lock statements in GW
4) Don't continue Insert/Update/Delete on Query cancellation.
----
#### AI description (iteration 1)
#### PR Classification
Bug fix
#### PR Summary
This pull request addresses livesite issues by adding logging and fixing continuation on query cancellation.
- `error_utils.h`: Added `IsOperatorInterventionError` function to handle specific error codes.
- `update.c`, `delete.c`, `insert.c`: Integrated `IsOperatorInterventionError` to rethrow specific errors.
- `PostgresClientProvider.cs`: Added logging for physical connection opens.
- `PostgresClient.cs`: Enhanced logging to include process ID and hint details.
- `logger_hooks.c`: Modified logging behavior to promote detail logs to hints.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### 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?
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
Make range index optimizations only run for RUM indexes.
----
#### AI description (iteration 1)
#### PR Classification
Code optimization
#### PR Summary
This pull request optimizes range index operations to only run for RUM indexes.
- Changes in `src/opclass/index_support.c` to conditionally apply `OptimizeIndexExpressionsForRange` based on the index type being RUM.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### Does this PR have any customer impact? No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) Yes
### Are you introducing any new config? If yes, do you have tests with and without them being set? No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
Support collation for `replaceRoot` aggregation stage
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request adds support for the `$replaceRoot` operation with collation in the BSON aggregation pipeline.
- `bson_projection--0.102-0.sql` and `bson_projection--latest.sql`: Added new function `bson_dollar_replace_root` with collation support.
- `metadata_cache.c` and `metadata_cache.h`: Added OID cache and retrieval function for the new `bson_dollar_replace_root` with collation.
- `bson_project.c`: Updated `bson_dollar_replace_root` to handle collation.
- `bson_aggregation_pipeline.c`: Integrated collation handling in `HandleReplaceRoot`.
- Updated test files to include new test cases for `$replaceRoot` with collation.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### Does this PR have any customer impact?
Yes
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Bugfixes
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
1) Support blocking background index which will do a non-concurrent index create
2) Delete dead code in the gW for background blocking index
3) Show queued index builds in currentOp
4) Prioritize pruning old skippable indexes in the queue.
----
#### AI description (iteration 1)
#### PR Classification
Bug fix for background indexing.
#### PR Summary
This pull request addresses several issues related to background indexing, including handling skippable index requests and improving logging.
- `index.c`: Added function `GetSkippableRequestFromIndexQueue` to fetch skippable index requests.
- `create_indexes_background.c`: Implemented `PruneSkippableIndexes` to remove stale index requests and updated `command_build_index_concurrently` to prioritize pruning.
- `PostgresMongoClient.cs`: Removed temporary fix for blocking createIndexes requests.
- `current_op.c`: Enhanced `AddFailedIndexBuilds` to include queued index builds.
- Updated test files to reflect changes in index queue handling and logging.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Refactoring
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
Delete default on feature flags and old code
----
#### AI description (iteration 1)
#### PR Classification
Code cleanup
#### PR Summary
This pull request removes old and unused code, including default feature flags and unexercised code paths.
- `PostgresClient.cs`: Removed conditional logic and associated methods for handling feature flags and old code paths.
- `feature_flag_configs.c`: Deleted definitions and initializations of deprecated feature flags.
- `bson_aggregation_pipeline_tests_point_read.out` and `bson_aggregation_pipeline_tests_point_read.sql`: Removed test cases related to deprecated feature flags.
- `commands_common.c`: Removed conditional check for backend statement timeout feature flag.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
BugFix
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
PG 17 estimates the cost of Window clauses now based on the approximate number of rows and for that it needs valid frameoptions
----
#### AI description (iteration 1)
#### PR Classification
Bug fix for compatibility with PostgreSQL 17.
#### PR Summary
This pull request addresses a bug in the densify function for PostgreSQL 17.
- `oss/pg_documentdb/src/aggregation/bson_densify.c`: Added `FRAMEOPTION_DEFAULTS` to `winClause->frameOptions` to ensure proper window function handling.
- `oss/internal/pg_documentdb_distributed/src/test/regress/test_mutate_17`: Removed unnecessary test cases related to bson aggregation pipeline stages.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
- Support top level let variables in $geoNear stage
### Description
Support top level let variables in $geoNear stage
- Today there are 2 scenarios where `let` is used with $geoNear
1- `top level`: Any `let` provided in the top level command such as `aggregate`, the variables used in geonear spec should result into a `constant`, so we evaluate and rewrite the geoNear spec before parsing it to replace any expressions/let variables from top level let.
2- `nested let`: This scenario occurs with lookup pipeline and let is a combination of top level let and lookup let, this case is not optimized in this PR and will still return in error
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request adds support for top-level `let` expressions within the `$geoNear` stage in aggregation pipelines.
- `oss/pg_documentdb/src/aggregation/bson_aggregation_pipeline.c`: Added logic to handle `let` expressions by updating the `$geoNear` specification if a `CONST let` expression is present in the context.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### Does this PR have any customer impact?
Yes
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
1. enable `$jsonSchema` working in command query
2. support schema validation in `findAndModify`
3. enable 3 js tests to pass
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request enables the use of `$jsonSchema` in commands and includes schema validation.
- `query_operator.c`: Removed restriction on `$jsonSchema` usage and added schema validation logic.
- `feature_flag_configs.c`: Enabled schema validation and bypass document validation by default.
- `bson_json_schema_tree.c`: Added logging for parsing `$jsonSchema` keywords.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### Does this PR have any customer impact? No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) Yes
### Are you introducing any new config? If yes, do you have tests with and without them being set? No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
Support collation for `$addFields` and `$set` aggregation stages
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request adds support for the `addFields` operation with collation in the aggregation pipeline.
- `bson_project.c`: Added collation support to `bson_dollar_add_fields` and related functions.
- `bson_expression_comparison_operators.c`: Updated comparison operators to handle collation.
- `bson_dollar_operators.c`: Enhanced query state population to include collation.
- Test files `bson_dollar_ops_collation_tests_runtime.out` and `bson_dollar_ops_collation_tests_runtime.sql`: Added tests for collation with `$expr` and `$addFields`.
- `bson_projection--latest.sql`: Added new function definition for `bson_dollar_add_fields` with collation.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
Related work items: #3919349, #3919367
### 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?
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
Support collation with `$setEquals`, `$setUnion`, `$setIntersection`, `$setDifference`, `$setIsSubet` in the aggregation pipeline.
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request adds support for collation in set operators.
- `collation.c`: Added `HashStringWithCollation` function to hash strings with collation.
- `bson_expression_set_operators.c`: Introduced collation handling in set operator states and comparison functions.
- `bson_dollar_ops_collation_tests_runtime.sql`: Added tests for `$setEquals` with collation.
- `collation.h`: Declared `HashStringWithCollation` function.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### 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?
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
more
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request adds support for collation in BSON projection functions.
- Added new SQL functions in `sql/udfs/projection/bson_projection--0.102-0.sql` to handle collation.
- Updated `src/aggregation/bson_project.c` to include collation string handling in BSON projection.
- Modified `src/aggregation/bson_aggregation_pipeline.c` to support collation in projection stages.
- Enhanced `src/query/bson_dollar_operators.c` to populate collation string in query state.
- Added collation-related tests in `sql/bson_dollar_ops_collation_tests_runtime.sql`.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
Related work items: #3918941
### 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?
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
more
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request adds support for collation in the redact function.
- `bson_project.c`: Added handling for an additional collation string argument in the `bson_dollar_redact` function.
- `bson_aggregation_redact--0.24-0.sql` and `bson_aggregation_redact--latest.sql`: Updated to include the new collation string parameter in the `bson_dollar_redact` function definition.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
Related work items: #3919400
### Does this PR have any customer impact? No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No
### Are you introducing any new config? If yes, do you have tests with and without them being set? No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
Support the use `let` variables (and system variables) in the `query` for `bson_query_match`.
Variables can only be accessed in a `$expr` expression.
Example:
```
SELECT documentdb_api_internal.bson_query_match('{"a": "cat"}', '{"$expr": {"a": "$$varRef"} }', NULL, '{"varRef": "cat"}');
```
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request adds support for the `let` clause in query match operations.
- Added new test cases in `bson_aggregation_pipeline_tests_let.sql` to validate `let` clause functionality.
- Updated `bson_query_match` function in `query_operator.c` to handle `let` clause and collation settings.
- Modified `ReplaceBsonQueryOperatorsMutator` and `ExpandBsonQueryOperator` functions in `query_operator.c` to process variable specifications.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
Related work items: #3915179
### 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?
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
Add new GUC to support custom index handler op class to be able to switch the index handler on the fly.
set the GUC -> create index and the new index will use that handler.
The convention for the index handler is to follow the default index handler patter for operator classes and access methods:
```
documentdb_<gucvalue>
bson_<gucvalue>_single_path_ops
```
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request introduces a new GUC to support custom index handler op class and access method.
- `src/commands/create_indexes.c`: Added logic to support alternate index handlers and modified index expression generation to accommodate custom handlers.
- `src/pgmongo.c`: Added a new configuration variable `pgmongo.alternate_index_handler_name` to specify the custom index handler.
- Defined a new global variable `AlternateIndexHandler` to store the custom index handler name.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
### Does this PR have any customer impact? No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) No
### Are you introducing any new config? If yes, do you have tests with and without them being set? No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
Support collation for comparisons in evaluating `$in` expressions in an aggregation
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request adds collation support for array operators, specifically for `$in` and `$filter`.
- `bson_expression_array_operators.c`: Refactored `ProcessDollarIn` to handle collation and updated related functions.
- `bson_expression_comparison_operators.c`: Added collation handling in `ParseComparisonOperator`.
- Added new test cases in `bson_dollar_ops_collation_tests_runtime.sql` and corresponding expected output files to validate collation support for array operators.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
Related work items: #3919345
### Does this PR have any customer impact?
No.
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature.
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No.
### Are you introducing any new config? If yes, do you have tests with and without them being set?
No.
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
Enabling large unique index keys by default
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request enables large unique index keys by default in the configuration.
- `oss/pg_documentdb/src/configs/feature_flag_configs.c`: Changed the default value of `DEFAULT_ENABLE_LARGE_UNIQUE_INDEX_KEYS` from `false` to `true`.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
Related work items: #2143338
### 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
[schema validation] apply to stage $merge/$out
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request introduces schema validation for the `$merge` and `$out` stages in MongoDB aggregation pipelines.
- Added `schema_validation_merge.md` to document the design and implementation details.
- Created new SQL functions in `bson_merge_functions--1.24-0.sql` to handle schema validation during the `$merge` stage.
- Updated `bson_aggregation_output_pipeline.c` to integrate schema validation logic into the `$merge` and `$out` stages.
- Modified `toc.yml` to include the new schema validation documentation.
- Updated `pgmongo--1.23-0--1.24-0.sql` and `pg_helio_api--1.23-0--1.24-0.sql` to include the new SQL functions.