Skip to content

Rewrite update_functions.sql to avoid dependency on internal logic of… #120

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

Merged
merged 1 commit into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 12 additions & 66 deletions expected/update_functions.out
Original file line number Diff line number Diff line change
Expand Up @@ -295,40 +295,10 @@ UNION ALL
-- aqo_data_update() testing.
--
-- Populate aqo_data with dump data.
SELECT aqo_data_update(fs, fss, nfeatures, features, targets, reliability, oids) AS res
FROM aqo_data_dump
ORDER BY res;
res
-----
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
(27 rows)

SELECT count(*) AS res1 FROM
aqo_data_dump,
LATERAL aqo_data_update(fs, fss, nfeatures, features, targets, reliability, oids) AS ret
WHERE ret \gset
-- Check if data is the same as in source, no result rows expected.
(TABLE aqo_data_dump EXCEPT TABLE aqo_data)
UNION ALL
Expand All @@ -338,39 +308,15 @@ UNION ALL
(0 rows)

-- Update aqo_data with dump data.
SELECT aqo_data_update(fs, fss, nfeatures, features, targets, reliability, oids) AS res
FROM aqo_data_dump
ORDER BY res;
res
-----
t
t
t
t
t
t
t
t
t
t
t
t
SELECT count(*) AS res2 FROM
aqo_data_dump,
LATERAL aqo_data_update(fs, fss, nfeatures, features, targets, reliability, oids) AS ret
WHERE ret \gset
SELECT :res1 = :res2 AS ml_sizes_are_equal;
ml_sizes_are_equal
--------------------
t
t
t
t
t
t
t
t
t
t
t
t
t
t
t
(27 rows)
(1 row)

-- Check if data is the same as in source, no result rows expected.
(TABLE aqo_data_dump EXCEPT TABLE aqo_data)
Expand Down
16 changes: 10 additions & 6 deletions sql/update_functions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,23 @@ UNION ALL
--

-- Populate aqo_data with dump data.
SELECT aqo_data_update(fs, fss, nfeatures, features, targets, reliability, oids) AS res
FROM aqo_data_dump
ORDER BY res;
SELECT count(*) AS res1 FROM
aqo_data_dump,
LATERAL aqo_data_update(fs, fss, nfeatures, features, targets, reliability, oids) AS ret
WHERE ret \gset

-- Check if data is the same as in source, no result rows expected.
(TABLE aqo_data_dump EXCEPT TABLE aqo_data)
UNION ALL
(TABLE aqo_data EXCEPT TABLE aqo_data_dump);

-- Update aqo_data with dump data.
SELECT aqo_data_update(fs, fss, nfeatures, features, targets, reliability, oids) AS res
FROM aqo_data_dump
ORDER BY res;
SELECT count(*) AS res2 FROM
aqo_data_dump,
LATERAL aqo_data_update(fs, fss, nfeatures, features, targets, reliability, oids) AS ret
WHERE ret \gset

SELECT :res1 = :res2 AS ml_sizes_are_equal;

-- Check if data is the same as in source, no result rows expected.
(TABLE aqo_data_dump EXCEPT TABLE aqo_data)
Expand Down