-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. also remove CAST from OFFSET 2. remove explicit `public` schema. Needed for UDF passthrough 3. `jsonb` isn't in MySQL, so rewrite '...'::jsonb literals, in particular mapping [1,2,3] to array for StarRocks This can be leveraged to use array functions in StarRocks: ```sql CREATE OR REPLACE FUNCTION public.cardinality(jsonb) RETURNS int AS $$ BEGIN RETURN jsonb_array_length($1); END $$ LANGUAGE PLPGSQL IMMUTABLE; CREATE OR REPLACE FUNCTION public.array_intersect(jsonb, jsonb) RETURNS jsonb AS $$ BEGIN RETURN (select jsonb_agg(a) from jsonb_array_elements($1) a join jsonb_array_elements($2) b on a = b); END $$ LANGUAGE PLPGSQL IMMUTABLE; -- where postgres_fdw is specified in `extensions` option of fdw server ALTER EXTENSION postgres_fdw ADD FUNCTION public.cardinality(jsonb); ALTER EXTENSION postgres_fdw ADD FUNCTION public.array_intersect(jsonb, jsonb); ``` After which `select array_intersect(fdwtbl.col, '[1,2,3]') from fdwtbl` can be pushed down, but function will also work if postgres for some reason can't push down
- Loading branch information
Showing
7 changed files
with
64 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters