You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For non-batched UDFs, the users expect the function to be executed row by row. If exception is thrown, the corresponding row should get a NULL result.
However, due to the current implementation of UDF framework, the actual behavior is: once a function failed, the whole batch will fail and NULLs will be filled for all these rows.
Even worse, this actually produce inconsistent data to downstream, because the behavior depends on how the input data was chunked.
Error message/log
NA
To Reproduce
CREATE FUNCTION divide(n INTEGER) RETURNS FLOAT
LANGUAGE JAVASCRIPT AS $$
export function divide(n) {
if (n === 0) {
throw new Error("Division by zero!");
}
return 100 / n;
}
$$;
CREATE TABLE input (
value INTEGER
);
INSERT INTO input SELECT generate_series(-10, 10);
CREATE MATERIALIZED VIEW result AS
SELECT
value,
divide(value) as result
FROM input
SELECT * from result;
You will see multiple results are null.
Another problem is delete from input doesn't work... Didn't investigate yet, perhaps because of the data inconsistency.
Expected behavior
Only one row is null in the result.
How did you deploy RisingWave?
No response
The version of RisingWave
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
For non-batched UDFs, the users expect the function to be executed row by row. If exception is thrown, the corresponding row should get a
NULL
result.However, due to the current implementation of UDF framework, the actual behavior is: once a function failed, the whole batch will fail and
NULL
s will be filled for all these rows.Even worse, this actually produce inconsistent data to downstream, because the behavior depends on how the input data was chunked.
Error message/log
NA
To Reproduce
You will see multiple results are
null
.Another problem is
delete from input
doesn't work... Didn't investigate yet, perhaps because of the data inconsistency.Expected behavior
Only one row is null in the result.
How did you deploy RisingWave?
No response
The version of RisingWave
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: