Add input validation testing for mark_aggregate_for_distributed_execution

fix_120_custom_aggregates_distribute_multiarg
Philip Dubé 2019-10-18 20:42:47 +00:00
parent 005b4d00f7
commit 205f48f432
2 changed files with 11 additions and 1 deletions

View File

@ -392,6 +392,13 @@ FROM colocation_table ct
JOIN cojoin_table jt ON ct.id = jt.id
GROUP BY ct.val ORDER BY ct.val;
ERROR: unsupported aggregate function sum2
-- First test 3 erroneous inputs
SELECT mark_aggregate_for_distributed_execution(NULL, 'none');
ERROR: the first parameter for mark_aggregate_for_distributed_execution() should be a single a valid function or procedure name followed by a list of parameters in parantheses
SELECT mark_aggregate_for_distributed_execution('function_tests2.sum2(int)', NULL);
ERROR: mark_aggregate_for_distributed_execution expects a strategy that is one of: 'none', 'combine', 'commute'
SELECT mark_aggregate_for_distributed_execution('function_tests2.sum2(int)', 'asdf');
ERROR: mark_aggregate_for_distributed_execution expects a strategy that is one of: 'none', 'combine', 'commute'
SELECT mark_aggregate_for_distributed_execution('function_tests2.sum2(int)', 'combine');
mark_aggregate_for_distributed_execution
------------------------------------------

View File

@ -237,6 +237,10 @@ FROM colocation_table ct
JOIN cojoin_table jt ON ct.id = jt.id
GROUP BY ct.val ORDER BY ct.val;
-- First test 3 erroneous inputs
SELECT mark_aggregate_for_distributed_execution(NULL, 'none');
SELECT mark_aggregate_for_distributed_execution('function_tests2.sum2(int)', NULL);
SELECT mark_aggregate_for_distributed_execution('function_tests2.sum2(int)', 'asdf');
SELECT mark_aggregate_for_distributed_execution('function_tests2.sum2(int)', 'combine');
SELECT ct.val, function_tests2.sum2(ct.id + jt.val)
FROM colocation_table ct
@ -288,7 +292,6 @@ SELECT create_distributed_function('add_with_param_names(int, int)', '$-1');
SELECT create_distributed_function('add_with_param_names(int, int)', '$-10');
SELECT create_distributed_function('add_with_param_names(int, int)', '$3');
SELECT create_distributed_function('add_with_param_names(int, int)', '$1a');
-- non existing column name
SELECT create_distributed_function('add_with_param_names(int, int)', 'aaa');