From 8a22065db769a6c7d44d41d926968d983cfa9e0e Mon Sep 17 00:00:00 2001 From: Kyle Husmann Date: Wed, 3 Apr 2024 09:59:40 -0700 Subject: [PATCH] clarify relationship to enum constraints --- content/docs/specifications/table-schema.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/specifications/table-schema.md b/content/docs/specifications/table-schema.md index bfb5bea9..d7ed3ce6 100644 --- a/content/docs/specifications/table-schema.md +++ b/content/docs/specifications/table-schema.md @@ -482,7 +482,7 @@ The `categorical` type facilitates interoperability with software packages that - [Factors (R)](https://www.stat.berkeley.edu/~s133/factors.html) - [CategoricalVectors (Julia)](https://dataframes.juliadata.org/stable/man/categorical/) -Although [`enum`](#enum) constraints can provide similar functionality for validation purposes, the `categorical` type is intended for use when data producers want to explicitly indicate to implementations that the field `SHOULD` be loaded as a categorical data type when supported by the implementation. +Although the `categorical` field type restricts a field to a finite set of possible values, like an [`enum`](#enum) constraint, the `categorical` field type enables data producers to explicitly indicate to implementations that a field `SHOULD` be loaded as a categorical data type (when supported by the implementation). By contrast, `enum` constraints simply add validation rules to existing field types. When an `enum` constraint is defined on a `categorical` field, the values in the `enum` constraint `MUST` be a subset of the physical values representing the levels of the `categorical`. The `categorical` field type `MUST` have the property `categories` that defines the set of possible values of the field. The `categories` property `MUST` be an array of strings, or an array of objects.