Files
documentdb/pg_documentdb
Vinod Sridharan 4eb4dcfbcc Merged PR 1716351: [$lookup] Re-enable lookup left join and make inner join behind a GUC
### Does this PR have any customer impact?
Yes

### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Bugfix/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
Re-enable lookup left join and make inner join behind a GUC

----
#### AI description  (iteration 1)
#### PR Classification
This PR re-enables lookup left join functionality while making inner join behavior optional via a new configuration flag.

#### PR Summary
The pull request refactors lookup join processing so that by default the system uses left join (adding a null check filter) while inner join is enabled only when the new GUC is turned on. Key changes include:
- **`pg_documentdb/src/aggregation/bson_aggregation_nested_pipeline.c`**: Updated join logic to use LEFT JOIN LATERAL with an added null filter and replaced the deprecated `useInnerJoin` flag with `preserveNullAndEmptyArrays`.
- **`pg_documentdb/src/configs/feature_flag_configs.c`**: Introduced the new boolean GUC `enableLookupInnerJoin` (with a default of false) to control join type.
- **Test Files (e.g., expected output and SQL tests under `pg_documentdb` and `pgmongo` directories)**: Modified expected query plans and test scripts to validate the updated lookup join behavior.
- **`pg_documentdb/src/customscan/custom_explain_scan.c`**: Propagated parameter information to custom explain scan outputs.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-07-09 18:56:11 +08:00
..