Skip to content

Commit a97ed9f

Browse files
committed
docs(deployment): name dimension-virtual-field-refused beside the JSON-stored dimension rule
Claude-Session: https://claude.ai/code/session_016WV4d1SZmabyrNd3YLCq3J Co-authored-by: Claude <noreply@anthropic.com>
1 parent 0dd6d59 commit a97ed9f

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

‎content/docs/deployment/validating-metadata.mdx‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,23 @@ above declared `multiple: true`), is refused
247247
Group by a field that stores one value instead. Like the measure check, it
248248
stays silent when the field's type cannot be resolved.
249249

250+
A dimension over a **virtual** field, a `formula`, is refused under a second
251+
id. A formula is computed on read and never stored, whatever its `returnType`,
252+
so no driver has a column to group by: the analytics service refuses a query
253+
grouped by one with `400 INVALID_FIELD`, and refuses to compile a dataset that
254+
declares one over its own object with `400 DATASET_INVALID`, whichever members
255+
the query names. So such a dimension is refused
256+
(`dimension-virtual-field-refused`) at `datasets[N].dimensions[M].field`; a
257+
dimension through a relationship path is judged on the object the path
258+
reaches. Store the value in a field of its own (written by a hook or a flow
259+
when its source changes) and point the dimension at that field.
260+
250261
Both checks also judge the members of an analytics cube (`analyticsCubes`),
251262
because an authored cube is queried through the same analytics door. A cube
252263
dimension whose `sql` column is declared with a structured-JSON type or as a
253264
multi-value field is refused (`dimension-json-stored-field-refused`) at
254-
`analyticsCubes[N].dimensions.<key>.sql`. A cube measure is judged exactly as a
265+
`analyticsCubes[N].dimensions.<key>.sql`, and one whose `sql` column is a
266+
formula is refused (`dimension-virtual-field-refused`) at the same path. A cube measure is judged exactly as a
255267
dataset measure is, its `type` being the aggregate: a pair outside the table is
256268
refused (`measure-aggregate-field-type-refused`, at
257269
`analyticsCubes[N].measures.<key>.type`). That covers `sum`, `avg`, `min` or

0 commit comments

Comments
 (0)