Community연구 & 데이터 분석github.com

Unknown-333/아이스버그 테이블 구축

Apache Iceberg 테이블을 설계하고 운영합니다. 파티셔닝 및 숨겨진 파티셔닝, 파티션/스키마 진화, 스냅샷 및 타임 트래블, 압축 및 소규모 파일 정리, Spark, Flink, Trino, Snowflake에서 MERGE/업서트를 지원합니다. Iceberg 테이블을 생성하거나 유지 관리하고, 파티셔닝을 선택하고, 스키마/파티션을 진화시키거나, 소규모 파일 및 메타데이터 블로트를 수정할 때 사용합니다.

아이스버그 테이블 구축란 무엇인가요?

이 스킬은 Apache Iceberg 테이블을 구축, 유지 관리 및 최적화하기 위한 포괄적인 안내서입니다. 숨겨진 파티션 변환, MERGE 문을 사용한 멱등적 업서트, rewrite_data_files 프로시저를 통한 정기적인 압축, 스냅샷 만료 및 고아 파일 제거, 파티션 및 스키마 진화와 같은 핵심 Iceberg 기능을 다룹니다. Spark, Flink, Trino, Snowflake와 같은 주요 쿼리 엔진과의 호환성에 중점을 두어 데이터 레이크하우스 환경에 이상적입니다. 구체적인 SQL 예제와 일반적인 함정(예: 압축 부족으로 인한 소규모 파일 폭발, 스냅샷 미만료로 인한 메타데이터 비대화)을 제공하므로 개발자는 성능과 스토리지 비용을 효과적으로 관리할 수 있습니다. 델타 레이크별 작업에는 사용하지 않는 것이 좋습니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Unknown-333/awesome-data-engineering-skills/tree/main/skills/building-iceberg-tables

Installed? Explore more 연구 & 데이터 분석 skills: affaan-m/uspto-database, affaan-m/scholar-evaluation, affaan-m/literature-review · View all 6 →

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

아이스버그 테이블 구축은(는) 무엇을 하나요?

사용 시기

  • 레이크하우스에서 Apache Iceberg 테이블을 생성하거나 유지 관리할 때.
  • 다시 쓰지 않고 파티셔닝을 선택하거나 파티션/스키마를 진화시킬 때.
  • 스냅샷, 타임 트래블, 압축, 소규모 파일을 관리할 때.
  • 델타 레이크 전용 작업에는 사용하지 마십시오(engineering-databricks-pipelines 사용).

워크플로우

- [ ] 쿼리 필터 열로 파티셔닝, 숨겨진 파티션 변환 사용
- [ ] 멱등적 업서트를 위해 MERGE 사용
- [ ] 소규모 파일 수정을 위해 압축(rewrite_data_files) 예약
- [ ] 오래된 스냅샷 만료 + 고아 파일 제거로 메타데이터/스토리지 제어
- [ ] 필드 ID별로 파티셔닝/스키마 진화(데이터 다시 쓰기 없음)
  1. 필터 열을 기준으로 파티셔닝하고 숨겨진 파티션 변환(days(ts), bucket(N, id))을 사용하면, 사용자가 파생된 파티션 열을 추가하지 않아도 쿼리가 프루닝을 수행합니다.
  2. 멱등적 쓰기는 비즈니스 키를 기준으로 MERGE INTO를 통해 수행합니다.
  3. 정기적으로 압축 — 스트리밍/소규모 배치 쓰기는 많은 소규모 파일을 생성합니다. rewrite_data_files는 읽기 성능을 복원합니다.
  4. 메타데이터 유지 관리 — 오래된 스냅샷을 만료하고 고아 파일을 제거하지 않으면 스냅샷 기록과 스토리지가 무제한으로 증가합니다.
  5. 자유롭게 진화 — Iceberg는 ID로 열/파티션을 추적하므로, 열 추가/제거/이름 변경 및 파티션 스펙 변경도 데이터 다시 쓰기가 필요 없습니다.

패턴

숨겨진 파티셔닝 + MERGE 업서트로 생성:

CREATE TABLE lake.db.orders (order_id BIGINT, customer_id BIGINT, amount DECIMAL, ordered_at TIMESTAMP)
USING iceberg PARTITIONED BY (days(ordered_at));

MERGE INTO lake.db.orders t USING staging s ON t.order_id = s.order_id
WHEN MATCHED THEN UPDATE SET *
WHEN NOT MATCHED THEN INSERT *;

유지 관리 (Spark 프로시저):

CALL lake.system.rewrite_data_files('db.orders');       -- 소규모 파일 압축
CALL lake.system.expire_snapshots('db.orders', TIMESTAMP '2026-08-01 00:00:00');
CALL lake.system.remove_orphan_files(table => 'db.orders');

