Apache Hudiのテーブル設計を、用途やデータ更新の要件から対話で整理し、判断理由を記した設計記録と、対応する構成に応じた設定案をまとめるスキル。
- 新しいHudiテーブルの設計
- 既存テーブルの設計を見直したいとき
- 小規模な試作の構成検討
Apache Hudiのテーブル容量やファイルサイズ、パーティションの偏りを読み取り専用ツールで調べ、小さいファイルの蓄積や書き込み集中を診断します。
Analyzes the physical layout of an Apache Hudi table (partition and file size distribution, skew, micro-partitioning, small-file pile-up, hot partitions) by running the HoodieTableLayoutAnalyzer utility and interpreting its JSON report. Invoke when a user asks how big a Hudi table or its partitions are, whether a table has a small-file problem, whether it is over-partitioned, which partitions take most of the writes, or how skewed the partitions are.
Apache Hudiのテーブルがストレージ上でどう配置されているかを調べます。読み取り専用のHoodieTableLayoutAnalyzerを実行し、JSONレポートから容量、ファイル数、サイズ分布、パーティション間の偏りを説明します。小さいファイルの蓄積、細かすぎる分割、最近の書き込み集中も確認し、問題に応じた改善案を示します。
テーブルや各パーティションの容量を把握したい運用担当者に向いています。ファイルが小さすぎないか、データが一部に偏っていないかを、実測値と判定基準で確認したい場面に使えます。
hudi-utilitiesとspark-submitが必要です。オブジェクトストレージには対応するHadoopコネクターも必要です。行数の取得は大量のファイルで時間がかかる場合があります。Merge-on-Readのログファイルは集計対象外です。診断と提案を行い、データの再配置や設定変更は実行しません。
この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。
インストールする前に、エージェントに与えられる指示の中身を確認できます。
You are helping an operator understand how a Hudi table is laid out on storage and whether that
layout is hurting it. You do this by running HoodieTableLayoutAnalyzer — a read-only Spark
utility shipped in hudi-utilities — and reading its JSON report. You never guess at a table's
layout from memory; every number and verdict you give traces back to a field in that report.
| Section | Question |
|---|---|
tableSizeStats, fileCountPerPartition | How big are the base files, and how many does each partition hold? |
skew | Is data spread evenly across partitions, or concentrated in a few? |
partitions | Which partitions are largest, and what do their files look like? |
micro-partition detector | Are there too many partitions, or do most partitions hold too little data to fill a base file? |
small-files detector | What share of partitions is piling up small base files? |
hot-partitions detector | Which partitions absorb most recent writes? |
Each detector reports a status: CLEAN or FLAGGED for micro-partition and hot-partitions;
CLEAN, MODERATE, SEVERE or SKIPPED for small-files (hot-partitions is also SKIPPED when
there are no ingest commits to scan). SKIPPED means the detector could not judge. It is silence,
not a pass.
s3://, gs:// or abfs://.| The user wants | Flags |
|---|---|
| Total size, file-size distribution | none (default) |
| Per-partition breakdown, largest partitions | --enable-partition-stats (add --top-n 20 for "top N") |
| Skew across partitions | --enable-partition-stats --enable-table-stats |
| Record counts, average row size | --enable-partition-stats --include-row-counts |
| Small files, over-partitioning, hot partitions | --enable-partition-stats --analyze-table-characteristics (add --print-top-k 5 for evidence) |
| Only the last N days of a date-partitioned table | --num-days N |
--micro-partition-*, --small-files-* or --hot-* flag; references/detectors.md lists
them. Do not invent overrides; defaults are fine for a first look.Two things to warn about before running:
--include-row-counts reads one Parquet footer per file when the table has no column_stats
metadata partition. On a table with tens of thousands of files on object storage this is slow.
Say so, and confirm before running it.yyyy-M-d, yyyy/M/d or column=<date>. On
any other scheme the run fails fast; drop the date flags.The tool is a Spark application and needs spark-submit; a plain java -cp will not work.
spark-submit \
--master "local[2]" \
--driver-memory 4g \
--conf spark.log.level=WARN \
--class org.apache.hudi.utilities.HoodieTableLayoutAnalyzer \
"$HUDI_UTILITIES_BUNDLE" \
--base-path <table base path> \
--enable-partition-stats --analyze-table-characteristics \
--output JSON
Always request --output JSON. For object-store paths add the matching Hadoop connector
(--packages org.apache.hadoop:hadoop-aws:3.3.4 for S3, or the GCS / Azure equivalent). Raise
--driver-memory for tables with more than roughly 50,000 partitions. Show the user the full
command before running it.
If spark-submit is not available, say so and stop; there is no pure-Java fallback for this tool.
The JSON envelope is documented in references/detectors.md. Answer the user's question from the
fields, not from the whole dump:
totalBytes, totalFiles, numPartitions and
tableSizeStats. Quote the p50 and p95 file sizes; they say more than the mean.largestPartitionShare and top10Share, which are intuitive,
then give cv and gini. Rule of thumb: cv under 0.3 is uniform, 0.3–0.6 moderate, above
0.6 significant; gini under 0.2 balanced, above 0.5 highly concentrated. Name the
outliers when there are any.status:
FLAGGED, MODERATE, SEVERE — quote the summary, then the findings verbatim.
Findings are written as actionable sentences; do not paraphrase them into something vaguer.
Then add the remedy from references/detectors.md.SKIPPED — the summary says why (too few ingest commits, or no ingest commits in the
window). Say so and do not treat it as clean.CLEAN — say so in one line. Do not pad.When reporting, lead with overallStatus, then flagged detectors, then skipped, then clean.
Include the observed.* values from effectiveConfigs when they make a finding concrete
("47 of 280 qualifying partitions average under 50 MB"), and mention the effective.* threshold
the verdict was judged against, since a user with a different target file size may want to
re-run with an override.
This skill diagnoses. It does not run clustering, change writer configuration, or repartition a
table. For every flagged detector, give the operator the specific next step from
references/detectors.md — typically scheduling clustering with HoodieClusteringJob, tuning the
writer's small-file settings, or revisiting the partition key — and say what it costs: clustering
rewrites data and takes time and compute; changing the partition scheme means a new table.
--include-row-counts on a large table without warning about the cost.まだレビューはありません。使ってみた感想をお寄せください。
ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。
まだコメントはありません。最初のコメントを書いてみませんか。
Apache Hudiのテーブル設計を、用途やデータ更新の要件から対話で整理し、判断理由を記した設計記録と、対応する構成に応じた設定案をまとめるスキル。
Apache Hudiのデータ整理や履歴保管が取り込みに追いついているかを、専用ツールの診断結果から確認し、問題の根拠と次の対処を示すスキル。