Commit Graph
133 Commits
Author SHA1 Message Date
Jinrui Zhang ffe78264e1 Merged PR 1412059: implementation of $LinearFill and $locf for $setWindowFields
This PR is used for implementation of `$linearFill` and `$locf` for `$setWindowFields`. It includes:

1) The design doc for $linearFill and $locf
2) The implementation of $linearFill and $locf for verification purpose.

The detailed design and implementation could be refered in the design docs:

[$linearFill](https://msdata.visualstudio.com/CosmosDB/_git/pgmongo/pullrequest/1412059?_a=files&path=/docs/pgmongo/design_docs/data_plane/aggregation_operators/linearfill.md),

[$locf](https://msdata.visualstudio.com/CosmosDB/_git/pgmongo/pullrequest/1412059?_a=files&path=/docs/pgmongo/design_docs/data_plane/aggregation_operators/locf.md)
2024-09-05 18:18:23 +03:00
Jia Hu 👻 b36e62a18b Merged PR 1429339: [schema validation] support schema validation in insertion
### 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
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description
[schema validation] support validation in insertion
Details about evaluation part is here:https://msdata.visualstudio.com/DefaultCollection/CosmosDB/_git/pgmongo/pullRequest/1429339#1724674832

----
#### AI description  (iteration 1)
#### PR Classification
New feature: Adds support for schema validation during document insertion.

#### PR Summary
This pull request introduces schema validation for document insertions, ensuring that documents adhere to specified schemas before being inserted into collections.
- `schema_validation.c`: Implements functions for preparing and validating documents against schema validators.
- `insert.c`: Integrates schema validation into the document insertion process.
- `bson_expr_eval.c`: Adds functions to evaluate expressions against documents for validation purposes.
- `schema_validation_insert.sql` and `schema_validation_insert.out`: Adds regression tests for schema validation during insertions.
- `SchemaValidationMetadataTests.cs`: Adds integration tests for schema validation during document insertion.
2024-09-05 18:18:23 +03:00
Murat Tuncer f93c2e0553 Merged PR 1448781: Fix typo in header guard macro definition
### 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
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description
Fix typo in header guard macro definition that causes build warnings and multiple inclusions of the header file.

WKBBUfferITERATOR_H was replaced by WKBBufferITERATOR_H

----
#### AI description  (iteration 1)
#### PR Classification
Bug fix

#### PR Summary
This pull request fixes a typo in the header guard macro definition.
- `include/geospatial/bson_geospatial_wkb_iterator.h`: Corrected the macro definition from `WKBBUfferITERATOR_H` to `WKBBufferITERATOR_H`.
2024-09-05 18:18:23 +03:00
Duan Pei✨ aceb3a89e8 Merged PR 1418208: [Feature] $expMovingAvg implementation
### 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 implementation.

#### PR Summary
This pull request introduces the `$expMovingAvg` aggregation operator to calculate the exponential moving average of numeric values.
- Added new aggregate functions in `oss/pg_helio_api/sql/udfs/aggregation/group_aggregates--1.19-0.sql` for BSON data types.
- Implemented supporting functions in `oss/pg_helio_api/sql/udfs/aggregation/group_aggregates_support--1.19-0.sql`.
- Documented the `$expMovingAvg` operator in `docs/pgmongo/design_docs/data_plane/aggregation_operators/expMovingAvg.md`.
2024-09-05 18:18:23 +03:00
Deepak Pemmaraju 544343380d Merged PR 1446395: Adding feature counters
### 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

Adding feature counters

----
#### AI description  (iteration 1)
#### PR Classification
New feature

#### PR Summary
This pull request adds feature usage counters for user-related operations.
- `feature_counter.c`: Added new feature mappings for user CRUD operations.
- `feature_counter.h`: Defined new feature types for user CRUD operations and updated the maximum feature count.
- `users.c`: Integrated feature usage reporting for user create, drop, update, and get operations.
2024-09-05 18:18:23 +03:00
Cornelius Boateng 75c3b4de3b Merged PR 1445538: [Perf] Set Aggregation Ops
### 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
Performance improvement for aggregation operations.

#### PR Summary
This pull request optimizes the handling of set aggregation operations by refactoring and adding new parsing and evaluation functions.
- `src/operators/bson_expression_set_operators.c`: Added and refactored functions for parsing and evaluating `$setEquals`, `$setDifference`, `$setIsSubset`, `$anyElementTrue`, `$allElementsTrue`, `$setUnion`, and `$setIntersection` expressions.
- Introduced helper functions for parsing and evaluating set operators with variable and dual operands.

Related work items: #3444465
2024-09-05 18:18:23 +03:00
Cornelius Boateng 125a25dc27 Merged PR 1435273: [Perf] Conditional Aggregation Ops
### 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
Migrate conditional operators (`$ifNull`, `$cond`, `$switch`) to new aggregation framework and ensure correct behavior.

----
#### AI description  (iteration 1)
#### PR Classification
Performance improvement for conditional aggregation operations.

#### PR Summary
This pull request refactors and optimizes the handling of arithmetic and boolean aggregation operators to improve performance.
- `bson_expression_arithmetic_operators.c`: Refactored functions to handle pre-parsed arithmetic operations, added helper functions for single, dual, and variable operand parsing and evaluation.
- `bson_expression_boolean_operators.c`: Refactored functions to handle pre-parsed boolean operations, added helper functions for variable operand parsing and evaluation, and a unified boolean operator processing function.

Related work items: #3430332
2024-09-05 18:18:23 +03:00
Ayush Saluja ad06937fdd Merged PR 1429409: $rank and $denseRank pgmongo implementation
### 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`.
2024-09-05 18:18:23 +03:00
Vinod Sridharan 2d8ec7f2db Merged PR 1441131: [Helio compat] Making more compat tests pass
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Test
### 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

Making more compat tests pass
2024-08-28 16:38:56 +03:00
Lusen Dong 0104f7cd3c Merged PR 1399748: [Feature] $sampleRate query operator
### 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
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
Add aggregation operator: $sampleRate
### Description

Implementation for $sampleRate operator
2024-08-28 16:38:56 +03:00
Xing Fan ⛳ ce4a709922 Merged PR 1412546: Window operators: $covariancePop & $covarianceSamp
### 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)
UDF

### 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
Implemented covariancePop & covarianceSamp for setWindowFields

----
#### AI description  (iteration 1)
#### PR Classification
Documentation

#### PR Summary
This pull request adds design documentation for the `$covariancePop` and `$covarianceSamp` aggregation operators.
- Added `covariancePop.md` detailing the specification, behavior, examples, implementation plan, and test plan for the `$covariancePop` operator.
- Added `covarianceSamp.md` detailing the specification, behavior, examples, implementation plan, and test plan for the `$covarianceSamp` operator.
2024-08-26 13:12:13 +03:00
Jayanta Mondal d3c5128254 Merged PR 1405332: Mongo collation support Part 1 ( Find/Aggregate queries with runtime collation)
### 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?
Yes (helio_api.enableCollation). Yes.

### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
Done

### Description

Runtime implementation of collation support in Mongo Find query.

We parse the Mongo collation spec and covert it to an ICU standard collation string. An example string is "und-u-ks-level1-kc-true  This string uniquely identify collation-based string comparison logic by Postgres.  See: https://www.postgresql.org/docs/current/collation.html

This document tracks the current support matrix for query operators

| Operator  | Runtime | Index Pushdown | Comments
| --------- | ---- | ----- | ----
|  $eq | Yes | No |
|  $gt | Yes |  No |
|  $gte | Yes | No |
|  $lt | Yes |  No |
|  $lte | Yes |  No |
|  $ne | Yes |  No |
|  $in | No* |  No | See below
|  $nin | No* |  No | Do
|  $and | Yes |  No |
|  $not | Yes |  No |
|  $nor | Yes |  No |
|  $or | Yes |  No |
|  $all | Yes |  No |
|  $elemMatch |  Yes   |  No |
|  $positional | N/A | N/A | positional query operators are only used in projections.
|  $regex | N/A |  N/A   | $regex ignores collations in Native Mongo
|  $exists | N/A  |   N/A   |
|  $size | N/A  |  N/A |
|  $type | N/A |   N/A |
|  $bitsAllClear | N/A  |  N/A  | Not relevant for Utf8
|  $bitsAnyClear | N/A  |  N/A  | Do
|  $bitsAllSet | N/A  |  N/A  | Do
|  $bitsAnySet |  N/A |  N/A  | Do
|  $mod | N/A  |  N/A  | Do
|  $range | N/A  |  N/A | Only applies to Number
|  $text | N/A  |  N/A  | Seprate Index, has its own collation spec
|  $geowithin | N/A   |  N/A  | Not relevant for Utf8
|  $geointersects | N/A    | N/A   | Do

* $in/$nin is implemented with HashMap that does not support collation friendly Hashkeys
* $regex : collations are ignored with
* $text: $text spec has collation specific parameters
* $rage: For numbers only

This document tracks the current support matrix for update operators/commands

| Operator  | Runtime | Index Pushdown |
| --------- | ---- | ----- |
|  find_and_modify | No | No |
|  updateOne | No |  No |
|  updateMany | No | No |
|  createIndex | No | No |

Tests:
1. All Gated Tests pass when Collation is enabled by default

TODO:
1. Index support [already implemented - but breaking down for easy review]
2. Persist collation info while collection created [already implemented - but breaking down for easy review]
3. $cond, $let

Related work items: #3412359
2024-08-26 13:12:13 +03:00
Vinod Sridharan f51b8b04ec Merged PR 1433853: [OSS] Prep for porting backend distributed tests
### Does this PR have any customer impact?
No

### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Refactor

### 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
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description
Prep for porting backend distributed tests

----
#### AI description  (iteration 1)
#### PR Classification
Code cleanup and preparation for porting backend distributed tests.

#### PR Summary
This pull request removes obsolete code and prepares the codebase for porting backend distributed tests.
- Deleted `cluster_operations.c` and `version_utils.c` from `pgmongo/src`.
- Added new functions and triggers in `helio_distributed_test_helpers.sql` and `helio_distributed_test_helpers.out` for testing.
- Updated `cluster_operations.c` in `pg_helio_distributed` to include new cluster management functions.
- Added new SQL files for cluster operations and version utilities in `pg_helio_distributed`.
- Modified `pgmongo.c` to set up global variables for distributed functions and index build queue table creation.
2024-08-26 13:12:13 +03:00
Cornelius Boateng acc265876e Merged PR 1420437: [Perf] Arithmetic & Boolean Aggregation Ops
### 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

Implement the arithmetic and boolean operators after the new aggregation framework pattern.
2024-08-26 13:12:13 +03:00
Santiago Fernandez Madero 91f0c7703b Merged PR 1427468: [let] Enable let by default on top level find, aggregate and lookup
### 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

[let] Enable let by default on top level find, aggregate and lookup

This adds the missing validation and parsing of let spec to be able to enable it by default, and also changes the let GUCs to be true by default.

----
#### AI description  (iteration 1)
#### PR Classification
New feature: Enable `let` by default on top-level `find`, `aggregate`, and `lookup` commands.

#### PR Summary
This pull request enables `let` by default for top-level `find`, `aggregate`, and `lookup` commands, and adds validation to disallow certain expressions in top-level `let` specifications.
- `bson_aggregation_pipeline.c`: Added functions to parse and validate top-level `let` expressions, disallowing path expressions, `CURRENT`, and `ROOT`.
- `bson_aggregation_nested_pipeline.c`: Updated validation for `let` expressions in nested pipelines to ensure no variables are used to define other variables.
- `bson_aggregation_pipeline_tests_let.out` and `bson_aggregation_pipeline_tests_let.sql`: Added tests for new `let` functionality and validation rules.
- `helio_api_init.c`: Enabled `let` and `lookup let` support by default.

Related work items: #1806751
2024-08-26 13:12:13 +03:00
Aditya Kotalwar 0135e97ee5 Merged PR 1388730: Enable billing for multiple accounts for 'SOP 009: Enable or Disable billing for an account or subscription'
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
TSG
### 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

This change introduces a section in the SOP that includes a script enabling simultaneous updates across multiple accounts under the same subscription.
2024-08-16 18:24:51 +03:00
Vinod Sridharan df3166b074 Merged PR 1428192: Write directly to shard if available
### 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

Write directly to shard if available

----
#### AI description  (iteration 1)
#### PR Classification
Code cleanup and optimization.

#### PR Summary
This pull request refactors the shard handling logic to directly write to a shard if available, removing redundant code and simplifying the shard query process.
- `src/api_hook_impl.c`: Simplified shard query logic by removing the `GetShardIdOptimistically` function and optimizing the shard ID retrieval process.
- `src/metadata/collection.c`: Removed the `allowLocalShard` parameter and related logic, streamlining the collection retrieval process.
- `src/aggregation/bson_aggregation_output_pipeline.c` and `src/aggregation/bson_aggregation_pipeline.c`: Updated functions to use the simplified collection retrieval method.
- `include/metadata/collection.h`: Removed the declaration for `GetMongoCollectionOrViewByNameDatumWithLocalShard`.
- `src/helio_api_init.c`: Changed the default value of `UseLocalExecutionShardQueries` to `true`.
2024-08-16 18:24:51 +03:00
Xing Fan ⛳ ee50a64854 Merged PR 1405817: implement $unsetField
### 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
https://www.mongodb.com/docs/manual/reference/operator/aggregation/unsetField/
2024-08-16 18:24:51 +03:00
Zinan Ren 🐾 068a3364ed Merged PR 1400987: [Vector Search][DiskANN Part 1 - Refactoring] To support different index types in oss helio and pgmongo
### Does this PR have any customer impact?
Yes

### 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?
Yes
pgmongo.enableVectorDiskANNIndex: default is off

### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description
Refactoring vector search to support different index types in oss helio and pgmongo
### 1. Index type
- helio: vector-ivf, vector-hnsw
- pgmongo: vector-ivf, vector-hnsw, vector-diskann

### 2. Vector index creation
- ParseIndexCreationSpecFunc
- ValidateIndexCreationSpecFunc
- GenerateIndexCreationCmdFunc

### 3. Vector search
- ParseIndexSearchSpecFunc
- ValidateIndexSearchSpecFunc

### 4. Planner and custom scan
- GetIndexAccessMethodOidFunc
- GetSimilarityOpOidByFamilyOidFunc
- SetSearchParametersToGUCFunc
- GetDefaultSearchParamBsonFunc
- CalculateSearchParamBsonFunc

### 5. Test cases
- bson_aggregation_pipeline_tests_vector_diskann
- bson_aggregation_pipeline_tests_vector_hnsw
- bson_aggregation_pipeline_tests_vector_ivf
- bson_aggregation_pipeline_tests_vector_mongo
2024-08-16 18:24:51 +03:00
Vinod Sridharan 17a67446a3 Merged PR 1429304: Improve Delete unsharded Performance
### 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

Dleete unsharded

----
#### AI description  (iteration 1)
#### PR Classification
Performance improvement

#### PR Summary
This pull request enhances the performance of unsharded delete operations by introducing new serialization and deserialization methods and optimizing batch deletion processing.
- `src/commands/delete.c`: Added `SerializeUnshardedDeletionSpec` and `DeserializeDeleteWorkerSpecForUnsharded` functions to handle unsharded deletions.
- `src/commands/delete.c`: Modified `command_delete_worker` to support unsharded delete operations and improved batch deletion handling.
- `src/helio_api_init.c`: Introduced a new configuration flag `EnableUnshardedBatchDelete`.
- `src/commands/find_and_modify.c`: Updated `CallDeleteOne` to include a `forceInlineWrites` parameter.
- `include/commands/delete.h`: Updated function signature for `CallDeleteOne` to include `forceInlineWrites`.
2024-08-16 18:24:51 +03:00
Vinod Sridharan 2a1da01497 Merged PR 1427806: Fixes for create index background
### Does this PR have any customer impact?
Bugfixes for Background indexes

### 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

### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description

1) On index failure due to unique index violation, return DuplicateKey with the same error as insert
2) If an index build is in progress and a concurrent build is requested, wait on the concurrent build (rather than returning "build with the same options exist" - this means that if the first index build fails both calls fail and the second call doesn't assume the index exists
3) Don't query index builds during write commands (only query valid indexes for `$merge`, `$indexStats` etc
4) When an index build fails, don't immediately remove it from the index queue. Instead mark it as skippable. Once all the index builds complete after 20 mins, the index will be removed from the queue. This solves the issue of "index build failed but index was not found in main table"
5) Push unique index build to the background - running it in the foreground did not produce a better experience from private preview feedback
6) If the index build fails with a Mongo error, immediately mark it as skippable (not as failed)

