Created
April 19, 2018 01:59
-
-
Save heartonbit/80e781b0ca3248eed429e4a27cf5e31c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TEMPORARY FUNCTION do(x float64, y float64) | |
RETURNS float64 | |
LANGUAGE js AS """ | |
function add(a, b) { | |
return a + b; | |
} | |
return add(x, y) | |
"""; | |
with data as ( | |
select * | |
from {TABLE_NAME} | |
limit 1 offset 0 | |
) | |
select do(t1.value, t2.value) cos_dist | |
from data t1 | |
cross join data t2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment