You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/standard/table-schema.mdx
+247Lines changed: 247 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -647,76 +647,323 @@ A constraints descriptor `MUST` be a JSON `object` and `MAY` contain one or more
647
647
648
648
Indicates whether this field cannot be `null`. If required is `false` (the default), then `null` is allowed. See the section on `missingValues` for how, in the physical representation of the data, strings can represent `null` values.
Will be invalid because the `name` field has a value that is too long.
754
+
671
755
### `minimum`
672
756
673
757
-**Type**: integer, number, date, time, datetime, duration, year, yearmonth
674
758
-**Fields**: integer, number, date, time, datetime, duration, year, yearmonth
675
759
676
760
Specifies a minimum value for a field. This is different to `minLength` which checks the number of items in the value. A `minimum` value constraint checks whether a field value is greater than or equal to the specified value. The range checking depends on the `type` of the field. E.g. an integer field may have a minimum value of 100; a date field might have a minimum date. If a `minimum` value constraint is specified then the field descriptor `MUST` contain a `type` key.
Will be invalid because the `price` field has a value that is too high.
870
+
699
871
### `jsonSchema`{#jsonSchema}
700
872
701
873
-**Type**: object
702
874
-**Fields**: array, object
703
875
704
876
A valid JSON Schema object to validate field values. If a field value conforms to the provided JSON Schema then this field value is valid.
705
877
878
+
For example, this data file:
879
+
880
+
```csv
881
+
id,name,price
882
+
1,apple,{"value": 100}
883
+
2,orange,{"value": "bad"}
884
+
```
885
+
886
+
With this schema definition:
887
+
888
+
```json
889
+
{
890
+
"fields": [
891
+
{ "name": "id", "type": "integer" },
892
+
{ "name": "name", "type": "string" },
893
+
{
894
+
"name": "price",
895
+
"type": "object",
896
+
"constraints": {
897
+
"jsonSchema": {
898
+
"type": "object",
899
+
"properties": {
900
+
"value": { "type": "integer" }
901
+
}
902
+
}
903
+
}
904
+
}
905
+
]
906
+
}
907
+
```
908
+
909
+
Will be invalid because the `price` field has a value that is not an integer.
910
+
706
911
### `pattern`
707
912
708
913
-**Type**: string
709
914
-**Fields**: string
710
915
711
916
A regular expression that can be used to test field values. If the regular expression matches then the value is valid. The values of this field `MUST` conform to the standard [XML Schema regular expression syntax](http://www.w3.org/TR/xmlschema-2/#regexs).
0 commit comments