-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#303: Get flow checkpoints refactoring #304
Changes from 4 commits
6f37267
68e5622
e6a65b3
df7119d
ce05796
52a9243
0ac613a
e3d198c
e0f40a5
353af66
0c520c5
7e4513a
30c0766
93a64f0
ba52d4e
b5122c8
728ee5d
4d0175b
877fac3
57c5bbe
12466a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,3 +91,4 @@ utils/resources/*.conf | |
/server/certs/ | ||
/server/selfsigned.crt | ||
/server/selfsigned.p12 | ||
/.bloop/ | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ CREATE OR REPLACE FUNCTION flows.get_flow_checkpoints( | |
IN i_checkpoints_limit INT DEFAULT 5, | ||
IN i_offset BIGINT DEFAULT 0, | ||
IN i_checkpoint_name TEXT DEFAULT NULL, | ||
IN i_latest_first BOOLEAN DEFAULT TRUE, | ||
OUT status INTEGER, | ||
OUT status_text TEXT, | ||
OUT id_checkpoint UUID, | ||
|
@@ -61,6 +62,7 @@ $$ | |
-- i_checkpoints_limit - (optional) maximum number of checkpoint to return, returns all of them if NULL | ||
-- i_offset - (optional) offset for checkpoints pagination | ||
-- i_checkpoint_name - (optional) if specified, returns data related to particular checkpoint's name | ||
-- i_latest_first - (optional) if true, checkpoints are ordered by process_start_time in descending order | ||
-- | ||
-- Note: i_checkpoint_limit and i_offset are used for pagination purposes; | ||
-- checkpoints are ordered by process_start_time in descending order | ||
|
@@ -132,7 +134,13 @@ BEGIN | |
JOIN flows.partitioning_to_flow PF ON C.fk_partitioning = PF.fk_partitioning | ||
WHERE PF.fk_flow = i_flow_id | ||
AND (i_checkpoint_name IS NULL OR C.checkpoint_name = i_checkpoint_name) | ||
ORDER BY C.process_start_time DESC | ||
ORDER BY | ||
CASE | ||
WHEN i_latest_first THEN C.process_start_time | ||
END DESC, | ||
CASE | ||
WHEN NOT i_latest_first THEN C.process_start_time | ||
END ASC | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is tricky on NULL. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or just use a local variable at the beginning |
||
LIMIT i_checkpoints_limit OFFSET i_offset | ||
) | ||
SELECT | ||
|
@@ -159,9 +167,15 @@ BEGIN | |
runs.measure_definitions MD ON M.fk_measure_definition = MD.id_measure_definition | ||
INNER JOIN | ||
runs.partitionings P ON LC.fk_partitioning = P.id_partitioning | ||
ORDER BY LC.process_start_time DESC; | ||
ORDER BY | ||
CASE | ||
WHEN i_latest_first THEN LC.process_start_time | ||
END DESC, | ||
CASE | ||
WHEN NOT i_latest_first THEN LC.process_start_time | ||
END ASC; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. used the coalesce |
||
END; | ||
$$ | ||
LANGUAGE plpgsql VOLATILE SECURITY DEFINER; | ||
|
||
GRANT EXECUTE ON FUNCTION flows.get_flow_checkpoints(BIGINT, INT, BIGINT, TEXT) TO atum_owner; | ||
GRANT EXECUTE ON FUNCTION flows.get_flow_checkpoints(BIGINT, INT, BIGINT, TEXT, BOOLEAN) TO atum_owner; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know which plugin/tool does that but there was .bloop folder generated which I believe shouldn't be part of VCS.