mirror of https://github.com/citusdata/citus.git
Add input validation testing for mark_aggregate_for_distributed_execution
parent
005b4d00f7
commit
205f48f432
|
@ -392,6 +392,13 @@ FROM colocation_table ct
|
||||||
JOIN cojoin_table jt ON ct.id = jt.id
|
JOIN cojoin_table jt ON ct.id = jt.id
|
||||||
GROUP BY ct.val ORDER BY ct.val;
|
GROUP BY ct.val ORDER BY ct.val;
|
||||||
ERROR: unsupported aggregate function sum2
|
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');
|
SELECT mark_aggregate_for_distributed_execution('function_tests2.sum2(int)', 'combine');
|
||||||
mark_aggregate_for_distributed_execution
|
mark_aggregate_for_distributed_execution
|
||||||
------------------------------------------
|
------------------------------------------
|
||||||
|
|
|
@ -237,6 +237,10 @@ FROM colocation_table ct
|
||||||
JOIN cojoin_table jt ON ct.id = jt.id
|
JOIN cojoin_table jt ON ct.id = jt.id
|
||||||
GROUP BY ct.val ORDER BY ct.val;
|
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 mark_aggregate_for_distributed_execution('function_tests2.sum2(int)', 'combine');
|
||||||
SELECT ct.val, function_tests2.sum2(ct.id + jt.val)
|
SELECT ct.val, function_tests2.sum2(ct.id + jt.val)
|
||||||
FROM colocation_table ct
|
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)', '$-10');
|
||||||
SELECT create_distributed_function('add_with_param_names(int, int)', '$3');
|
SELECT create_distributed_function('add_with_param_names(int, int)', '$3');
|
||||||
SELECT create_distributed_function('add_with_param_names(int, int)', '$1a');
|
SELECT create_distributed_function('add_with_param_names(int, int)', '$1a');
|
||||||
|
|
||||||
-- non existing column name
|
-- non existing column name
|
||||||
SELECT create_distributed_function('add_with_param_names(int, int)', 'aaa');
|
SELECT create_distributed_function('add_with_param_names(int, int)', 'aaa');
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue