parent-segment-analysis
БесплатноБез исполняемых скриптовНе проверенQuery and analyze CDP parent segment database data. Use `tdx ps desc -o` to get output database schema, then query customers and behavior tables. Use when…
от treasure-data★ 23 звезды на GitHubОб этом скилле
tdx Parent-Segment-Analysis - CDP Parent Segment Data Analysis
Workflow
- Get output database schema
- Read ALL columns from the schema file to understand available data
- Identify relevant columns for the analysis (use sub-agent if schema is large)
- Query customers or behavior tables
Get Output Database Schema
Parent segments generate an output database (cdp_audience_{id}) with:
customerstable - master + all attributes joinedbehavior_{name}tables - one per behavior
# Save schema to file (recommended for large schema data)
tdx ps desc "Customer 360" -o customer_360_schema.json
# Output summary:
# Schema saved to customer_360_schema.json
# Database: cdp_audience_12345
# Tables: 1 customers + 5 behaviors
# Columns: 42 total
Schema JSON Structure
One column per line for grep and progressive disclosure:
{
"database": "cdp_audience_12345",
"parent_segment": "Customer 360",
"parent_id": "12345",
"customers": {
"table": "customers",
"columns": [
{ "name": "cdp_customer_id", "type": "varchar" },
{ "name": "email", "type": "varchar" }
]
},
"behaviors": [
{
"table": "behavior_purchases",
"columns": [
{ "name": "cdp_customer_id", "type": "varchar" },
{ "name": "amount", "type": "double" }
]
}
]
}
Discovering Relevant Columns
IMPORTANT: Always read the full schema file first to understand what data is available. After reviewing the schema, you can use grep/search to find specific columns.
For large schemas: use a sub-agent to discover relevant columns for your analysis goal
Analysis Guidelines
- Check null ratios for identified customer columns and exclude null values from aggregations to ensure accurate analysis.
- Build queries incrementally rather than attempting everything at once.
- Provide an extremely brief summary of key findings in one sentence.
- Always be very explicit and detailed about the data sources you are using, including table names, column names.
Array Columns
- For SQL queries needing array analysis/aggregation: Use CROSS JOIN UNNEST.
SELECT tag, count(0) AS cnt FROM customers CROSS JOIN UNNEST(tags) AS t(tag) GROUP BY 1 ORDER BY 2 DESC LIMIT 10 - Don't use the same name for alias as column name (e.g., use
tagnottagsfor the alias) - Never use
ARRAY_CONTAINS— usecontains(array_column, value)or filter via CROSS JOIN UNNEST
Time Function Usage
Always first check the format of the time column before applying time functions.
Time functions:
td_interval(time, '-1d')— filter records within a time intervaltd_time_parse('2024-01-01', 'UTC')— parse a time string into Unix timestamp (seconds)
Related Skills
- parent-segment - Manage parent segment configuration
- segment - Create child segments from parent segment data
- trino - Trino SQL syntax and TD-specific functions
Установить parent-segment-analysis в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл parent-segment-analysis?
Query and analyze CDP parent segment database data. Use `tdx ps desc -o` to get output database schema, then query customers and behavior tables. Use when exploring parent segment data, building reports, or analyzing customer attributes and behaviors.
Как установить скилл parent-segment-analysis?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл parent-segment-analysis запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create 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…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic