mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-25 11:49:53 -05:00
### 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? No ### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md)) ### Description Port 4 tests to helio_distributed and clean up the code to make them pass. ---- #### AI description (iteration 1) #### PR Classification Porting initial tests to a distributed environment. #### PR Summary This pull request ports the first four tests to a distributed environment, ensuring that the query evaluation functions work correctly in this setup. - Added distributed test cases for various BSON expression evaluations in `src/test/regress/expected/bson_expr_eval_tests.out`.
23 lines
785 B
SQL
23 lines
785 B
SQL
|
|
/*
|
|
* __API_SCHEMA__.collection() can be used to query collections, e.g.:
|
|
* SELECT * FROM __API_SCHEMA__.collection('db','collection')
|
|
*
|
|
* While this seems slow, we use the planner hook to replace this function
|
|
* directly with the table, so we usually do not call it directly.
|
|
*
|
|
* Output arguments need to match data tables exactly.
|
|
*/
|
|
CREATE OR REPLACE FUNCTION helio_api.collection(
|
|
p_database_name text,
|
|
p_collection_name text,
|
|
OUT shard_key_value bigint,
|
|
OUT object_id __CORE_SCHEMA__.bson,
|
|
OUT document __CORE_SCHEMA__.bson,
|
|
OUT creation_time timestamptz)
|
|
RETURNS SETOF record
|
|
LANGUAGE c
|
|
STRICT
|
|
AS 'MODULE_PATHNAME', $function$command_api_collection$function$;
|
|
COMMENT ON FUNCTION helio_api.collection(text,text)
|
|
IS 'query a Mongo collection'; |