Files
documentdb/pg_documentdb/sql/schema/bson_rum_text_path_ops--0.24-0.sql
T
Zinan Ren 47ec4231ba Merged PR 1543189: [OSS] Porting type/operator/schema into documentdb - part 1
### 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

Start porting schemas for documentdb api.
Introducing API_SCHEMA_NAME_V2, API_SCHEMA_INTERNAL_NAME_V2, API_CATALOG_SCHEMA_NAME_V2

----
#### AI description  (iteration 1)
#### PR Classification
Porting type/operator/schema into documentdb.

#### PR Summary
This pull request ports various types, operators, and schemas into documentdb as part of an ongoing effort.
- `pg_documentdb/sql/documentdb--0.24-0.sql`: Created multiple schemas and included various SQL files for query functions, operators, and metadata.
- `pg_documentdb/sql/operators/bson_dollar_operators--0.16-0.sql`: Updated operator definitions to use `__API_SCHEMA_INTERNAL_V2__`.
- `pgmongo/sql/operators/bson_dollar_negation_operators--1.15-1.sql` and `pg_documentdb/sql/operators/bson_dollar_negation_operators--0.16-0.sql`: Changed operator definitions to use `__API_SCHEMA_INTERNAL_V2__`.
- `Makefile.cflags`: Added checks for new schema variables `API_SCHEMA_NAME_V2`, `API_SCHEMA_INTERNAL_NAME_V2`, and `API_CATALOG_SCHEMA_NAME_V2`.
- `pg_documentdb/sql/schema/unique_shard_path_operator_class--0.24-0.sql`: Updated operator class definitions to use `__API_SCHEMA_INTERNAL_V2__`.
2025-01-15 07:48:40 +00:00

19 lines
1.7 KiB
SQL

-- This is a variant of public.rum_tsvector_ops. However, this takes 'bson' as an input so we can hook it up against our
-- index selection and handling of array paths etc. We override the extract tsvector where we take the bson, generate the tsvector
-- and generate the 'text' terms for the index (just like rum would). The query path remains identical. Note that the terms in the
-- index are still text.
CREATE OPERATOR CLASS __API_CATALOG_SCHEMA__.bson_rum_text_path_ops
FOR TYPE __CORE_SCHEMA__.bson using __EXTENSION_OBJECT__(_rum) AS
OPERATOR 1 __API_CATALOG_SCHEMA__.@#% (__CORE_SCHEMA__.bson, tsquery),
FUNCTION 1 gin_cmp_tslexeme(text, text),
FUNCTION 2 __API_SCHEMA_INTERNAL_V2__.rum_bson_single_path_extract_tsvector(__CORE_SCHEMA__.bson,internal,internal,internal,internal),
FUNCTION 3 public.rum_extract_tsquery(tsquery,internal,smallint,internal,internal,internal,internal),
FUNCTION 4 public.rum_tsquery_consistent(internal,smallint,tsvector,int,internal,internal,internal,internal),
FUNCTION 5 gin_cmp_prefix(text,text,smallint,internal),
FUNCTION 6 public.rum_tsvector_config(internal),
FUNCTION 7 public.rum_tsquery_pre_consistent(internal,smallint,tsvector,int,internal,internal,internal,internal),
FUNCTION 8 public.rum_tsquery_distance(internal,smallint,tsvector,int,internal,internal,internal,internal,internal),
FUNCTION 10 public.rum_ts_join_pos(internal, internal),
FUNCTION 11 (__CORE_SCHEMA__.bson) __API_SCHEMA_INTERNAL_V2__.rum_bson_text_path_options(internal),
STORAGE text;