Nạp dữ liệu vào BigQuery

Giới thiệu về BigQuery

Matt Forrest

Field CTO

Cách nạp dữ liệu

  1. Nạp dữ liệu trong BigQuery Studio
  2. Dùng dòng lệnh bq
  3. Dùng lệnh LOAD DATA trong SQL
Giới thiệu về BigQuery

Dùng BigQuery Studio

Giao diện nạp dữ liệu trong BigQuery

Giới thiệu về BigQuery

Dùng BigQuery Studio

Giao diện nạp dữ liệu trong BigQuery

Giới thiệu về BigQuery

Dùng BigQuery Studio

Giao diện nạp dữ liệu trong BigQuery

Giới thiệu về BigQuery

Dùng công cụ dòng lệnh bq

Ví dụ dùng dòng lệnh bq

bq load \
    dataset.table \

gs://mybucket/mydata.csv \
--source_format=CSV \ --autodetect
1 https://cloud.google.com/bigquery/docs/bq-command-line-tool#loading_data
Giới thiệu về BigQuery

Dùng LOAD DATA trong SQL

Ví dụ câu lệnh LOAD DATA:

LOAD DATA INTO dataset.table

FROM FILES( uris = ['gs://mybucket/mydata.csv']
format='CSV', skip_leading_rows=1 )
Giới thiệu về BigQuery

Lưu ý khi nạp dữ liệu

Dùng LOAD DATA

  1. Không dùng dữ liệu cục bộ.
  2. Chịu giới hạn tải dữ liệu.

Dùng bq và BigQuery Studio

  1. Có thể dùng dữ liệu cục bộ, nhưng tệp phải < 100 MB.
  2. Chịu giới hạn tải dữ liệu.
1 https://cloud.google.com/bigquery/quotas#load_jobs
Giới thiệu về BigQuery

Ayo berlatih!

Giới thiệu về BigQuery

Preparing Video For Download...