Reputation: 31
I wrote a User Defined function in BigQuery SQL and the documentation doesn't show how to view an existing function code. In other engines, the sintax is something like SHOW FUNCTION ... but that doesn't work here.
Thanks.
Upvotes: 1
Views: 1441
Reputation: 800
You can try to use INFORMATION_SCHEMA views to view the source code and other parameters of the UDF:
#standardSQL
select *
from <project_id>.<dataset_name>.INFORMATION_SCHEMA.ROUTINES;
Pay attention to the location of your UDF, because INFROMATION_SCHEMA
view results depend on the location of objects.
Upvotes: 2
Reputation: 709
You can create function as below :-
CREATE FUNCTION `project.dataset.Function`(x INT64) AS (x * 3);
Use of function will be as :-
select `project.dataset.Function` (Coll) from `project.dataset.Table`
To view function you need to click on function on dataset, you will get entire code.
Upvotes: 1