Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Tampilan ASSIGNMENTS
Tampilan INFORMATION_SCHEMA.ASSIGNMENTS berisi daftar semua tugas saat ini dalam project administrasi yang mendekati real-time. Setiap baris mewakili satu tugas saat ini. Tugas saat ini sedang tertunda atau aktif dan
belum dihapus. Untuk mengetahui informasi selengkapnya tentang reservasi, lihat Pengantar
Pemesanan.
Izin yang diperlukan
Untuk membuat kueri tampilan INFORMATION_SCHEMA.ASSIGNMENTS, Anda memerlukan izin Identity and Access Management (IAM) bigquery.reservationAssignments.list untuk project tersebut.
Setiap peran IAM yang telah ditetapkan berikut menyertakan izin yang diperlukan:
Tampilan INFORMATION_SCHEMA.ASSIGNMENTS memiliki skema berikut:
Nama kolom
Jenis data
Nilai
ddl
STRING
Pernyataan DDL yang digunakan untuk membuat tugas ini.
project_id
STRING
ID project administrasi.
project_number
INTEGER
Jumlah project administrasi.
assignment_id
STRING
ID yang secara unik mengidentifikasi tugas.
reservation_name
STRING
Nama pemesanan yang digunakan tugas.
job_type
STRING
Jenis tugas yang dapat menggunakan pemesanan. Dapat berupa
PIPELINE, QUERY, CONTINUOUS,
ML_EXTERNAL, atau BACKGROUND.
assignee_id
STRING
ID yang secara unik mengidentifikasi resource penerima tugas.
assignee_number
INTEGER
Angka yang secara unik mengidentifikasi resource penerima tugas.
assignee_type
STRING
Jenis resource penerima tugas. Dapat berupa organization,
folder, atau project.
Cakupan dan sintaksis
Kueri terhadap tabel virtual ini harus menyertakan penentu region.
Jika Anda tidak menentukan penentu regional, metadata akan diambil dari semua region. Tabel berikut menjelaskan cakupan region untuk tabel virtual ini:
Contoh berikut mendapatkan pemesanan yang saat ini ditetapkan pada project dan
kapasitas slotnya. Informasi ini berguna untuk men-debug performa tugas dengan
membandingkan penggunaan slot project dengan kapasitas slot pemesanan
yang ditetapkan untuk project tersebut.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-17 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```"]]