Quay lại bộ đề
Question #189 Topic 1
You need to create a SQL pipeline. The pipeline runs an aggregate SQL transformation on a BigQuery table every two hours and appends the result to another existing BigQuery table. You need to configure the pipeline to retry if errors occur. You want the pipeline to send an email notification after three consecutive failures. What should you do?
Bạn cần tạo một pipeline SQL. Pipeline này chạy một phép biến đổi SQL tổng hợp trên một bảng BigQuery cứ sau mỗi hai giờ và nối thêm (append) kết quả vào một bảng BigQuery khác hiện có. Bạn cần cấu hình pipeline để thử lại (retry) nếu xảy ra lỗi. Bạn muốn pipeline gửi thông báo qua email sau ba lần thất bại liên tiếp. Bạn nên làm gì?
A
Use the BigQueryUpsertTableOperator in Cloud Composer, set the retry parameter to three, and set the email_on_failure parameter to true.
Sử dụng BigQueryUpsertTableOperator trong Cloud Composer, đặt tham số retry thành ba và đặt tham số email_on_failure thành true.
B
Use the BigQueryInsertJobOperator in Cloud Composer, set the retry parameter to three, and set the email_on_failure parameter to true.
Sử dụng BigQueryInsertJobOperator trong Cloud Composer, đặt tham số retry thành ba và đặt tham số email_on_failure thành true.
C
Create a BigQuery scheduled query to run the SQL transformation with schedule options that repeats every two hours, and enable email notifications.
Tạo một truy vấn được lập lịch (scheduled query) trong BigQuery để chạy phép biến đổi SQL với các tùy chọn lập lịch lặp lại sau mỗi hai giờ, và kích hoạt thông báo qua email.
D
Create a BigQuery scheduled query to run the SQL transformation with schedule options that repeats every two hours, and enable notification to Pub/Sub topic. Use Pub/Sub and Cloud Functions to send an email after three failed executions.
Tạo một truy vấn được lập lịch trong BigQuery để chạy phép biến đổi SQL với các tùy chọn lập lịch lặp lại sau mỗi hai giờ, và kích hoạt thông báo đến một chủ đề Pub/Sub. Sử dụng Pub/Sub và Cloud Functions để gửi email sau ba lần thực thi thất bại.
Giải thích & Tài liệu tham khảo
Yêu cầu là: (1) chạy truy vấn SQL tổng hợp và nối kết quả vào bảng khác mỗi 2 giờ, (2) tự động thử lại (retry) nếu lỗi xảy ra, (3) gửi email sau 3 lần thất bại liên tiếp.
- B. Sử dụng BigQueryInsertJobOperator trong Cloud Composer... là giải pháp tốt nhất. Cloud Composer (quản lý Apache Airflow) là công cụ điều phối quy trình (orchestration) mạnh mẽ hỗ trợ thiết lập lịch trình định kỳ, cơ chế thử lại (
retries=3) và gửi email thông báo khi thất bại (email_on_failure=True) một cách trực tiếp thông qua cấu hình của DAG/Operator.BigQueryInsertJobOperatorlà operator tiêu chuẩn để thực hiện các công việc truy vấn SQL trong BigQuery. - A. BigQueryUpsertTableOperator được sử dụng để cập nhật/chèn dữ liệu dựa trên một bảng nguồn, không phải là cách chuẩn để thực thi một truy vấn SQL tùy ý để tổng hợp dữ liệu rồi append.
- C, D. BigQuery Scheduled Queries có hỗ trợ lập lịch và gửi email thông báo khi lỗi, nhưng nó không cung cấp cơ chế kiểm soát retry chi tiết và tự động dừng/thông báo sau đúng 3 lần thất bại liên tiếp một cách linh hoạt như Airflow.
(Đáp án được gợi ý bởi AI)