타임 트래블 — 감사 또는 복구를 위해 이전 스냅샷 읽기: SELECT * FROM lake.db.orders VERSION AS OF <snapshot_id>.

파티션 진화 — ALTER TABLE ... ADD PARTITION FIELD bucket(16, customer_id)는 새 데이터에만 적용되며, 이전 데이터는 그대로 유효합니다.

일반적인 함정

  • 스트리밍 테이블에서 압축 미수행 — 소규모 파일 폭증으로 읽기 속도가 저하됩니다.
  • 스냅샷을 만료하지 않음 — 메타데이터와 스토리지가 무한정 증가합니다. 타임 트래블 보존 기간 내에 만료를 예약하세요.
  • 과도한 파티셔닝(예: 적은 데이터량을 시간 단위로 파티셔닝) — 너무 많은 작은 파티션이 생성됩니다. 데이터 크기에 맞게 세분화를 조정하세요.
  • 명시적 파생 파티션 열 추가 — 숨겨진 파티셔닝의 목적을 무효화합니다. 변환을 사용하세요.
  • MERGE 대신 블라인드 덮어쓰기 — 멱등성을 잃습니다. 키로 MERGE하세요.
  • 너무 짧은 기간으로 고아 파일 제거 — 진행 중인 작성자가 여전히 필요한 파일을 삭제할 수 있습니다. 안전한 기준 시간을 사용하세요.

Individual skills in this repo

This repo contains 9 individual skills — each has its own dedicated page.

Unknown-333/authoring-airflow-dags

Write production-grade Apache Airflow DAGs using the TaskFlow API — idempotent tasks, correct scheduling and catchup, retries/SLAs, connections/variables, and avoiding top-level code. Use when creating or reviewing Airflow DAGs, scheduling pipelines, wiring task dependencies, configuring retries/backfills, or fixing non-idempotent tasks.

Unknown-333/building-dagster-assets

Build Dagster pipelines using software-defined assets — asset dependencies, partitions, resources and IO managers, asset checks, and schedules/sensors. Use when creating Dagster assets or jobs, modeling data as assets, adding partitions or backfills, wiring resources/IO managers, or migrating from task-based orchestration to assets.

Unknown-333/building-dbt-models

Build well-structured dbt models — staging/intermediate/marts layers, ref() and source(), materializations, and incremental models with the right strategy. Use when creating or refactoring dbt models, choosing table vs view vs incremental, structuring a dbt project, or writing incremental logic.

Unknown-333/building-feature-pipelines

Build ML feature pipelines and feature stores — point-in-time-correct joins to avoid label leakage, offline/online parity, feature freshness and backfills, and materialization with tools like Feast. Use when engineering features for ML, preventing train/serve skew or data leakage, building a feature store, or backfilling historical features for training.

Unknown-333/building-ingestion-pipelines

Build batch and incremental data ingestion (extract-load) pipelines — full vs incremental extraction, change data capture (CDC), watermarks and high-water marks, API pagination and rate limits, and choosing managed EL tools (Fivetran, Airbyte) vs custom code. Use when ingesting data from databases, APIs, files, or SaaS into a warehouse/lake, or designing incremental extraction and CDC.

Unknown-333/building-kafka-consumers

Build reliable Apache Kafka consumers and producers — consumer groups and partition assignment, offset commit strategy, at-least-once vs exactly-once, idempotent/transactional producers, rebalancing, and dead-letter handling. Use when writing Kafka consumers/producers, configuring offset commits or consumer groups, tuning throughput, or handling rebalances and poison messages.

Unknown-333/debugging-data-pipelines

Systematically root-cause data pipeline failures and data incidents — job errors, wrong or missing data, duplicates, and freshness misses — by tracing lineage upstream, isolating the failing stage, reconciling against source, and planning a safe fix and backfill. Use when a pipeline fails, numbers look wrong, data is missing or duplicated, a dashboard is stale, or a stakeholder reports a data discrepancy.

Unknown-333/designing-backfills-and-replays

Plan and run safe data backfills and replays — idempotent reprocessing of historical windows, partition-by-partition execution, isolating backfill compute from production, verifying results, and avoiding double-counting or changed history. Use when backfilling a new or fixed model, reprocessing after a bug, replaying events, or loading history for a new pipeline without corrupting existing data.

Unknown-333/designing-data-contracts

Define and enforce data contracts between producers and consumers — explicit schema, semantics, ownership, SLAs, and versioning — to prevent silent upstream changes from breaking downstream pipelines. Use when a producer schema change could break consumers, defining an interface between teams/services and the warehouse, or adding schema enforcement at ingestion.

관련 스킬