---
name: "apache-hudi-upserts-mor-cow"
description: "Stream fast upserts and incremental queries over petabyte data lakes using Apache Hudi."
metadata:
  author: "Apache Software Foundation"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "write hudi upserts"
  - "configure hudi mor table"
  - "query hudi incremental changes"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Apache Hudi Upserts & Merge-On-Read (MoR) Lakehouse

Builds data lakes with Apache Hudi: configuring Copy-On-Write (CoW) vs Merge-On-Read (MoR), record key indexing (Bloom, Simple, HBase), automated compaction, and incremental pull queries.

## When to Invoke
Invoke this skill whenever you need to:
- write hudi upserts
- configure hudi mor table
- query hudi incremental changes

## Execution SOP & Rules
1. Set write options: 'hoodie.datasource.write.table.type': 'MERGE_ON_READ', 'hoodie.table.name': 'orders'.
2. Define record keys and partition paths: 'hoodie.datasource.write.recordkey.field': 'order_id'.
3. Save DataFrame: df.write.format('hudi').options(hudi_options).mode('Append').save(base_path).
4. Query incremental commits using 'hoodie.datasource.query.type': 'incremental' with beginInstantTime.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
