모든 BigQuery 코드 샘플

Client: Create credentials with scopes

Create credentials with Drive and BigQuery API scopes.

View in documentation

Client: Create with application default credentials

Create a BigQuery client using application default credentials.

View in documentation

Client: Create with service account key file

Create a BigQuery client using a service account key file.

Customer-managed Encryption Keys: Copy table

Copy a table with customer-managed encryption keys.

View in documentation

Customer-managed Encryption Keys: Create table

Create a table with customer-managed encryption keys.

View in documentation

Customer-managed Encryption Keys: Load table

Load a table with customer managed encryption keys to Google Cloud Storage in JSON format.

View in documentation

Customer-managed Encryption Keys: Query table

Query a table with customer-managed encryption keys.

View in documentation

Customer-managed Encryption Keys: Update table

Update a table with customer-managed encryption keys.

View in documentation

Datasets: Check dataset existence

A function to check whether a dataset exists.

Datasets: Delete dataset

Delete a dataset from a project.

Datasets: Delete dataset and contents

Delete a dataset and its contents from a project.

Datasets: Delete label

Remove a label from a dataset.

View in documentation

Datasets: Get dataset labels

Retrieve the labels of a dataset for a given dataset ID.

View in documentation

Datasets: Get dataset properties

Retrieve the properties of a dataset.

Datasets: List by label

List datasets, filtering by labels.

View in documentation

Datasets: List datasets

Lists all existing datasets in a project.

Datasets: Update default partition expiration

Datasets: Update default table expiration times

Updates dataset's default table expiration times.

View in documentation

Datasets: Update description

Update the description of an existing dataset resource.

Datasets: Update label

Update an existing label on a dataset.

Jobs: Cancel job

Attempt to cancel a job.

View in documentation

Jobs: Create job

Run a BigQuery (query, load, extract, copy) job in a specified location with additional configuration.

View in documentation

Jobs: Get job properties

Retrieve the properties of a job for a given job ID.

View in documentation

Jobs: List jobs

List all jobs in a project.

View in documentation

Load: Avro

Load Avro file from Google Cloud Storage into a new table.

View in documentation

Load: Avro, replace table

Load Avro file from Google Cloud Storage, replacing existing table data.

View in documentation

Load: CSV

Load CSV from Google Cloud Storage, using an explicit schema.

Load: CSV, autodetect schema

Load CSV file from Google Cloud Storage, using autodetected schema.

Load: CSV, replace table

Load CSV file from Google Cloud Storage, replacing a table.

View in documentation

Load: Clustered table

Load data from a CSV file on Google Cloud Storage to a clustered table.

View in documentation

Load: Column-based time partitioning

Load data into a table that uses column-based time partitioning.

Load: JSON

Loads JSON file from Google Cloud Storage, using an explicit schema.

Load: JSON, autodetect schema

Load JSON file from Google Cloud Storage, using autodetect schema.

View in documentation

Load: JSON, replace table

Load JSON file from Google Cloud Storage, replacing a table.

View in documentation

Load: ORC

Load ORC file from Google Cloud Storage into a new table.

View in documentation

Load: ORC, replace table

Load ORC file from Google Cloud Storage, replacing a table.

View in documentation

Load: Parquet

Load Parquet file from Google Cloud Storage into a new table.

Load: Parquet, replace

Load Parquet file from Google Cloud Storage, replacing a table.

Load: Relax column, append

Change column from required to nullable in load append job.

View in documentation

Models: Create model

Create a model within an existing dataset.

Models: Delete model

Delete a model from a dataset.

View in documentation

Models: Get model

Get a model resource for a given model ID.

View in documentation

Models: List models

Lists all existing models in a dataset.

View in documentation

Models: List models, streaming

Lists all existing models in the dataset using streaming method.

Models: Update description

Update a model's description property for a given model ID.

View in documentation

Pandas: Download public table data to DataFrame

Use the BigQuery Storage API to speed-up downloads of large tables to DataFrame.

Pandas: Download public table data to DataFrame from sandbox

Use the BigQuery Storage API to download query results to DataFrame.

Pandas: Download query results to DataFrame

Get query results as a Pandas DataFrame.

Pandas: Download table data to DataFrame

Pandas: Load data from DataFrame

Load contents of a pandas DataFrame to a table.

Query Parameters: ARRAY

Run a query with array parameters.

View in documentation

Query Parameters: Named

Run a query with named parameters.

View in documentation

Query Parameters: Named, provided types

Run a query with named parameters and provided parameter types.

Query Parameters: Positional

Run a query with positional parameters.

