Skip to content
Snippets Groups Projects

Update V7_1__NewExperimentResultFormat.sql

Merged Kostas FILIPPOPOLITIS requested to merge cherrypick_changes_from_7.2.0 into master
1 file
+ 15
1
Compare changes
  • Side-by-side
  • Inline
UPDATE experiment SET result = result::json #>>'{0,result}' WHERE (algorithm::json->>'type') <> 'workflow';
\ No newline at end of file
CREATE OR REPLACE FUNCTION ISJSON(p_json text)
RETURNS boolean
AS
$$
BEGIN
RETURN (p_json::json is not null);
EXCEPTION
WHEN others THEN
RETURN false;
END;
$$
language plpgsql
immutable;
UPDATE experiment SET result = result::json #>>'{0,result}' WHERE (algorithm::json->>'type') <> 'workflow' and ISJSON(result);
UPDATE experiment SET result = '', status = 'error' WHERE NOT ISJSON(result);