Communitygithub.com

배치 처리 최적화 도구

Spark, Polars, DuckDB, pandas를 활용한 배치 데이터 처리 워크로드 최적화. 메모리 효율성, 병렬 처리, 비용 절감에 중점을 둡니다. 실시간 스트리밍이나 데이터 웨어하우스 쿼리에는 적합하지 않습니다.

배치 처리 최적화 도구란 무엇인가요?

이 스킬은 Spark, Polars, DuckDB, pandas를 사용하여 배치 데이터 처리 파이프라인을 최적화하는 방법을 안내합니다. 메모리 효율성, 병렬 처리, 비용 절감을 목표로 하며, 데이터 크기와 복잡도에 따라 적절한 도구를 선택하는 방법, 쿼리 및 조인 최적화 기법, 주요 안티패턴을 제시합니다. Apache Spark(분산), Polars 및 DuckDB(단일 노드) 등 다양한 플랫폼을 지원하며, Parquet, Delta Lake 등 파일 포맷 최적화와 함께 AQE, 지연 평가(lazy evaluation) 같은 고급 기능을 활용합니다. 주로 배치 처리, 데이터 프레임 셔플, 파티션 스큐, 메모리 부족 문제 해결 시 활성화되며, 실시간 스트리밍이나 데이터 웨어하우스 쿼리 튜닝에는 적합하지 않습니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/curiositech/windags-skills/tree/HEAD/skills/batch-processing-optimizer

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

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

문서

배치 처리 최적화 도구은(는) 무엇을 하나요?

Spark, Polars, DuckDB, pandas를 사용한 배치 데이터 처리 작업을 메모리 효율성, 병렬 처리, 비용 절감에 중점을 두고 최적화합니다.

활성화 조건

다음 경우에 활성화: "배치 처리", "Spark 최적화", "Polars", "DuckDB", "pandas 성능", "데이터 프레임", "셔플 최적화", "파티션 스큐", "메모리 최적화", "메모리 부족"

다음 경우에는 사용하지 마세요: 실시간 스트리밍 → streaming-pipeline-architect | 웨어하우스 SQL 튜닝 → data-warehouse-optimizer | 파이프라인 오케스트레이션 → airflow-dag-orchestrator

빠른 시작

  1. 올바른 도구 선택 — 단일 노드 분석에는 DuckDB, 데이터 프레임에는 Polars, 분산 환경에는 Spark
  2. 먼저 프로파일링 — 최적화 전에 병목 지점(셔플, 스큐, 메모리)을 식별합니다.
  3. 초기에 데이터 축소 — 파이프라인에서 가능한 한 빨리 필터링하고 칼럼을 선택합니다.
  4. 셔플 피하기 — 작은 테이블은 브로드캐스트하고, 데이터를 미리 파티셔닝하며, 맵-사이드 조인을 사용합니다.
  5. 리소스 적절히 할당 — 실행자 메모리/코어를 실제 데이터 크기에 맞춥니다.

핵심 기능

영역기술
분산Apache Spark 3.5+, Dask, Ray
단일 노드DuckDB 1.1+, Polars 1.x, pandas 2.2+
파일 포맷Parquet, Arrow IPC, Delta Lake, Iceberg
최적화AQE (Spark), 지연 평가 (Polars), 컬럼 스캔
클라우드Databricks, EMR, Dataproc, 서버리스 Spark

아키텍처 패턴

도구 선택 결정 트리

데이터 크기?
  ├─ < 10 GB     → DuckDB (SQL) 또는 Polars (DataFrame)
  │                 단일 머신, 설정 불필요, 가장 빠른 반복
  │
  ├─ 10-100 GB   → Polars (지연) 또는 DuckDB (디스크 오버플로우)
  │                 여전히 단일 머신이지만 디스크로 오버플로 가능
  │
  └─ > 100 GB    → Spark (분산)
                    다중 노드 클러스터, 셔플 기반 조인

복잡도?
  ├─ SQL 중심    → DuckDB (분석을 위한 가장 빠른 SQL 엔진)
  ├─ DataFrame    → Polars (pandas보다 10배 빠름, 지연 평가)
  └─ 복잡한 ML    → Spark + MLlib 또는 Spark + Ray

Spark 최적화 패턴

