Files
wehub-resource-sync bb5c75ce05
Component Security Validation / Security Audit (push) Has been cancelled
Deploy to Cloudflare Pages / deploy (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:38:58 +08:00

2.2 KiB

BigQuery Client Libraries

Google Cloud client libraries provide an idiomatic way to interact with BigQuery from your preferred programming language.

Getting Started

To use the client libraries, ensure you have the Google Cloud SDK installed and authenticated. Install Google Cloud SDK

Python

  • Installation:

    pip install --upgrade google-cloud-bigquery
    
  • Usage Example:

    from google.cloud import bigquery
    client = bigquery.Client()
    query_job = client.query("SELECT * FROM `project.dataset.table` LIMIT 10")
    results = query_job.result()
    
  • Python Reference

Java

  • Maven Dependency:

    <dependency>
      <groupId>com.google.cloud</groupId>
      <artifactId>google-cloud-bigquery</artifactId>
    </dependency>
    
  • Usage Example:

    BigQuery bigquery = BigQueryOptions.getDefaultInstance().getService();
    QueryJobConfiguration queryConfig = QueryJobConfiguration.newBuilder(
        "SELECT * FROM dataset.table").build();
    TableResult results = bigquery.query(queryConfig);
    
  • Java Reference

Node.js (TypeScript)

  • Installation:

    npm install @google-cloud/bigquery
    
  • Usage Example:

    import {BigQuery} from '@google-cloud/bigquery';
    const bigquery = new BigQuery();
    const [rows] = await bigquery.query('SELECT * FROM dataset.table');
    
  • Node.js Reference

Go

  • Installation:

    go get cloud.google.com/go/bigquery
    
  • Usage Example:

    ctx := context.Background()
    client, _ := bigquery.NewClient(ctx, "project-id")
    q := client.Query("SELECT * FROM dataset.table")
    it, _ := q.Read(ctx)
    
  • Go Reference

BigQuery DataFrames (BigFrames)

For Python users, bigframes provides a pandas-like API that executes directly in BigQuery.

pip install --upgrade bigframes