bigquery-basics

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

BigQuery Basics

BigQuery基础

BigQuery is a serverless, AI-ready data platform that enables high-speed analysis of large datasets using SQL and Python. Its disaggregated architecture separates compute and storage, allowing them to scale independently while providing built-in machine learning, geospatial analysis, and business intelligence capabilities.
BigQuery是一款无服务器、支持AI的数据平台,可使用SQL和Python对大型数据集进行高速分析。其解耦架构将计算与存储分离,允许二者独立扩展,同时提供内置机器学习、地理空间分析和商业智能功能。

Setup and Basic Usage

设置与基础使用

  1. Enable the BigQuery API:
    bash
    gcloud services enable bigquery.googleapis.com
  2. Create a Dataset:
    bash
    bq mk --dataset --location=US my_dataset
  3. Create a Table:
    Create a file named
    schema.json
    with your table schema:
    json
    [
      {
        "name": "name",
        "type": "STRING",
        "mode": "REQUIRED"
      },
      {
        "name": "post_abbr",
        "type": "STRING",
        "mode": "NULLABLE"
      }
    ]
    Then create the table with the
    bq
    tool:
    bash
    bq mk --table my_dataset.mytable schema.json
  4. Run a Query:
    bash
    bq query --use_legacy_sql=false \
    'SELECT name FROM `bigquery-public-data.usa_names.usa_1910_2013` \
    WHERE state = "TX" LIMIT 10'
  1. 启用BigQuery API:
    bash
    gcloud services enable bigquery.googleapis.com
  2. 创建数据集:
    bash
    bq mk --dataset --location=US my_dataset
  3. 创建表:
    创建一个名为
    schema.json
    的文件,定义您的表结构:
    json
    [
      {
        "name": "name",
        "type": "STRING",
        "mode": "REQUIRED"
      },
      {
        "name": "post_abbr",
        "type": "STRING",
        "mode": "NULLABLE"
      }
    ]
    然后使用
    bq
    工具创建表:
    bash
    bq mk --table my_dataset.mytable schema.json
  4. 运行查询:
    bash
    bq query --use_legacy_sql=false \
    'SELECT name FROM `bigquery-public-data.usa_names.usa_1910_2013` \
    WHERE state = "TX" LIMIT 10'

Reference Directory

参考目录

  • Core Concepts: Storage types, analytics workflows, and BigQuery Studio features.
  • CLI Usage: Essential
    bq
    command-line tool operations for managing data and jobs.
  • Client Libraries: Using Google Cloud client libraries for Python, Java, Node.js, and Go.
  • MCP Usage: Using the BigQuery remote MCP server and Gemini CLI extension.
  • Infrastructure as Code: Terraform examples for datasets, tables, and reservations.
  • IAM & Security: Roles, permissions, and data governance best practices.
If you need product information not found in these references, use the Developer Knowledge MCP server
search_documents
tool.
  • 核心概念:存储类型、分析工作流和BigQuery Studio功能。
  • CLI使用:用于管理数据和作业的
    bq
    命令行工具核心操作。
  • 客户端库:使用Google Cloud客户端库进行Python、Java、Node.js和Go开发。
  • MCP使用:使用BigQuery远程MCP服务器和Gemini CLI扩展。
  • 基础设施即代码:用于数据集、表和预留资源的Terraform示例。
  • IAM与安全:角色、权限和数据治理最佳实践。
如果您在这些参考资料中找不到所需的产品信息,请使用开发者知识MCP服务器的
search_documents
工具。

Related Skills

相关技能