Reputation: 29
Scenario:
As I understand, UDFs are executed once per value. So if I have a column C1 which has 100 values, UDF will be called 100 times. So this should be good amount of compute happening in BQ.
Questions
Ideally, we would want project B to have this cost. As these UDFs will be accessed by multiple compute projects and Project A should not bear the cost.
Upvotes: 0
Views: 38
Reputation: 75940
The compute is done on the project B, the project which runs the query.
The cost is more "complex". In any case, it's never paid by the project A!
This answer applies only for UDF. For Remote UDF, it's different. Remote UDF is a Cloud Run Functions (or a Cloud Run Service) which will process the BigQuery row. The BigQuery job will send chunks of row to the remote UDF to process them.
Because the remote UDF will use CPU and Memory when it runs, it's the project which hosts those remote UDF that will pay for them
Upvotes: 1