You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(catalog): add user_profiles_mv and user_labels tables (#88)
Document two new warehouse tables in the data catalog:
- user_profiles_mv: project-scoped, first-party identify traits, placed
next to identities as the identity-data counterpart to
wallet_profiles_mv. Flagged as an AggregatingMergeTree with a -Merge /
argMaxIfMerge querying note.
- user_labels: project-scoped labels you assign to addresses, placed next
to wallet_profiles_labels (its global counterpart). Omits the internal
_is_deleted column to match the wallet_profiles_labels entry.
Also list user_profiles_mv in the aggregate-tables section and add an
argMaxIf row to the quick reference.
Claude-Session: https://claude.ai/code/session_01XeF9u7YLwBCXtsADz9esGH
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: data/catalog.mdx
+56-1Lines changed: 56 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -364,6 +364,43 @@ LIMIT 20
364
364
365
365
---
366
366
367
+
### user_profiles_mv
368
+
369
+
Project-scoped, first-party **user profile traits** captured from `identify` events. One row per `address`, holding the latest value of each trait. This is the identity-data counterpart to `wallet_profiles_mv` (which holds public onchain profile data); `user_profiles_mv` holds the traits *you* send.
370
+
371
+
**Use cases:** User enrichment, first-party identity resolution, personalization, outreach
372
+
373
+
<Warning>
374
+
This is an **aggregate table** (`AggregatingMergeTree`). Each trait is stored as an aggregate state, so read it with `-Merge` functions (e.g. `argMaxIfMerge(email)`) and always `GROUP BY address`. Never use `SELECT *`. See [Working with Aggregate Tables](#working-with-aggregate-tables).
375
+
</Warning>
376
+
377
+
| Column | Type | Description |
378
+
|--------|------|-------------|
379
+
|`address`| String | Wallet address (primary key within your project) |
380
+
|`user_id`| String | Your own external user identifier |
|`updated_at`| DateTime | Last time any trait was updated |
390
+
391
+
**Example:**
392
+
393
+
```sql
394
+
SELECT
395
+
address,
396
+
argMaxIfMerge(display_name) AS display_name,
397
+
argMaxIfMerge(email) AS email
398
+
FROM user_profiles_mv
399
+
GROUP BY address
400
+
```
401
+
402
+
---
403
+
367
404
### wallet_profiles_mv
368
405
369
406
Global wallet profile data aggregated across all chains. One row per wallet address with social profiles, contact info, and net worth.
@@ -509,6 +546,23 @@ Wallet labels and tags for categorizing and filtering wallet addresses. Each row
509
546
510
547
---
511
548
549
+
### user_labels
550
+
551
+
Project-scoped **labels and tags you assign to wallet addresses** (e.g. your own segments, scores, or categories). The latest value per `(tag_id, address, chain_id)` is kept automatically. This is the project-specific counterpart to `wallet_profiles_labels`, which holds **global** labels supplied by Formo's wallet profiler.
|`chain_id`| String | Chain the label applies to (`-` for all chains) |
559
+
|`tag_id`| String | Label / tag identifier |
560
+
|`value`| String | Optional label value or score |
561
+
|`source`| String | System that supplied the label |
562
+
|`timestamp`| DateTime | When the label was last updated |
563
+
564
+
---
565
+
512
566
## Table relationships
513
567
514
568
```
@@ -646,7 +700,7 @@ ORDER BY date
646
700
647
701
## Working with aggregate tables
648
702
649
-
Several tables (`users`, `anonymous_users`, `sessions`, `sources`, `identities`) use ClickHouse [AggregateFunction](https://clickhouse.com/docs/en/sql-reference/data-types/aggregatefunction) types. These store intermediate aggregation states, not final values.
703
+
Several tables (`users`, `anonymous_users`, `sessions`, `sources`, `identities`, `user_profiles_mv`) use ClickHouse [AggregateFunction](https://clickhouse.com/docs/en/sql-reference/data-types/aggregatefunction) types. These store intermediate aggregation states, not final values.
0 commit comments