----
#### AI description  (iteration 1)
#### PR Classification
Bug fix

#### PR Summary
This pull request addresses issues with creating indexes in the background by improving error handling and index conflict detection.
- `commands_common.c`: Added `TryGetErrorMessageAndCode` function to improve error message retrieval and handling.
- `create_indexes.c`: Enhanced conflict detection for index specifications and added handling for indexes in progress.
- `create_indexes_background.c`: Improved error handling and logging for background index creation.
- `index.c`: Updated SQL queries to include index build progress status.
- `cluster_operations.c`: Adjusted setup logic to handle index build tasks more effectively.
2024-08-16 18:24:51 +03:00
Santiago Fernandez Madero 836b6aaa9e Merged PR 1424086: Add a parse aggregation expression context while parsing the aggregation expressions
Flows a parse aggregation expression context while parsing the expression so that we can track if there were variables, operators, path expressions and do top level validation if needed for things like $let, etc.

----
#### AI description  (iteration 1)
#### PR Classification
API change to add a parse aggregation expression context while parsing aggregation expressions.

#### PR Summary
This pull request introduces a `ParseAggregationExpressionContext` to track the types of expressions encountered during the parsing of aggregation expressions.
- `include/operators/bson_expression_operators.h`: Added `ParseAggregationExpressionContext` parameter to various `ParseDollar*` functions.
- `src/operators/bson_expression_bitwise_operators.c`: Updated bitwise operator parsing functions to include the new context parameter.
- `src/operators/bson_expression_date_operators.c`: Modified date operator parsing functions to use the new context parameter.
- `src/operators/bson_expression_string_operators.c`: Updated string operator parsing functions to include the context parameter.
- `include/operators/bson_expression.h`: Defined the `ParseAggregationExpressionContext` struct.
2024-08-16 18:24:51 +03:00
Parag Jain 90c74bcb94 Merged PR 1412316: [Feature] Merge Index Push down for join condition Part-3
### 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
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description

----
#### AI description  (iteration 1)
#### PR Classification
New feature: Adds support for index pushdown in join conditions for the `$merge` stage in aggregation pipelines.

#### PR Summary
This pull request introduces index pushdown capabilities for join conditions in the `$merge` stage, enhancing query performance.
- `src/opclass/index_support.c`: Added support functions for index pushdown in `$merge` join filters.
- `sql/udfs/aggregation/bson_merge_functions--1.20-0.sql`: Created new SQL functions to support index pushdown and handle merge operations.
- `src/aggregation/bson_aggregation_output_pipeline.c`: Implemented functions to create join expressions and extract merge filters.
- `Tests.Postgres.CSharp/Integration/Aggregation/MergeTests.cs`: Added integration tests to verify index pushdown functionality.
- `src/metadata/metadata_cache.c`: Added function OIDs for new merge-related functions.
2024-08-16 18:24:51 +03:00
Xiaochun Liang 622d392bf2 Merged PR 1376029: stdDevPop and stdDevSamp accumulator for group by aggregation
### 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
Implementation of $stdDevPop and $stdDevSamp accumulators.

Reference:
[stdDevPop](https://www.mongodb.com/docs/manual/reference/operator/aggregation/stdDevPop/)
[stdDevSamp](https://www.mongodb.com/docs/manual/reference/operator/aggregation/stdDevSamp/)

Related work items: #3277074
2024-08-16 18:24:51 +03:00
Vinod Sridharan 97ec6b9a9e Merged PR 1423159: Internal error fix and correct feature flag
### 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?
Yes

### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description
- Implement READ for some scan types to avoid internal errors
- Move feature flag for local shard use to the local shard use feature flag.

----
#### AI description  (iteration 1)
#### PR Classification
Bug fix and feature flag correction.

#### PR Summary
This pull request addresses an internal error and corrects the usage of a feature flag.
- `custom_scan_continuation.c`: Added functions for reading and writing custom scan nodes, replacing unsupported functions.
- `rum_custom_join_scan.c`: Added functions for reading and writing custom join scan nodes, replacing unsupported functions.
- `api_hook_impl.c`: Corrected feature flag usage from `EnableNativeColocation` to `UseLocalExecutionShardQueries`.
- `custom_query_scan.c`: Updated error messages for unsupported node types to be more specific.
2024-08-16 18:24:51 +03:00
Vinod Sridharan c9e638208a Merged PR 1420391: Multinode & Multi-region improvements
### 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

Multinode improvements: Better diagnostics on sharding:
- This shows each data bearing node as a "shard_##"
- It shows each sharded table and what nodes the shards are on.
- Shows the rebalancer as off and auto-split as off
![image.png](https://msdata.visualstudio.com/ba574a88-a171-48e0-8fcb-5fef6d23739c/_apis/git/repositories/501a5e7e-ffdc-4d1e-a5e6-910f73c6eb9a/pullRequests/1420391/attachments/image.png)

Introduces the chunks table where we can report chunks and sizes:
![image (2).png](https://msdata.visualstudio.com/ba574a88-a171-48e0-8fcb-5fef6d23739c/_apis/git/repositories/501a5e7e-ffdc-4d1e-a5e6-910f73c6eb9a/pullRequests/1420391/attachments/image%20%282%29.png)

- This will also report sizes of each chunks so you can run aggregate queries to get size per node, size per table etc.
----
#### AI description  (iteration 1)
#### PR Classification
Enhancement for multinode and multi-region support.

#### PR Summary
This pull request introduces significant improvements to the multinode and multi-region capabilities of the system by adding new query rewriting functions and enhancing existing ones.
- `shard_colocation.c`: Added `RewriteConfigShardsQueryForDistribution` to handle shard configuration queries and `RewriteConfigChunksQueryForDistribution` to manage chunk configuration queries, including integration with Citus for shard size information.
2024-08-16 18:24:51 +03:00
Cornelius Boateng d4bc5366ff Merged PR 1415920: [Operators] Support for Trigonometry operators
### 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) 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
Implemented support for $degreesToRadians, $radiansToDegrees, $sin, $cos, $tan, $sinh, $cosh, $tanh, $asin, $acos, $atan, $atan2, $asinh, and $atanh trig operators

----
#### AI description  (iteration 1)
#### PR Classification
New feature

#### PR Summary
This pull request adds support for trigonometric operators in BSON expressions.
- Added trigonometric functions (`$sin`, `$cos`, `$tan`, `$sinh`, `$cosh`, `$tanh`, `$asin`, `$acos`, `$atan`, `$atan2`, `$asinh`, `$acosh`, `$atanh`) in `oss/pg_helio_api/src/operators/bson_expression_trigonometry_operators.c`.
- Added extensive test cases for the new trigonometric operators in `/pgmongo/src/test/regress/expected/bson_aggregation_trigonometric_operators_tests.out`.
2024-08-16 18:24:51 +03:00
Rajesh Kumar Thandapani 24704eb978 Merged PR 1409491: Change Stream implementation with Direct WAL decoding (without replication slots)
### Does this PR have any customer impact?
 Yes, it provides support for $changeStream pipeline stage for creating change stream cursor and consuming events from it.

### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature.

### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
Adds a new UDF for change_stream_aggregation

### Are you introducing any new config? If yes, do you have tests with and without them being set?
Adds a GUC for enabling ChangeStreams freature and tests have been added to test the feature. It is disabled by default.

### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
../docs/pgmongo/design_docs/data_plane/change_streams/change_stream_release_notes.md

### Description

This PR implements the change stream tailing cursors using the direct WAL decoding. It avoids using replications slots for logical decoding because of the constraints in creating and decoding with replication slots.

Related work items: #2973720
2024-07-31 17:09:22 +03:00
Vinod Sridharan 48020446af Merged PR 1415642: [Perf] Enable Cross Rum Index joins
### Does this PR have any customer impact?
No

### 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 (Feature flag for scan perf)

### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description
Enables joining across multiple RUM indexes for bitmap scans (so that the user doesn't need to create a single composite index for performance).

----
#### AI description  (iteration 1)
#### PR Classification
Performance improvement

#### PR Summary
This pull request introduces optimized cross RUM index joins to enhance query performance.
- Added `rum_custom_join_scan.c` to implement custom scan logic for RUM index joins.
- Updated `rumget.c` to include `multiandgetbitmap` function for handling multiple index scans.
- Modified `custom_scan_continuation.c` to integrate custom scan paths and optimize query plans.
2024-07-31 17:09:22 +03:00
Vinod Sridharan f64558301b Merged PR 1411883: [Lookup with Let] Fix up some JStests for lookup with Let and misc lookup fixes
### 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)
Yes

### Are you introducing any new config? If yes, do you have tests with and without them being set?
Yes and Yes
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description
- Fix up bugs with $lookup with Let by rewriting lookup to be let friendly
- Get through jstests having lookup with let
-  Optimize Lookup where hte left and right both are on _id to support joins directly on object_id
- Allow the lookup pipeline to be split as "inlined" and "non-inlined" and allow pushing up the inlined pipeline
- Fix bugs with facet/graphlookup arising from Lookup with let tests
- Allow inlining the $unwind path after a $lookup if the $unwind matches a $lookup as (behind a feature flag)
2024-07-31 17:09:22 +03:00
Deepak Pemmaraju 6d0a958d18 Merged PR 1370910: Setting right permissions when creating a collection, changing Gateway error codes and adding gateway tests
### 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
2024-07-31 17:09:22 +03:00
Xing Fan ⛳ 02ccfae470 Merged PR 1401106: Implement $getField
### 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

MongoDB doc:
https://www.mongodb.com/docs/manual/reference/operator/aggregation/getField/
2024-07-31 17:09:22 +03:00
Ayush Saluja 772bc012a9 Merged PR 1398717: bugfix remove ntoreturn support as an option
### Does this PR have any customer impact?

### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Bugfix

### 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))
For release we might need to discuss as there can be clients which are using this option.

### Description
This aims to fix the jstest  "jstests/core/find_with_ntoreturn_fails.js"
This test states the option ntoreturn is not supported since mongo version>=5.1

hence, removing support

Related work items: #3336041
2024-07-31 17:09:22 +03:00
Vinod Sridharan c4ed06beeb Merged PR 1402545: [Let] Support let in all remaining stages except $lookup
### Does this PR have any customer impact?
Not yet

### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Features

### 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

### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description
Support remaining aggregation stages except $lookup and $mergeObjects on sorted with $group.
2024-07-31 17:09:22 +03:00
Vinod Sridharan 3cbc0e0037 Merged PR 1400815: [Let support] Add support for let in more stages
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Features
### 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
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
n/a
### Description
Add support for let in
- $sortByCount
- $group (partial)
- $addFields
- $project
- $facet
- $unionWith
- $graphLookup
- $project
2024-07-31 17:09:22 +03:00
Deepak Bisht 91b9946227 Merged PR 1383926: setWindowFields aggregation stage
### 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

### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
- Support for `$setWindowFields` aggregation pipeline stage

### Description
This PR adds the support for `$setWindowFields` aggregation stage using the Postgres `Window aggregation` operators.

For the first PR it only adds support with `$sum` aggregation operator.
Next set of PRs will individually support all the other window aggregation operators supported by `$setWindowFields` stage.

[TODO] Currently $sum is used as is (the way $group uses it), there is way to optimize this using the `Inverse Transition` functions for Window aggregation which modifies the aggregated state in a way to accomodate rows leaving the group in a moving window, which will be done later (this is done to make review on smaller set of files)

Related work items: #2272584
2024-07-11 17:56:53 +03:00
Vinod Sridharan 65a0cf4a46 Merged PR 1399519: Let support: Part 1: Add support for let in find/aggregate
### 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

### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description
Add support for `let` in `find` and `aggregate`
- For find ensure that let can be supported both in projection and query.
- For aggregate, so far this is only supported in `$match`.

In subsequent PRs other stages will be reviewed and modified.

Note that this is a precursor to $lookup with let since Lookup's inner pipeline can reference any of those stages that can use `let`

Since this is a partial feature this is guarded with a feature flag.
2024-07-11 17:56:53 +03:00
Vinod Sridharan 5dbc8843d4 Merged PR 1398308: [Colocation] Support colocation with Transaction isolation
### 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
- If we have 2 concurrent tables being created in 1 DB then they get colocated in 2 different groups.
- Prevent this by using a common table per db (system.dbSentinel).
2024-07-11 17:56:53 +03:00
Parag Jain 0922eac1d7 Merged PR 1391214: [Feature] support for $merge aggregation stage part -2
### Does this PR have any customer impact?
No

### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
No

### 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 of `merge` Action in case of `whenMatched` in `$merge` aggregation stage.

Related work items: #1827100
2024-07-11 17:56:53 +03:00
Ujjwal Agrawal 235df34099 Merged PR 1371362: add 2d index bounds validation
### 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

Add check that the geoNear query's reference point is within the geo bounds added in the index

Related work items: #3263902
2024-07-11 17:56:53 +03:00
Vinod Sridharan fb71d32668 Merged PR 1394549: Take 2: Fixes with colocation and Citus 12
### 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

Take 2: Fixes with colocation and Citus 12
2024-07-05 13:16:04 +03:00
Deepak Bisht 5cb7bf4ca5 Merged PR 1394849: Geospatial Internal self intersection errors for $polygon
### 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

### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
- Bugfix with $polygon self intersecting geometry

### Description
MongoDB is not restrictive when the 2d polygon is created using `$polygon`

Here the polygon defined by `$polygon` is not a valid polygon as it intersects with itself
`[[10, 10], [10, 12], [11, 11], [9, 11]]`

![image.png](https://msdata.visualstudio.com/ba574a88-a171-48e0-8fcb-5fef6d23739c/_apis/git/repositories/501a5e7e-ffdc-4d1e-a5e6-910f73c6eb9a/pullRequests/1394849/attachments/image.png)

But similar query in Postgis would not work and we can always make them valid using ST_makevalid:
![image (2).png](https://msdata.visualstudio.com/ba574a88-a171-48e0-8fcb-5fef6d23739c/_apis/git/repositories/501a5e7e-ffdc-4d1e-a5e6-910f73c6eb9a/pullRequests/1394849/attachments/image%20%282%29.png)
2024-07-05 13:16:04 +03:00
Shuai Tian 🚀 4eb63103f3 Merged PR 1359786: Add $bucket stage doc and implementation
### 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
Add bucket aggregation stage

Query time comparison for $bucket between Atlas and vCore:
https://microsoftapc-my.sharepoint.com/❌/g/personal/shuaitian_microsoft_com/EduvH4BY2O9Dnt92siIPJlUBOF5DNKNeF4BSQ6NeyZO-iQ?e=xGAuIC

Related work items: #1798584
2024-07-05 13:16:04 +03:00
Santiago Fernandez Madero 017d302a57 Merged PR 1319595: inverseMatch: Support specifying a from collection to avoid the need of a lookup
This PR adds support to specify a from collection within the same database in an inverseMatch aggregation stage.

The spec is as follows:

```
{"$inverseMatch": {"path": <path>, "from": <collection>, "pipeline": <[match | project | limit]> }}
```

Where the input to the inverseMatch evaluation is the result of running the aggregation pipeline against the given collection.
2024-07-05 13:16:04 +03:00
Vinod Sridharan 204950f55c Merged PR 1391279: [Unique] Unique error constraint should have the Index name in the error
### 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

### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description
Unique error constraint should have the Index name in the error
2024-07-05 13:16:04 +03:00
Vinod Sridharan f4ce1f8ae2 Merged PR 1390611: [Background Worker] Spin up background worker behind a feature flag
### 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 - feature flags
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description
Create background worker stub - this worker does nothing other than sleep.
Only turn this on behind a feature flag and enable it for backend tests only.
2024-07-05 13:16:04 +03:00
Vinod Sridharan 07c3bba78c Merged PR 1390575: [Toshiba fixes] Fix up version handling and code cleanups
### 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

### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description
- Delete dead configs
- Reduce number of calls to check version information
- Move ExtensionVersion checks to shared memory
2024-07-05 13:16:04 +03:00
Duan Pei✨ 9f977c084b Merged PR 1352447: $bitAnd/$bitOr/$bitXor/$bitNot operators
### 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
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
No
### Description
Implementation of bitwise aggregation operators

### Error handling instructions:
#### bitk2 collection:
![image.png](https://msdata.visualstudio.com/ba574a88-a171-48e0-8fcb-5fef6d23739c/_apis/git/repositories/501a5e7e-ffdc-4d1e-a5e6-910f73c6eb9a/pullRequests/1352447/attachments/image.png)
#### bitNot:
##### [1,2,"$a"] and $c have different processing logic:
![image (3).png](https://msdata.visualstudio.com/ba574a88-a171-48e0-8fcb-5fef6d23739c/_apis/git/repositories/501a5e7e-ffdc-4d1e-a5e6-910f73c6eb9a/pullRequests/1352447/attachments/image%20%283%29.png)
##### Error messages for [2.1] and ["$c"]
![image (8).png](https://msdata.visualstudio.com/ba574a88-a171-48e0-8fcb-5fef6d23739c/_apis/git/repositories/501a5e7e-ffdc-4d1e-a5e6-910f73c6eb9a/pullRequests/1352447/attachments/image%20%288%29.png)

#### bitAnd (bitAnd bitOr bitXor error handling logic is consistent):
![image (5).png](https://msdata.visualstudio.com/ba574a88-a171-48e0-8fcb-5fef6d23739c/_apis/git/repositories/501a5e7e-ffdc-4d1e-a5e6-910f73c6eb9a/pullRequests/1352447/attachments/image%20%285%29.png)
2024-07-05 13:16:04 +03:00
Parag Jain 833980da3f Merged PR 1344998: [Feature] support for $merge aggregation stage part -1
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
No
### 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))
NA
### Description:

**Things this PR has:**
1. support for $merge stage for unsharded collection.
- whenNotMatched : support for `fail` , `discard` and `insert` option.
- whenMatched : support for `replace`, `fail` and `keep-existing` option.

**What next In upcoming PR's :**
1. support for 'merge' option whenMathced
2. support for 'pipeline' option whenMatched.
3. support for sharded collection.
4. support of co-located collection. (one case : when source and taget is same)
5. Index push down for join condition.
6. optimizations in case of sharded collection and unsharded collection for single aggregation stage when we can directly refer source shard_key_column.

Related work items: #3085830
2024-07-05 13:16:04 +03:00
Jia Hu 👻 7c1104ee62 Merged PR 1371339: Schema validation wave 1 - create/update/get for metadata
### 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
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description
wave1 - create/update/get for schema validation metadata
2024-07-05 13:16:04 +03:00