Find your dataset
Pass your table to the following api call - http://<url>/v2/get-rules-export?dataset=public.transit_6​
Run import on the desired environment, passing the output of the previous statement to the body of the request - http://<url>/v2/run-import​
The following stored procedure needs to be created in the Owl metastore before this can run.
CREATE OR REPLACE FUNCTION public.dump(p_schema text, p_table text, p_where text)RETURNS SETOF textLANGUAGE plpgsqlAS $function$DECLAREdumpquery_0 text;dumpquery_1 text;selquery text;selvalue text;valrec record;colrec record;BEGIN​-- ------ ---- GLOBAL ---- build base INSERT-- build SELECT array[ ... ]dumpquery_0 := 'INSERT INTO ' || quote_ident(p_schema) || '.' || quote_ident(p_table) || '(';selquery := 'SELECT array[';​<<label0>>FOR colrec IN SELECT table_schema, table_name, column_name, data_typeFROM information_schema.columnsWHERE table_name = p_table and table_schema = p_schemaORDER BY ordinal_positionLOOPdumpquery_0 := dumpquery_0 || quote_ident(colrec.column_name) || ',';selquery := selquery || 'CAST(' || quote_ident(colrec.column_name) || ' AS TEXT),';END LOOP label0;​dumpquery_0 := substring(dumpquery_0 ,1,length(dumpquery_0)-1) || ')';dumpquery_0 := dumpquery_0 || ' VALUES (';selquery := substring(selquery ,1,length(selquery)-1) || '] AS MYARRAY';selquery := selquery || ' FROM ' ||quote_ident(p_schema)||'.'||quote_ident(p_table);selquery := selquery || ' WHERE '||p_where;-- GLOBAL ---- ------ --​-- ----------- ---- SELECT LOOP ---- execute SELECT built and loop on each row<<label1>>FOR valrec IN EXECUTE selqueryLOOPdumpquery_1 := '';IF not found THENEXIT ;END IF;​-- ----------- ---- LOOP ARRAY (EACH FIELDS) --<<label2>>FOREACH selvalue in ARRAY valrec.MYARRAYLOOPIF selvalue IS NULLTHEN selvalue := 'NULL';ELSE selvalue := quote_literal(selvalue);END IF;dumpquery_1 := dumpquery_1 || selvalue || ',';END LOOP label2;dumpquery_1 := substring(dumpquery_1 ,1,length(dumpquery_1)-1) || ');';-- LOOP ARRAY (EACH FIELD) ---- ----------- --​-- debug: RETURN NEXT dumpquery_0 || dumpquery_1 || ' --' || selquery;-- debug: RETURN NEXT selquery;RETURN NEXT dumpquery_0 || dumpquery_1;​END LOOP label1 ;-- SELECT LOOP ---- ----------- --​RETURN ;END$function$;​
Navigate to the API page
Find the Rest APIs link
Drill-in to the controller-scala section
Find the get-rules-export call
Click Try it out and enter a dataset name, Execute to run the call
Copy the response body
Navigate to the controller-catalog section
Find run-import and Try it out
Make any edits and paste in the response body from the previous step
Visually validate the rules were transferred to another dataset successfully