from pyspark.sql import SparkSession
import pyspark.sql.functions as F

spark = SparkSession.builder \
    .config("spark.sql.adaptive.enabled", "true") \
    .config("spark.sql.adaptive.coalescePartitions.enabled", "true") \
    .config("spark.sql.adaptive.skewJoin.enabled", "true") \
    .getOrCreate()

# 좋음: 작은 차원 테이블 브로드캐스트 (< 100MB)
from pyspark.sql.functions import broadcast
result = large_df.join(broadcast(small_dim_df), "key")

# 좋음: 조건자 푸시다운 — 조인 전 필터링
orders = spark.read.parquet("s3://data/orders/") \
    .filter(F.col("order_date") >= "2026-01-01") \
    .select("order_id", "customer_id", "amount")  # 칼럼 정리

# 나쁨: 대규모 데이터셋에 collect() 사용 — 드라이버 OOM 발생
# all_data = large_df.collect()  # 절대 사용하지 마세요

# 좋음: 파티셔닝된 출력 작성
result.repartition(200) \
    .write.mode("overwrite") \
    .partitionBy("order_date") \
    .parquet("s3://output/results/")

Polars 지연 평가

import polars as pl

# 지연 모드: 쿼리 계획을 세우고 최적화한 후 실행
result = (
    pl.scan_parquet("data/orders/*.parquet")  # 지연 스캔
    .filter(pl.col("order_date") >= "2026-01-01")
    .join(
        pl.scan_parquet("data/customers/*.parquet"),
        on="customer_id",
        how="inner"
    )
    .group_by("region")
    .agg([
        pl.col("amount").sum().alias("total_revenue"),
        pl.col("order_id").n_unique().alias("order_count"),
    ])
    .sort("total_revenue", descending=True)
    .collect()  # 최적화된 계획 실행
)

# Polars가 자동으로 최적화: 조건자 푸시다운, 프로젝션 푸시다운,
# 조인 재정렬 — 모두 지연 평가를 통해 자동 수행

안티패턴

  1. 5GB 이상 데이터에 pandas 사용 — pandas는 모든 데이터를 메모리에 로드합니다. 중간 규모 데이터는 Polars(지연) 또는 DuckDB, 대규모는 Spark를 사용하세요.
  2. 드라이버로 collect 수행 — 대규모 Spark 데이터프레임에서 df.collect() 또는 df.toPandas()는 OOM을 유발합니다. 먼저 집계하세요.
  3. 파티션 스큐 무시 — 다른 파티션보다 10배 많은 데이터를 가진 하나의 파티션이 전체 작업의 병목이 됩니다. AQE 또는 살팅(salting)을 사용하세요.
  4. 모든 칼럼 읽기 — 항상 필요한 칼럼만 선택하세요. Parquet 컬럼 포맷은 사용되지 않는 칼럼을 완전히 건너뜁니다.
  5. 작은 출력 파일 — 너무 많은 작은 출력 파일(< 128MB)은 다운스트림 읽기를 느리게 만듭니다. 쓰기 전에 coalesce를 수행하세요.

품질 체크리스트

  • 도구가 데이터 크기에 맞음 (DuckDB/Polars < 100GB, Spark > 100GB)
  • 칼럼이 초기에 정리됨 (필요한 것만 선택)
  • 필터가 스캔 수준으로 푸시됨 (조건자 푸시다운)
  • 조인에서 작은 테이블 브로드캐스트 (< 100MB)
  • Spark AQE 활성화 (적응형 쿼리 실행)
  • 대규모 데이터셋에 collect() 사용 없음 (collect 전에 집계)
  • 출력 파일 크기 128MB-1GB (쓰기 전 coalesce/repartition)
  • 파티션 스큐 모니터링 및 완화 (살팅 또는 AQE)
  • 작업 프로파일링: Spark UI 스테이지, Polars .explain(), DuckDB EXPLAIN ANALYZE
  • 메모리 적절히 할당: 실행자 메모리 >= 가장 큰 파티션의 2배

Individual skills in this repo

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

curiositech/windags-skills

Expert in 2000s-era music visualization (Milkdrop, AVS, Geiss) and modern WebGL implementations. Specializes in Butterchurn integration, Web Audio API AnalyserNode FFT data, GLSL shaders for audio-reactive visuals, and psychedelic generative art. Activate on "Milkdrop", "music visualization", "WebGL visualizer", "Butterchurn", "audio reactive", "FFT visualization", "spectrum analyzer". NOT for simple bar charts/waveforms (use basic canvas), video editing, or non-audio visuals.

