# WARNING: This definition is not intended to be useful! create or replace function divide_or_error(x, y) as ( with xy as (select x/y as xy) select if (xy IN ('-Infinity', 'Infinity') or xy IS NULL, error(format('division by zero: {}/{}',x,y)), xy) from xy );