lhm-metric-check
Creates and triggers an LHM per-table metric validation task, corresponding to run_metric_check() in the outer common.py.
от aliyun★ 303 звезды на GitHub
Установить lhm-metric-check в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
lhm-metric-check
Creates and triggers an LHM (Lakehouse Migration Center) per-table metric validation task. Automatically completes: task creation (with a specified template) → per-table metric field configuration → batch saving → immediate execution.
Steps
- Confirm that the aliyun CLI + aliyun-cli-lhm plugin and
pyyamlare installed (see "Environment Preparation" in the root README). - Construct the
--tables-jsonargument: a JSON array where each element is a dict containingsource_table,target_table,source_partition,target_partition,source_columns, andtarget_columns; an empty string for a field means using the template default. - Invoke this script, passing all required parameters via the command line.
Data sources support alias mode: use
--src-aliasand--dst-aliasto resolve from data_validation_config.yaml, in which case--src-ds-id/name/typedo not need to be passed. - The script calls
run_metric_check()in the outerscripts/common.pyto create the task and trigger execution. - On success, stdout outputs JSON:
{"ok": true, "task_id": ..., "batch_id": ...}.
Pitfalls
--thresholddefaults toNone, meaning it is not passed to the SDK and the system uses its default value; passingnonealso meansNone.- Never pass
0.0by default for metric checks, otherwise all numeric metrics will be falsely judged PASSED; only pass0.0when explicitly required. --check-template-iddefaults to1001(MIX); specify it explicitly if another template is needed.- When a partition field is an empty string, common.py treats it as a whole-table check (
is_full_table_count=1). - MaxCompute partitioned tables usually require setting
--source-global-params/--target-global-paramstoodps.sql.allow.fullscan=true.
Verification
- After running the script, check whether the stdout output is
{"ok": true, "task_id": <int>, "batch_id": <int>}. - Use
lhm-poll-statusor the LHM console to check the execution status of the corresponding task_id / batch_id.
Input/Output Examples
Input (command line):
python atomic-skills/lhm-metric-check/scripts/run.py \
--task-name "逐表指标校验" \
--src-ds-id ds-src-001 \
--src-ds-name "源端MySQL" \
--src-ds-type MySQL \
--dst-ds-id ds-dst-001 \
--dst-ds-name "目标端Hive" \
--dst-ds-type Hive \
--tables-json '[
{
"source_table": "src_db.orders",
"target_table": "dst_db.orders",
"source_partition": "dt=20240305",
"target_partition": "dt=20240305",
"source_columns": "amount,order_cnt",
"target_columns": "amount,order_cnt"
}
]' \
--check-template-id 1001 \
--region hangzhou
Output (stdout):
{"ok": true, "task_id": 12345, "batch_id": 67890}
Using alias mode (data sources resolved from data_validation_config.yaml):
python atomic-skills/lhm-metric-check/scripts/run.py \
--task-name "逐表指标校验" \
--src-alias mc_source \
--dst-alias sr_target \
--tables-json '[{"source_table":"src_db.orders","target_table":"dst_db.orders","source_partition":"","target_partition":"","source_columns":"amount","target_columns":"amount"}]' \
--check-template-id 1001
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- scripts/run.py
FAQ
Что делает скилл lhm-metric-check?
Creates and triggers an LHM per-table metric validation task, corresponding to run_metric_check() in the outer common.py.
Как установить скилл lhm-metric-check?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл lhm-metric-check запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…