curiositech/windags-skills

Expert legal research agent for finding and scraping expungement data state by state. Knows authoritative sources, URL patterns, Firecrawl configuration, and 2026 legal landscape.

curiositech/windags-skills

Expert in 3D computer vision labeling tools, workflows, and AI-assisted annotation for LiDAR, point clouds, and sensor fusion. Covers SAM4D/Point-SAM, human-in-the-loop architectures, and vertical-specific training strategies. Activate on '3D labeling', 'point cloud annotation', 'LiDAR labeling', 'SAM 3D', 'SAM4D', 'sensor fusion annotation', '3D bounding box', 'semantic segmentation point cloud'. NOT for 2D image labeling (use clip-aware-embeddings), general ML training (use ml-engineer), video annotation without 3D (use computer-vision-pipeline), or VLM prompt engineering (use prompt-engineer).

curiositech/windags-skills

Implement WCAG 2.2 AA/AAA compliance with automated testing, keyboard navigation, screen reader support, and focus management. Activate on: accessibility audit, WCAG compliance, keyboard navigation, screen reader, aria attributes, axe-core, focus trap. NOT for: design-level accessibility review (use design-accessibility-auditor), color contrast only (use css-in-js-architect).

curiositech/windags-skills

Time-blind friendly planning, executive function support, and daily structure for ADHD brains. Specializes in realistic time estimation, dopamine-aware task design, and building systems that actually work for neurodivergent minds.

curiositech/windags-skills

Designs digital experiences for ADHD brains using neuroscience research and UX principles. Expert in reducing cognitive load, time blindness solutions, dopamine-driven engagement, and compassionate design patterns. Activate on 'ADHD design', 'cognitive load', 'accessibility', 'neurodivergent UX', 'time blindness', 'dopamine-driven', 'executive function'. NOT for general accessibility (WCAG only), neurotypical UX design, or simple UI styling without ADHD context.

curiositech/windags-skills

>- Apply crisis decision-making research to agent routing, uncertainty triage, and coordination failure analysis in time-pressured systems. Use when diagnosing handoff failures, analytical paralysis, or expert judgment under incomplete information. NOT for routine coding, simple CRUD design, or static single-agent tasks with complete information.

curiositech/windags-skills

Extend and modify the admin dashboard, developer portal, and operations console. Use when adding new admin tabs, metrics, monitoring features, or internal tools. Activates for dashboard development, analytics, user management, and internal tooling.

curiositech/windags-skills

Conversation patterns and interaction protocols for multi-agent systems. Covers request/response, pub/sub, blackboard, delegation chains, debate, critique, consensus, fan-out/fan-in, supervisor-worker, and peer negotiation. Deep analysis of AutoGen conversation patterns, CrewAI delegation, LangGraph state passing, and FIPA-ACL performatives. Teaches how to design what agents say to each other and in what order. Activate on: "agent conversation", "agent protocol", "multi-agent debate", "agent delegation", "supervisor worker pattern", "agent voting", "consensus protocol", "fan-out fan-in", "agent negotiation", "blackboard pattern", "agent dialogue", "conversation topology", "agent handoff". NOT for: wire format or serialization (use agent-interchange-formats), orchestration infrastructure (use agentic-infrastructure-2026), single agent behavior (use agentic-patterns).

curiositech/windags-skills

Meta-agent for creating new custom agents, skills, and MCP integrations. Expert in agent design, MCP development, skill architecture, and rapid prototyping. Activate on 'create agent', 'new skill', 'MCP server', 'custom tool', 'agent design'. NOT for using existing agents (invoke them directly), general coding (use language-specific skills), or infrastructure setup (use deployment-engineer).

curiositech/windags-skills

