Skip to main content

Error message

{context}: cannot mix primitive fields (enabled_stats/stat_options) with non-primitive fields (self/properties/items)

When this error occurs

Each field or nested node is either primitive or non-primitive, and the configuration fields must match:
Node kindAllowed fields
Primitive (string, integer, float, etc.)enabled_stats, stat_options
Non-primitive (object, array)self, properties, items
This error is raised when both sets of fields appear on the same node. The design is intentional: primitive and non-primitive nodes have fundamentally different stat semantics, and mixing them creates ambiguous configurations.

Example: request that triggers this error

{
  "defaults": {
    "enabled_stats": ["value_count"]
  },
  "refresh": { "trigger": "manual" },
  "dataset": {
    "fields": [
      {
        "field_name": "address",
        "enabled_stats": ["value_count"],
        "properties": [
          {
            "path": "city",
            "enabled_stats": ["value_count"]
          }
        ]
      }
    ]
  }
}
The address field has both enabled_stats (primitive) and properties (non-primitive).

How to fix

Choose the appropriate config shape for the field’s actual schema type: If the field is an object (non-primitive):
{
  "field_name": "address",
  "self": {
    "enabled_stats": ["null_value_count"]
  },
  "properties": [
    {
      "path": "city",
      "enabled_stats": ["value_count"]
    }
  ]
}
Use self for stats on the container column and properties for named children. If the field is a primitive (string, integer, etc.):
{
  "field_name": "address",
  "enabled_stats": ["value_count"]
}
Remove properties, items, and self.