Skip to content

Commit b0afb0d

Browse files
committed
docs(validating-metadata): the dataset rule reads the multiple flag for count_distinct, and judges dimensions
The page's account of measure-aggregate-field-type-refused now says that count_distinct over a multi-capable field declared multiple: true is refused, and that dimension-json-stored-field-refused refuses a dataset dimension over a structured-JSON or multi-value field. Claude-Session: https://claude.ai/code/session_01Sfe5YjBLwB9J3y8fvm2xq1 Co-authored-by: Claude <noreply@anthropic.com>
1 parent be20968 commit b0afb0d

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

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

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,26 @@ no such function and fails at query time. `min`/`max` over the same field are
210210
accepted over every type, because it reads no value, and `count_distinct` over
211211
every type but the JSON-stored ones (the structured-JSON types and
212212
`multiselect` / `checkboxes` / `tags`), whose values no two backends compare
213-
for equality alike. The analytics service refuses the same pair with
214-
`400 DATASET_INVALID` when a query is built; this is the identical verdict,
213+
for equality alike. The check reads the field's declaration as well as its
214+
type: a `select`, `radio`, `lookup`, `user`, `file` or `image` field declared
215+
`multiple: true` holds a list stored as JSON, so `count_distinct` over it is
216+
refused too, although the table accepts the type. The analytics service
217+
refuses the same pair with `400 DATASET_INVALID` when a query is built; this
218+
is the identical verdict,
215219
from the identical table, one door earlier. The rule stays silent wherever the
216220
field's type cannot be resolved (an object this stack does not define, a
217221
dangling field path, an untyped field) rather than guessing.
218222

223+
The same check judges the dataset's **dimensions**, under its own id. A
224+
dimension is a group key, and the analytics service refuses a query grouped by
225+
a JSON-stored column with `400 INVALID_FIELD` before any SQL is built. So a
226+
dimension whose field is declared with a structured-JSON type, or as a
227+
multi-value field (`multiselect` / `checkboxes` / `tags`, or one of the types
228+
above declared `multiple: true`), is refused
229+
(`dimension-json-stored-field-refused`) at `datasets[N].dimensions[M].field`.
230+
Group by a field that stores one value instead. Like the measure check, it
231+
stays silent when the field's type cannot be resolved.
232+
219233
### 7. Navigation exposing objects nobody can read
220234

221235
Navigation and permissions are separate metadata, each valid on its own — so an

0 commit comments

Comments
 (0)