Computed Attribute Evaluation
Computed attribute evaluation is the process by which Zeotap computes computed attribute values and materializes the results into your warehouse. This page covers the evaluation pipeline, scheduling, dependency resolution, materialization, and monitoring.
How Evaluation Works
When a computed attribute is evaluated, Zeotap performs the following steps:
- SQL Generation — The computed attribute definition (SQL query, aggregation config, or formula expression) is compiled into a warehouse-native SQL statement
- Query Execution — The SQL is executed against your data warehouse through the configured warehouse connection
- Materialization — Results are written to a dedicated computed attribute table in your warehouse’s Zeotap schema
- Status Update — The computed attribute’s evaluation status, row count, and timestamp are recorded
The entire pipeline runs warehouse-native. No data is extracted from your warehouse during evaluation — the SQL runs inside your warehouse, and results are written to a table within the same warehouse.
Materialization
Computed attribute results are materialized into a computed attribute table in your warehouse. The table is structured as:
| Column | Description |
|---|---|
entity_key | The entity identifier (e.g., user_id) |
trait_slug | The slug of the computed attribute being evaluated |
trait_value | The computed value (stored as a variant/JSON type for type flexibility) |
evaluated_at | Timestamp of when this value was computed |
This table is maintained in the CDP_PLANNER schema (or equivalent, depending on your warehouse). Zeotap creates and manages this schema automatically when you first connect a source.
During materialization, Zeotap uses a full replace strategy for the given computed attribute: all existing rows for that slug are replaced with the new results. This ensures the computed attribute table always reflects the latest evaluation.
Scheduling
Each computed attribute can be configured with an evaluation schedule:
| Schedule | Description |
|---|---|
| Manual | Only evaluated when you explicitly trigger it from the UI or API |
| Hourly | Runs every hour at a fixed minute offset |
| Daily | Runs once per day at a configured time (UTC) |
| Weekly | Runs once per week on a configured day and time (UTC) |
| Custom Cron | Arbitrary cron expression for fine-grained control |
Choosing a Schedule
Consider these factors when setting a schedule:
- Data freshness — How often does the underlying source data change? There’s no point evaluating a computed attribute hourly if the source table is only updated daily.
- Warehouse cost — Each evaluation runs a SQL query against your warehouse. More frequent evaluation means more compute credits consumed.
- Downstream dependencies — If an audience sync runs daily at 8 AM, the computed attributes it depends on should be evaluated before that time.
Dependency Resolution
Computed attributes can depend on other computed attributes. The most common case is formula computed attributes that reference other computed attributes, but the dependency graph can also include computed attributes that feed into audience definitions.
When multiple computed attributes are scheduled for evaluation at the same time, Zeotap resolves the dependency graph and evaluates them in topological order:
In this example, total_revenue and order_count are evaluated first (they have no dependencies). Then avg_order_value is evaluated (it depends on both). Then engagement_score is evaluated last (it depends on avg_order_value and days_active).
Cascade Evaluation
When a computed attribute is re-evaluated, all computed attributes that depend on it are automatically queued for re-evaluation. This cascade follows the dependency graph. You can view the dependency chain for any computed attribute on its detail page.
Circular Dependencies
Zeotap prevents circular dependencies at creation time. If you attempt to create a formula computed attribute that would form a cycle (e.g., A depends on B, B depends on A), the save operation fails with a validation error.
Evaluation Statuses
Each computed attribute evaluation run has one of the following statuses:
| Status | Description |
|---|---|
| Pending | The evaluation is scheduled but has not started yet |
| Running | The SQL query is currently executing against the warehouse |
| Completed | The evaluation finished successfully and results are materialized |
| Failed | The evaluation encountered an error (query error, permission issue, timeout, etc.) |
| Skipped | The evaluation was skipped because a dependency failed |
Monitoring Evaluations
Computed Attribute Detail Page
Each computed attribute’s detail page shows:
- Last evaluated at — Timestamp of the most recent successful evaluation
- Last evaluation status — Whether the last run succeeded or failed
- Row count — Number of entity instances that received a value
- Evaluation history — A log of recent evaluation runs with status, duration, and row counts
Evaluation Errors
When an evaluation fails, Zeotap captures and displays:
- Error message — The error returned by the warehouse (e.g., SQL syntax error, permission denied, table not found)
- Failed SQL — The exact SQL that was executed, useful for debugging
- Duration — How long the query ran before failing
Common failure causes:
| Cause | Resolution |
|---|---|
| Table or column not found | The source table was renamed or dropped. Update the computed attribute definition. |
| Permission denied | The warehouse credentials no longer have access. Check your warehouse configuration. |
| Query timeout | The query is too expensive. Optimize the SQL or increase your warehouse timeout. |
| Division by zero | A formula computed attribute divided by a computed attribute that returned zero. Add null/zero handling with IF or COALESCE. |
| Dependency failed | A computed attribute this formula depends on failed to evaluate. Fix the upstream computed attribute first. |
Manual Evaluation
You can trigger an immediate evaluation for any computed attribute:
- From the UI — Click the Evaluate Now button on the computed attribute detail page
- From the API —
POST /api/v1/traits/{id}/evaluate
Manual evaluation bypasses the schedule and runs the computed attribute immediately. If the computed attribute has dependencies, they are also evaluated first (if their current values are stale or missing).
Bulk Evaluation
When you need to re-evaluate all computed attributes for an entity type (e.g., after a data model change or source migration), use Evaluate All from the entity type’s computed attribute list page. This triggers evaluation for all computed attributes in dependency order.
Performance Considerations
- Query complexity — Complex SQL computed attributes with many joins or large table scans will take longer and cost more. Monitor execution times in the evaluation history.
- Materialization volume — Computed attributes that produce millions of rows take longer to materialize. The pipeline uses batch inserts to manage this efficiently.
- Concurrent evaluations — Zeotap limits concurrent warehouse queries to avoid overwhelming your warehouse. Computed attributes are queued and evaluated as capacity becomes available.
- Warehouse sizing — If evaluations are consistently slow, consider scaling up your warehouse compute resources. Zeotap respects your warehouse’s resource limits.
Next Steps
- SQL Computed Attributes — Write custom SQL for computed attribute evaluation
- Aggregation Computed Attributes — Visual builder for common metrics
- Formula Computed Attributes — Combine computed attributes with expressions
- Audiences — Use computed attributes to build customer segments