Skip to content

Commit 25e0b76

Browse files
ARROW-4313: Ingestion functions moved out of the trigger functions file; redundant permissions revocation removed
1 parent d47b1e5 commit 25e0b76

2 files changed

Lines changed: 0 additions & 54 deletions

File tree

dev/benchmarking/ddl/3_01_functions_triggers.sql

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
under the License.
1818
*/
1919

20-
-- For future fine-grained control over function execution by user group.
21-
ALTER DEFAULT PRIVILEGES REVOKE EXECUTE ON functions FROM public;
2220

2321
-------------------------- TRIGGER FUNCTIONS --------------------------
2422
-- Views that do not select from a single table or view are not
@@ -574,54 +572,3 @@ $$
574572
END
575573
$$
576574
LANGUAGE plpgsql;
577-
578-
579-
-------------------------- IMPORT HELPERS --------------------------
580-
-- Load from JSON (from https://stackoverflow.com/a/48396608)
581-
-- How to use it in the psql client:
582-
-- \set content `cat /examples/machine.json`
583-
-- select ingest_machine(:'content'::jsonb);
584-
-- INGEST_MACHINE_VIEW
585-
CREATE OR REPLACE FUNCTION public.ingest_machine_view(from_jsonb jsonb)
586-
RETURNS integer AS
587-
$$
588-
DECLARE
589-
result integer;
590-
BEGIN
591-
INSERT INTO public.machine_view
592-
SELECT * FROM jsonb_populate_record(null::public.machine_view, from_jsonb)
593-
RETURNING machine_id INTO result;
594-
RETURN result;
595-
END
596-
$$
597-
LANGUAGE plpgsql;
598-
599-
-- INGEST_BENCHMARK_VIEW
600-
CREATE OR REPLACE FUNCTION public.ingest_benchmark_view(from_jsonb jsonb)
601-
RETURNS setof integer AS
602-
$$
603-
BEGIN
604-
RETURN QUERY
605-
INSERT INTO public.benchmark_view
606-
SELECT * FROM jsonb_populate_recordset(
607-
null::public.benchmark_view
608-
, from_jsonb
609-
)
610-
RETURNING benchmark_id;
611-
END
612-
$$
613-
LANGUAGE plpgsql;
614-
615-
-- INGEST_BENCHMARK_RUN_VIEW
616-
CREATE OR REPLACE FUNCTION public.ingest_benchmark_run_view(from_jsonb jsonb)
617-
RETURNS setof bigint AS
618-
$$
619-
BEGIN
620-
RETURN QUERY
621-
INSERT INTO public.benchmark_run_view
622-
SELECT * FROM
623-
jsonb_populate_recordset(null::public.benchmark_run_view, from_jsonb)
624-
RETURNING benchmark_run_id;
625-
END
626-
$$
627-
LANGUAGE plpgsql;

dev/benchmarking/ddl/5_00_permissions.sql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,4 @@ GRANT INSERT ON
7070
, public.language_implementation_version_view
7171
, public.machine_view
7272
, public.unit_view
73-
, public.summarized_tables
7473
TO arrow_anonymous;

0 commit comments

Comments
 (0)