Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Visualização de ATRIBUIÇÕES
A visualização INFORMATION_SCHEMA.ASSIGNMENTS contém uma lista quase em tempo real de todas
as atribuições atuais no projeto de administração. Cada linha representa uma única atribuição atual. Uma atribuição atual está pendente ou ativa e não foi excluída. Para mais informações sobre reservas, consulte Introdução às reservas.
Permissão necessária
Para consultar a visualização INFORMATION_SCHEMA.ASSIGNMENTS, é preciso ter a permissão bigquery.reservationAssignments.list Identity and Access Management (IAM) para o
projeto.
Cada um dos seguintes papéis predefinidos do IAM inclui a
permissão necessária:
A visualização INFORMATION_SCHEMA.ASSIGNMENTS tem o seguinte esquema:
Nome da coluna
Tipo de dados
Valor
ddl
STRING
A instrução DDL usada para criar esta atribuição.
project_id
STRING
ID do projeto de administração.
project_number
INTEGER
Número do projeto de administração.
assignment_id
STRING
Código que identifica exclusivamente a atribuição.
reservation_name
STRING
Nome da reserva que a atribuição usa.
job_type
STRING
O tipo de job que pode usar a reserva. Pode ser
PIPELINE, QUERY, CONTINUOUS,
ML_EXTERNAL ou BACKGROUND.
assignee_id
STRING
Código que identifica exclusivamente o recurso do usuário.
assignee_number
INTEGER
Número que identifica exclusivamente o recurso atribuído.
assignee_type
STRING
Tipo de recurso atribuído. Pode ser organization, folder ou project.
Escopo e sintaxe
As consultas nessa visualização precisam incluir um
qualificador de região.
Se você não especificar um qualificador regional, os metadados serão recuperados de todas as
regiões. A tabela a seguir explica o escopo da região dessa visualização:
PROJECT_ID: o ID do projeto ao qual você atribuiu
reservas.
REGION_NAME: o nome da região.
Por exemplo, `myproject`.`region-us`.INFORMATION_SCHEMA.ASSIGNMENTS
O exemplo a seguir recebe a reserva atualmente atribuída e a respectiva
capacidade de slot. Essas informações são úteis para depurar o desempenho do job comparando o uso do slot do projeto com a capacidade do slot da reserva atribuída a ele.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-04 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eINFORMATION_SCHEMA.ASSIGNMENTS\u003c/code\u003e view provides a real-time list of all current, non-deleted assignments within the administration project.\u003c/p\u003e\n"],["\u003cp\u003eQuerying this view requires the \u003ccode\u003ebigquery.reservationAssignments.list\u003c/code\u003e IAM permission, which is included in several predefined roles like \u003ccode\u003eroles/bigquery.resourceAdmin\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eEach row in the view represents a single assignment and contains details such as \u003ccode\u003eassignment_id\u003c/code\u003e, \u003ccode\u003ereservation_name\u003c/code\u003e, \u003ccode\u003ejob_type\u003c/code\u003e, and \u003ccode\u003eassignee_id\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eQueries against this view must include a region qualifier to specify the region from which metadata is retrieved, such as \u003ccode\u003eregion-us\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe view is useful for comparing a project's current slot usage against the slot capacity of its assigned reservation, by showing information such as the \u003ccode\u003ereservation_name\u003c/code\u003e and \u003ccode\u003eslot_capacity\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# ASSIGNMENTS view\n================\n\nThe `INFORMATION_SCHEMA.ASSIGNMENTS` view contains a near real-time list of all\ncurrent assignments within the administration project. Each row represents a\nsingle, current assignment. A current assignment is either pending or active and\nhas not been deleted. For more information about reservation, see [Introduction\nto Reservations](/bigquery/docs/reservations-intro).\n\nRequired permission\n-------------------\n\nTo query the `INFORMATION_SCHEMA.ASSIGNMENTS` view, you need the\n`bigquery.reservationAssignments.list` Identity and Access Management (IAM) permission for\nthe project.\nEach of the following predefined IAM roles includes the required\npermission:\n\n- `roles/bigquery.resourceAdmin`\n- `roles/bigquery.resourceEditor`\n- `roles/bigquery.resourceViewer`\n- `roles/bigquery.user`\n- `roles/bigquery.admin`\n\nFor more information about BigQuery permissions, see\n[Access control with IAM](/bigquery/docs/access-control).\n\nSchema\n------\n\nThe `INFORMATION_SCHEMA.ASSIGNMENTS` view has the following\nschema:\n\nScope and syntax\n----------------\n\nQueries against this view must include a [region qualifier](/bigquery/docs/information-schema-intro#syntax).\nIf you do not specify a regional qualifier, metadata is retrieved from all\nregions. The following table explains the region scope for this view:\n\nReplace the following:\n\n- Optional: \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your Google Cloud project. If not specified, the default project is used.\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: any [dataset region name](/bigquery/docs/locations). For example, ```region-us```.\n\n \u003cbr /\u003e\n\n \u003cbr /\u003e\n\n | **Note:** You must use [a region qualifier](/bigquery/docs/information-schema-intro#region_qualifier) to query `INFORMATION_SCHEMA` views. The location of the query execution must match the region of the `INFORMATION_SCHEMA` view.\n\n\u003cbr /\u003e\n\nExample\n-------\n\nTo run the query against a project other than your default project, add the\nproject ID in the following format: \n\n```bash\n`PROJECT_ID`.`region-REGION_NAME`.INFORMATION_SCHEMA.ASSIGNMENTS\n```\n.\n\n\u003cbr /\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of the project to which you have assigned reservations.\n- \u003cvar translate=\"no\"\u003eREGION_NAME\u003c/var\u003e: the name of the region.\n\nFor example, ```myproject`.`region-us`.INFORMATION_SCHEMA.ASSIGNMENTS``.\n\nThe following example gets a project's currently assigned reservation and its\nslot capacity. This information is useful for debugging job performance by\ncomparing the project's slot usage with the slot capacity of the reservation\nassigned to that project. \n\n```googlesql\nSELECT\n reservation.reservation_name,\n reservation.slot_capacity\nFROM\n `\u003cvar translate=\"no\"\u003eRESERVATION_ADMIN_PROJECT\u003c/var\u003e.region-\u003cvar translate=\"no\"\u003eREGION_NAME\u003c/var\u003e`.\n INFORMATION_SCHEMA.ASSIGNMENTS_BY_PROJECT assignment\nINNER JOIN\n `\u003cvar translate=\"no\"\u003eRESERVATION_ADMIN_PROJECT\u003c/var\u003e.region-\u003cvar translate=\"no\"\u003eREGION_NAME\u003c/var\u003e`.\n INFORMATION_SCHEMA.RESERVATIONS_BY_PROJECT AS reservation\nON\n (assignment.reservation_name = reservation.reservation_name)\nWHERE\n assignment.assignee_id = \"\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e\"\n AND job_type = \"QUERY\";\n```"]]