Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Allow steps to loop through array of variables

Đang mở
#100 2 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
go, sql
Lĩnh vực
databases

Hướng nghiên cứu

The issue names no files, tests, or entry points. Start by reviewing how playbooks, steps, and templated variables are currently represented, then determine how loop variables should apply across queries and steps. Done means a playbook can iterate over the country and schema pairs while preserving the requested non-looped steps.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

At @Werkspot we are active in multiple countries. Each country has exactly the same database structure. We load each country in a separate schema in Redshift

I would like to create a playbook where i can run steps in a loop with different variables.

I was thinking about something like this: (i know i can put multiple Queries in one file but want to make clear what i was thinking about)

loop:
  variables:
    - country: nl
      schema: raw_data_nl
    - country: it
      schema: raw_data_it
steps:
# remove old tmp table (if it exists) so we are sure we are starting fresh
  - name: Remove tmp table
    loop: false
    queries:
      - name: remove tmp table
        file: 01.remove_tmp.sql
  - name: create tmp table
    loop: false
    queries:
      - name: create table
        file: 02.01.first_subscription.sql
        loop: false
  - name: Manipulate data per country
    loop: true # since loop contains variables there is no need to also put the `template` option here, the loop should overwrite this to true
    queries:
      - name: Create table A
        file: 03.01.create_table_a.sql
      - name: Create table B
        file: 03.02.create_table_b.sql
  - name: combine table A & B per country
    loop: true
    queries:
      - name: combine table A & B
        file: 04.combine_tables_and_insert_into_tmp.sql
  - name: Replace old data with new data
    loop: false
    queries:
      - name: Delete old table
        file: 05.01.delete_old_table.sql
      - name: Rename tmp
        file: 05.02.rename_tmp.sql
Ngôn ngữ chính
Go
Star
81
Fork
15
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của snowplow/sql-runner

Tất cả issue của snowplow/sql-runner

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.