Created
September 23, 2020 14:21
-
-
Save chrisgoddard/18d19614714253d8e0646207a103616b to your computer and use it in GitHub Desktop.
BigQuery Custom UDFs
This file contains hidden or 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 or replace function dataset.array_int_least(x array<int64>) as | |
((select min(y) from unnest(x) as y)); | |
create or replace function dataset.array_int_greatest(x array<int64>) as | |
((select max(y) from unnest(x) as y)); | |
create or replace function dataset.array_timestamp_least(x array<timestamp>) as | |
((select min(y) from unnest(x) as y)); | |
create or replace function dataset.array_timestamp_greatest(x array<timestamp>) as | |
((select max(y) from unnest(x) as y)); | |
create or replace function dataset.array_date_least(x array<date>) as | |
((select min(y) from unnest(x) as y)); | |
create or replace function dataset.array_date_greatest(x array<date>) as | |
((select max(y) from unnest(x) as y)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment