JOBS_BY_FOLDER view
The INFORMATION_SCHEMA.JOBS_BY_FOLDER view contains near real-time metadata
about all jobs submitted in the parent folder of the current project, including
the jobs in subfolders under it.
Required role
    
      To get the permission that
      you need to query the INFORMATION_SCHEMA.JOBS_BY_FOLDER view,
    
      ask your administrator to grant you the
    
  
  
    
      BigQuery Resource Viewer  (roles/bigquery.resourceViewer)
     IAM role on your parent folder.
  
  
  
  
  For more information about granting roles, see Manage access to projects, folders, and organizations.
  
  
      
        This predefined role contains the
         bigquery.jobs.listAll
        permission,
         which is required to
        query the INFORMATION_SCHEMA.JOBS_BY_FOLDER view.
      
    
  
  
    
      
You might also be able to get this permission with custom roles or other predefined roles.
For more information about BigQuery permissions, see Access control with IAM.
Schema
The underlying data is partitioned by the creation_time column and
clustered by project_id and user_email. The query_info column contains
additional information about your query jobs.
The INFORMATION_SCHEMA.JOBS_BY_FOLDER view has the following schema:
| Column name | Data type | Value | 
|---|---|---|
| bi_engine_statistics | RECORD | If the project is configured to use the BI
        Engine, then this field contains BiEngineStatistics.
        Otherwise NULL. | 
| cache_hit | BOOLEAN | Whether the query results of this job were from a cache.
        If you have a multi-query statement
        job, cache_hitfor your parent query isNULL. | 
| creation_time | TIMESTAMP | (Partitioning column) Creation time of this job. Partitioning is based on the UTC time of this timestamp. | 
| destination_table | RECORD | Destination table for results, if any. | 
| end_time | TIMESTAMP | The end time of this job, in milliseconds since the epoch. This field represents the
        time when the job enters the DONEstate. | 
| error_result | RECORD | Details of any errors as ErrorProto objects. | 
| folder_numbers | REPEATED INTEGER | Number IDs of folders that contain the project, starting with the folder that immediately
        contains the project, followed by the folder that contains the child folder, and so forth.
        For example, if folder_numbersis[1, 2, 3], then folder1immediately contains the project, folder2contains1, and folder3contains2. This column is only
        populated inJOBS_BY_FOLDER. | 
| job_creation_reason.code | STRING | Specifies the high level reason why a job was created. Possible values are: 
 | 
| job_id | STRING | The ID of the job if a job was created. Otherwise, the query ID of a query using optional
        job creation mode. For example, bquxjob_1234. | 
| job_stages | RECORD | Query
          stages of the job. Note: This column's values are empty for queries that read from tables with row-level access policies. For more information, see best practices for row-level security in BigQuery. | 
| job_type | STRING | The type of the job. Can be QUERY,LOAD,EXTRACT,COPY, orNULL. ANULLvalue indicates a background
        job. | 
| labels | RECORD | Array of labels applied to the job as key-value pairs. | 
| parent_job_id | STRING | ID of the parent job, if any. | 
| priority | STRING | The priority of this job. Valid values include INTERACTIVEandBATCH. | 
| project_id | STRING | (Clustering column) The ID of the project. | 
| project_number | INTEGER | The number of the project. | 
| query | STRING | SQL query text. Only the JOBS_BY_PROJECTview has the query
      column. | 
| referenced_tables | RECORD | Array of tables referenced by the job. Only populated for query jobs that are not cache hits. | 
| reservation_id | STRING | Name of the primary reservation assigned to this job,
        in the format RESERVATION_ADMIN_PROJECT:RESERVATION_LOCATION.RESERVATION_NAME.In this output: 
 | 
| edition | STRING | The edition associated with the reservation assigned to this job. For more information about editions, see Introduction to BigQuery editions. | 
| session_info | RECORD | Details about the session in which this job ran, if any. | 
| start_time | TIMESTAMP | The start time of this job, in milliseconds since the epoch. This field represents the
        time when the job transitions from the PENDINGstate to eitherRUNNINGorDONE. | 
| state | STRING | Running state of the job. Valid states include PENDING,RUNNING, andDONE. | 
| statement_type | STRING | The type of query statement. For example, DELETE,INSERT,SCRIPT,SELECT, orUPDATE. See QueryStatementType
        for list of valid values. | 
| timeline | RECORD | Query timeline of the job. Contains snapshots of query execution. | 
| total_bytes_billed | INTEGER | If the project is configured to use on-demand
        pricing, then this field contains the total bytes billed for the
        job. If the project is configured to use flat-rate
        pricing, then you are not billed for bytes and this field is
        informational only. Note: This column's values are empty for queries that read from tables with row-level access policies. For more information, see best practices for row-level security in BigQuery. | 
| total_bytes_processed | INTEGER | Total bytes processed by the job. Note: This column's values are empty for queries that read from tables with row-level access policies. For more information, see best practices for row-level security in BigQuery. | 
| total_modified_partitions | INTEGER | The total number of partitions the job modified. This field is
        populated for LOADandQUERYjobs. | 
| total_slot_ms | INTEGER | Slot milliseconds for the job over its entire duration in the RUNNINGstate,
        including retries. | 
| total_services_sku_slot_ms | INTEGER | Total slot milliseconds for the job that runs on external services and is billed on the
        services SKU. This field is only populated for jobs that have external service costs, and is
        the total of the usage for costs whose billing method is "SERVICES_SKU". | 
| transaction_id | STRING | ID of the transaction in which this job ran, if any. (Preview) | 
| user_email | STRING | (Clustering column) Email address or service account of the user who ran the job. | 
| query_info.resource_warning | STRING | The warning message that appears if the resource usage during query processing is above the internal threshold of the system. A successful query job can have the resource_warningfield populated. Withresource_warning, you get additional data points to optimize your queries and to set up monitoring for performance trends of an equivalent set of queries by usingquery_hashes. | 
| query_info.query_hashes.normalized_literals | STRING | Contains the hash value of the query. normalized_literalsis a hexadecimalSTRINGhash that ignores comments, parameter values, UDFs, and literals.
        The hash value will differ when underlying views change, or if the query implicitly
        references columns, such asSELECT *, and the table schema changes.This field appears for successful GoogleSQL queries that are not cache hits. | 
| query_info.performance_insights | RECORD | Performance insights for the job. | 
| query_info.optimization_details | STRUCT | The history-based optimizations
        for the job. Only the JOBS_BY_PROJECTview has this column. | 
| transferred_bytes | INTEGER | Total bytes transferred for cross-cloud queries, such as BigQuery Omni cross-cloud transfer jobs. | 
| materialized_view_statistics | RECORD | Statistics of materialized views considered in a query job. (Preview) | 
| metadata_cache_statistics | RECORD | Statistics for metadata column index usage for tables referenced in a query job. | 
| search_statistics | RECORD | Statistics for a search query. | 
| query_dialect | STRING | This field will be available sometime in May, 2025.
      The query dialect used for the job. Valid values include: 
 This field is only populated for query jobs. The default selection of query dialect can be controlled by the configuration settings. | 
| continuous | BOOLEAN | Whether the job is a continuous query. | 
| continuous_query_info.output_watermark | TIMESTAMP | Represents the point up to which the continuous query has successfully processed data. | 
| vector_search_statistics | RECORD | Statistics for a vector search query. | 
Data retention
This view contains currently running jobs and the job history of the past 180 days.
Scope and syntax
Queries against this view must include a region qualifier. The following table explains the region scope for this view:
| View name | Resource scope | Region scope | 
|---|---|---|
| [PROJECT_ID.]`region-REGION`.INFORMATION_SCHEMA.JOBS_BY_FOLDER | Folder that contains the specified project | REGION | 
- 
  Optional: PROJECT_ID: the ID of your Google Cloud project. If not specified, the default project is used.
- 
  REGION: any dataset region name. For example,`region-us`.