3.5. Scripting

BigQuery standard SQL supports query jobs where the query text is a script. A script can include one or more SQL statements and additional logic. This is documented at https://cloud.google.com/bigquery/docs/reference/standard-sql/scripting.

In terms of metadata, BigQuery represents a query job with scripting as one parent job and a child job for each of the SQL statements in the script. Because both a parent job and child jobs can appear in metadata, care should be taken to avoid double counting metrics when aggregating.

Fields to expect in the metadata for a scripting parent job are listed below.

Each scripting child job will contain the set of fields it would contain if it were not part of a script. Fields to expect in the metadata for a scripting child job are listed below.

See links below for references.