Chuyển đến nội dung
Skillpedia
Cơ sở dữ liệu41k · #6845

setting-up-warehouse-properties

Skill này làm gì

Skill này ánh xạ toàn bộ một bảng hoặc view kho dữ liệu lên người dùng hoặc nhóm trong PostHog, theo lịch mà bảng đã đồng bộ. Nó dành cho các nhóm hiện đang chạy một script để gửi dữ liệu người dùng vào PostHog.

Khi nào nên dùng

  • ✓Khi bạn có một script hằng ngày gửi thuộc tính người dùng đến PostHog và muốn PostHog tự kéo chúng về.
  • ✓Khi bạn muốn ánh xạ một bảng rộng gồm các thuộc tính khách hàng lên người dùng trong một lần.
  • ✓Khi bạn đang ở khu vực thuộc tính kho dữ liệu và muốn thiết lập một ánh xạ bảng đầy đủ.

Liên kết skill

https://github.com/PostHog/posthog/blob/master/products/customer_analytics/skills/setting-up-warehouse-properties/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/PostHog/posthog/blob/master/products/customer_analytics/skills/setting-up-warehouse-properties/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Thay thế script identify hằng ngày của chúng tôi bằng cách ánh xạ bảng thuộc tính khách hàng sang thuộc tính người dùng trong PostHog.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

AI chọn cột nào sẽ thành thuộc tính và chúng được đặt tên gì, rồi lưu toàn bộ ánh xạ trong một yêu cầu. Sau đó, PostHog cập nhật người dùng từ bảng mỗi lần đồng bộ.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Setting up warehouse properties

Warehouse properties write columns from a warehouse table or materialized view onto matching people or groups, on the schedule that table already syncs on. They replace a cron that sends $set identify events.

The mapping is the whole job. Most tables worth mapping are wide, so the work is deciding which columns become properties and what they are called — not making many API calls. One source carries the entire mapping: custom-property-sources-create takes the complete column_property_map in a single request, so never loop per column.

When to use this skill

  • "Sync my postgres.customer_attributes columns to person properties"
  • "We send a daily identify job from our warehouse, can PostHog pull it instead?"
  • "Map this table to people" / "reverse ETL into PostHog"
  • The user is looking at Data → Warehouse properties and wants a whole table mapped

Use setting-up-a-data-warehouse-source instead when the table is not in the warehouse yet. This skill starts once the data is syncing.

Tools

Tool Purpose
external-data-schemas-list Find a synced table and its schema id (the external_data_schema binding); columns are omitted here
external-data-schemas-retrieve Read one synced table's columns and types by schema id
view-list Find a materialized view and its column schema (the saved_query binding)
view-get Read one materialized view's columns and types by id
custom-property-definitions-list See what warehouse properties already exist for the team
custom-property-definitions-create Create the definition the source attaches to (target_type: person or group)
custom-property-sources-create Bind the definition to the table, carrying the whole column_property_map
custom-property-sources-backfill Populate historical rows after creating the mapping
custom-property-sources-runs-list Check the run funnel after a sync or backfill
custom-property-sources-sync Run the underlying table now

Person and group targets need the warehouse-person-properties feature. A group target additionally needs the group:write scope; without it, custom-property-sources-create refuses the group definition.

The flow

1. Find the table and its columns

For a synced table, external-data-schemas-list gives you the schema id (the external_data_schema binding), and external-data-schemas-retrieve returns that schema's columns and types.

For a materialized view, view-list finds the view and its column schema, and view-get returns one view's columns by id; a view binds by saved_query instead, and must already be materialized, since an unmaterialized view has no data to read and the create call rejects it.

2. Pick the identifier column, and say why it matters

Ask which column holds the PostHog distinct ID (person targets) or the group key (group targets). This is the single most common reason a mapping silently does nothing, so do not guess it from a name like id or user_id without confirming.

Two properties of the sync are worth stating plainly before the user commits:

  • It only updates people or groups that already exist in PostHog. Rows that match nobody are skipped, and the run reports them as skipped_missing_person. It does not create people.
  • Null values are skipped, not written. A column that is null for a row leaves that property as it was. If the user expects a null to clear a property, warehouse properties will not do it.

3. Propose the mapping before creating anything

Build the full column_property_map — {warehouse_column: property_name} — and show it to the user for approval. Default to **the same name on both side

Câu hỏi thường gặp

Tôi có cần thiết lập từng cột riêng không?

Không. Toàn bộ ánh xạ cột được lưu trong một yêu cầu.

Bảng có cần đã nằm trong kho dữ liệu không?

Có. Bảng phải đang đồng bộ. Kết nối bảng là một bước thiết lập riêng.

Các dòng được ghép với người dùng như thế nào?

Mỗi dòng phải khớp với một người dùng hoặc nhóm qua cột ID hoặc khóa nhóm duy nhất.

Chi tiết

Mô tả gốc của tác giả

Populate person or group properties from a data warehouse table or materialized view, so warehouse columns become properties usable in feature flags, cohorts, and insights. Use when the user wants to "sync my Postgres columns to person properties", "map a warehouse table to people", "replace our daily identify cron", "update person properties from the warehouse", or asks for reverse ETL into PostHog. Covers picking the table and the identifier column, proposing a whole-table column mapping in one call, excluding identity and reserved properties, checking collisions with properties that already

repo: PostHog/posthog

Độ phổ biến

Sao GitHub
41k
Vị trí xếp hạng
#6845
Giấy phép
—
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự