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? ### 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 -->
23 lines
1.1 KiB
PL/PgSQL
23 lines
1.1 KiB
PL/PgSQL
#include "udfs/metadata/list_databases--0.102-0.sql"
|
|
#include "udfs/ttl/ttl_support_functions--0.102-0.sql"
|
|
#include "udfs/commands_diagnostic/current_op--0.102-0.sql"
|
|
#include "udfs/query/bson_query_match--0.102-0.sql"
|
|
#include "udfs/projection/bson_projection--0.102-0.sql"
|
|
#include "udfs/aggregation/bson_aggregation_redact--0.102-0.sql"
|
|
#include "udfs/aggregation/bson_merge_functions--0.102-0.sql"
|
|
|
|
#include "udfs/aggregation/group_aggregates_support--0.102-0.sql"
|
|
#include "udfs/aggregation/group_aggregates--0.102-0.sql"
|
|
|
|
-- Schedule TTL Cron job to prune TTL indexes on every documentdb instance.
|
|
DO LANGUAGE plpgsql $cmd$
|
|
BEGIN
|
|
IF NOT EXISTS(SELECT 1 FROM cron.job where jobname = 'documentdb_ttl_task') THEN
|
|
PERFORM cron.schedule('documentdb_ttl_task', '* * * * *', $$CALL documentdb_api_internal.delete_expired_rows();$$);
|
|
END IF;
|
|
END;
|
|
$cmd$;
|
|
|
|
DROP AGGREGATE IF EXISTS __API_CATALOG_SCHEMA__.BSON_OUT(__CORE_SCHEMA__.bson, text, text, text, text);
|
|
DROP FUNCTION IF EXISTS __API_CATALOG_SCHEMA__.bson_out_transition;
|
|
DROP FUNCTION IF EXISTS __API_CATALOG_SCHEMA__.bson_out_final; |