View in documentation

Query Parameters: Positional, provided types

Run a query with positional parameters and provided parameter types.

Query Parameters: STRUCT

Run a query with struct parameters.

View in documentation

Query Parameters: TIMESTAMP

Run a query with timestamp parameters.

View in documentation

Query: Batch priority

Query runs at batch priority.

Query: Clustered table

Query a clustered table.

View in documentation

Query: Column-based time partitioning

Query a table that uses column-based time partitioning.

Query: Disable query cache

Query disables the use of the cache.

View in documentation

Query: Download results to Arrow

Run a query and get Arrow table.

Query: Enable large results

Query enables large result sets using legacy SQL.

View in documentation

Query: External Cloud Storage, permanent table

Query data from a file on Google Cloud Storage by creating a permanent table.

View in documentation

Query: External Cloud Storage, temporary table

Query data from a file on Google Cloud Storage by creating a temporary table.

View in documentation

Query: External Sheets, permanent table

Query data from a Google Sheets file by creating a permanent table.

View in documentation

Query: External Sheets, temporary table

Query data from a Google Sheets file by creating a temporary table.

View in documentation

Query: Legacy SQL

Runs a query with legacy SQL.

View in documentation

View in documentation

Query: Relax column, append

Change column from required to nullable in query append job.

View in documentation

Query: Save query results

Query saves results to permanent table.

Query: Script

Run query script.

Query: Total rows

Run a query and get total rows.

Query: Write to destination table

Tutorial for running a query on the natality public dataset and writing the results to a destination table.

Quickstart: Create a dataset with the BigQuery API

Creates a dataset named "my_new_dataset".

Quickstart: Query with the BigQuery API

Create a simple app with BigQuery.

Quickstart: Read from the BigQuery Storage API

Read data from a table via read stream.

Routines: Create routine

Create a routine within an existing dataset.

Routines: Create routine with DDL

Routines: Delete routine

Delete a routine from a dataset.

Routines: Get routine

Get a routine resource for a given routine ID.

Routines: List routines

Lists all existing routines in a dataset.

Routines: Update routine

Update an existing routine resource.

Set user agent

Set a custom user agent on a BigQuery client

Tables: Add column via load job

Add a new column to a BigQuery table while appending rows via a load job.

View in documentation

Tables: Add column via query job

Add a new column to a BigQuery table while appending rows via a query job with an explicit destination table.

View in documentation

Tables: Add empty column

Manually add an empty column.

View in documentation

Tables: Add label

Add a label to a table.

Tables: Column-based time partitioning

Create a table that uses column-based time partitioning.

Tables: Copy multiple tables

Copy multiple source tables to a given destination.

View in documentation

Tables: Copy table

Copy a single source table to a given destination.

Tables: Create clustered table

View in documentation

Tables: Create integer range partitioned table

Create a new integer range partitioned table in an existing dataset.

Tables: Delete label

Remove a label from a table.

View in documentation

Tables: Export table to Cloud Storage, CSV

Exports a table to CSV file in Google Cloud Storage bucket.

Tables: Export table to Cloud Storage, JSON

Exports a table to newline delimited JSON file to Google Cloud Storage bucket.

Tables: Export table to Cloud Storage, compressed

Exports a table to a compressed file in Google Cloud Storage bucket.

View in documentation

Tables: Get table labels

Retrieve the labels of a table for a given table ID.

View in documentation

Tables: Get table properties

Retrieve the properties of a table for a given table ID.

Tables: Insert, no IDs

Insert rows without row IDs in a table.

View in documentation

Tables: Nested repeated schema

Specifying nested and repeated columns in schema.

Tables: Preview table data

Retrieve selected row data from a table.

Tables: Relax column

Change columns from required to nullable.

View in documentation

Tables: Streaming insert

Inserts simple rows into a table via the streaming API (insertAll).

Tables: Streaming insert with complex data types

Insert data of various BigQuery-supported types into a table.

Tables: Table exists

A function to check whether a table exists.

Tables: Undelete

Undelete a table.

View in documentation

Tables: Update expiration

Update a table's expiration time.

Tables: Update require partition filter

Update require partition filter on a table.

Tutorial: Create an Authorized View

Create an authorized view using GitHub public data.

View in documentation

Views: Create view

Create a view within a dataset.

View in documentation

Views: Create view with DDL

Create a view via a DDL query.

Views: Get view properties

Retrieve the properties of a view for a given view ID.

View in documentation

Views: Grant view access

Authorize and grant access to a view.

View in documentation

Views: Update query

Update a view's query.

View in documentation