AI-powered calendar management and agent-based scheduling coordination. Covers calendar APIs (Google Calendar, CalDAV/iCal), AI scheduling assistants (Reclaim, Clockwise, Motion, Cal.com), building custom calendar agents with MCP, multi-calendar merging, timezone management, focus block protection, meeting fatigue detection, and agent-to-agent meeting negotiation protocols. Activate on: "calendar agent", "AI scheduling", "calendar coordination", "meeting scheduling", "calendar API", "focus time protection", "calendar optimization", "Google Calendar MCP", "Reclaim", "Clockwise", "Motion", "Cal.com", "smart scheduling", "calendar-aware agent", "timezone scheduling", "agent negotiation meetings". NOT for: manual calendar UI component design (use form-validation-architect), project management scheduling or Gantt charts (use project-management-guru-adhd), general time-tracking or pomodoro apps (use adhd-daily-planner for time-awareness), building the agent itself from scratch (use agent-creator).

curiositech/windags-skills

Build and adopt production AI agent infrastructure in 2026. Covers framework selection (LangGraph, CrewAI, AutoGen, MCP), orchestration patterns, evaluation, observability, memory systems, and tool use. Also covers the SOCIAL dimension: how to sell agent infrastructure internally, change management, measuring ROI, building trust in autonomous systems, and scaling adoption across teams. Activate on: "agent infrastructure", "agent framework comparison", "which agent framework", "sell AI tools internally", "agent adoption", "agent observability", "agent evaluation", "MCP architecture", "agentic mesh", "enterprise AI agents", "AI change management", "agent ROI". NOT for: building specific agents (use ai-engineer), designing agent behavior patterns (use agentic-patterns), prompt tuning (use prompt-engineer).

curiositech/windags-skills

Fundamental patterns for effective agentic behavior. Teaches decomposition, tool orchestration, error recovery, context management, quality self-assessment, and knowing when to stop. Model-agnostic principles that make any agent more effective regardless of domain. Activate on: "how should I structure this agent", "agentic workflow", "agent patterns", "multi-step task", "tool orchestration", "/agentic-patterns", "decompose this", "agent best practices", "chain of actions", "when should the agent stop", "agent loop design". NOT for: creating agent infrastructure (use agent-creator), building DAGs (use windags-architect), specific tool implementation.

curiositech/windags-skills

Automated discovery and matching of agent skills for dynamic task routing and capability assessment

curiositech/windags-skills

Cryptographic security for agentic systems — zero-trust agent networking, signed message envelopes (JWS/JWE), capability-based security (ocaps), Merkle tree audit trails, WASM sandboxing, and formal verification. Covers CLI dev tool security, mTLS between agents, permission boundaries (least privilege for AI agents), and supply chain security for skills/plugins. Activate on: "agent security", "zero trust agents", "secure agent communication", "capability-based security", "ocap", "signed messages between agents", "agent audit trail", "sandbox agent execution", "agent permissions", "mTLS agents", "cryptographic verification", "agent supply chain", "OWASP agentic", "prove agent did X", "tamper-proof agent logs". NOT for: application-level SAST scanning (use security-auditor), network firewall rules (use infrastructure), SOC2/HIPAA compliance (organizational), or prompt injection defense (use prompt-engineer).

curiositech/windags-skills

Data structures and serialization formats for agent-to-agent communication. Covers message envelopes, structured output schemas, capability declarations, task handoff payloads, error/retry signaling, and context windows as data structures. Deep comparison of A2A protocol, MCP, OpenAI function calling, and LangChain message types. Teaches when to use rigid schemas vs free-form with validation, typed vs untyped, streaming vs batch. Activate on: "agent message format", "agent communication schema", "agent-to-agent protocol", "A2A protocol", "MCP message format", "structured output for agents", "agent interop", "interchange format", "agent serialization", "task handoff format", "capability declaration". NOT for: what agents say to each other (use agent-conversation-protocols), orchestration topology (use multi-agent-coordination), building agent infrastructure (use agentic-infrastructure-2026).

curiositech/windags-skills

Logic-based agent programming language implementing BDI architecture for practical autonomous agent development

curiositech/windags-skills

>- Design AgentSpeak(L)-style BDI agents with context-guarded plans, selection functions, and intention stacks. Use for interruptible autonomy, agent policy, and multi-agent orchestration in dynamic environments. NOT for simple rule engines, static planners, or centralized workflows.

curiositech/windags-skills

Foundational concurrent computation model where actors communicate exclusively through asynchronous message passing

curiositech/windags-skills

license: Apache-2.0 NOT for unrelated tasks outside this domain.

관련 스킬