Membuat kueri set data publik dengan Google Cloud konsol
Pelajari cara menemukan dan membuat kueri set data publik di BigQuery menggunakan Google Cloud konsol.
Untuk mengikuti panduan langkah demi langkah tugas ini langsung di Google Cloud konsol, klik Pandu saya:
Sebelum memulai
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that you have the following role or roles on the project: BigQuery Job User, Service Usage Admin
Check for the roles
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
-
In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.
- For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.
Grant the roles
-
In the Google Cloud console, go to the IAM page.
Buka IAM - Pilih project.
- Klik Berikan akses.
-
Di kolom Akun utama baru, masukkan ID pengguna Anda. Biasanya berupa alamat email untuk Akun Google.
- Di daftar Pilih peran, pilih peran.
- Untuk memberikan peran tambahan, klik Tambahkan peran lain, lalu tambahkan setiap peran tambahan.
- Klik Simpan.
-
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that you have the following role or roles on the project: BigQuery Job User, Service Usage Admin
Check for the roles
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
-
In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.
- For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.
Grant the roles
-
In the Google Cloud console, go to the IAM page.
Buka IAM - Pilih project.
- Klik Berikan akses.
-
Di kolom Akun utama baru, masukkan ID pengguna Anda. Biasanya berupa alamat email untuk Akun Google.
- Di daftar Pilih peran, pilih peran.
- Untuk memberikan peran tambahan, klik Tambahkan peran lain, lalu tambahkan setiap peran tambahan.
- Klik Simpan.
-
-
Make sure that billing is enabled for your Google Cloud project.
Pastikan BigQuery API diaktifkan.
Jika Anda membuat project baru, BigQuery API akan otomatis diaktifkan.
Jika Anda tidak mengaktifkan penagihan untuk Google Cloud project yang digunakan dalam tutorial ini, Anda harus mengupload dan menangani data di sandbox BigQuery. Sandbox BigQuery memungkinkan Anda mempelajari BigQuery dengan sekumpulan fitur terbatas BigQuery tanpa biaya.
Membuka set data publik
Set data publik BigQuery tersedia secara default di Google Cloud konsol.
Pada contoh berikut, Anda mengakses set data di project publik
bigquery-public-data
.
Di konsol Google Cloud , buka halaman BigQuery.
Di panel Explorer, klik
+Tambahkan data .Dalam dialog Tambahkan data, di panel Filter Menurut, klik
Set data publik.
Anda dapat menggunakan kolom Telusuri Marketplace atau filter untuk mempersempit penelusuran.
Pilih set data, lalu klik Tampilkan set data.
Di panel Explorer, set data Anda dipilih dan Anda dapat melihat detailnya.
Opsional: Klik
Tampilkan tindakan di samping set data Anda untuk melihat opsi lainnya.Setiap set data berisi tabel yang dapat Anda lihat dengan mengklik
Aktifkan node di samping set data mana pun.
Membuat kueri set data publik
Pada langkah-langkah berikut, Anda akan membuat kueri set data publik Nama AS untuk menentukan nama-nama yang paling umum di Amerika Serikat antara tahun 1910 dan 2013:
Di konsol Google Cloud , buka halaman BigQuery.
Klik
SQL query .Di
editor kueri , salin kueri berikut:SELECT name, SUM(number) AS total FROM `bigquery-public-data.usa_names.usa_1910_2013` GROUP BY name ORDER BY total DESC LIMIT 10;
Jika kueri valid, tanda centang akan muncul bersama dengan jumlah data yang diproses kueri. Jika kueri tidak valid, tanda seru akan muncul bersama dengan pesan error.
Klik
Jalankan .Nama yang paling umum tercantum di bagian Hasil kueri. Baris header tabel berisi setiap nama kolom yang Anda pilih dalam kueri.
Opsional: Untuk menampilkan durasi dan jumlah data yang diproses kueri, klik tab Informasi tugas di
Hasil kueri .
Pembersihan
Agar akun Google Cloud Anda tidak dikenai biaya untuk resource yang digunakan pada halaman ini, ikuti langkah-langkah berikut.
Menghapus project
Jika Anda menggunakan sandbox BigQuery untuk meng-kueri set data publik, penagihan tidak akan diaktifkan untuk project Anda.
Cara termudah untuk menghilangkan penagihan adalah dengan menghapus project yang Anda buat untuk tutorial.
Untuk menghapus project:
- In the Google Cloud console, go to the Manage resources page.
- In the project list, select the project that you want to delete, and then click Delete.
- In the dialog, type the project ID, and then click Shut down to delete the project.
Langkah berikutnya
- Pelajari sandbox BigQuery.
- Pelajari cara membuat set data dan tabel kueri di Google Cloud konsol.
- Dapatkan info terbaru tentang BigQuery.
- Pelajari tentang harga BigQuery.
- Pelajari kuota dan batas BigQuery.