Switching from legacy to standard, is there a standard function to convert values into radian, similar to legacy?
Typically, I would use radian() within legacy SQL, but that function doesn't exist within standard.
Join Stack Overflow to learn, share knowledge, and build your career.
Switching from legacy to standard, is there a standard function to convert values into radian, similar to legacy?
Typically, I would use radian() within legacy SQL, but that function doesn't exist within standard.
CREATE TEMP FUNCTION RADIANS(x FLOAT64) AS (
ACOS(-1) * x / 180
);
SELECT RADIANS(37); -- returns 0.6457718232379019
As a shared UDF you can use right now, fhoffa.x.radians():
SELECT fhoffa.x.radians(180)
3.141592653589793
How-to for persistent UDFs: