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: README.md
+15-1Lines changed: 15 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ Welcome!
13
13
Thanks for your interest and for taking the time to come here! ❤️
14
14
15
15
## Executive summary
16
-
This standard describes a structure for a **data contract**. Its current version is v3.0.1. It is available for you as an Apache 2.0 license. Contributions are welcome!
16
+
This standard describes a structure for a **data contract**. Its current version is v3.0.2. It is available for you as an Apache 2.0 license. Contributions are welcome!
17
17
18
18
## Discover the open standard
19
19
A reader-friendly version of the standard can be found on its [dedicated site](https://bitol-io.github.io/open-data-contract-standard/).
@@ -56,6 +56,20 @@ Check out the [CONTRIBUTING](./CONTRIBUTING.md) page.
56
56
57
57
## More
58
58
59
+
### Citation
60
+
61
+
If you need to cite this standard, you can use the following BibTeX entry:
Formerly known as the data contract template, this standard is used to implement Data Mesh at [PayPal](https://about.pypl.com/). Starting with v2.2.0, it is maintained by a 501c6 non-profit organization called [AIDA User Group (Artificial Intelligence, Data, and Analytics User Group)](https://aidaug.org). On November 30th, 2023, [AIDA User Group](https://aidaug.org) and the [Linux Foundation AI & Data](https://lfaidata.foundation/) joined forces to create [Bitol](https://bitol.io). Bitol englobes ODCS and future standards & tools.
| primaryKey | Primary Key | No | Boolean value specifying whether the field is primary or not. Default is false. |
245
245
| primaryKeyPosition | Primary Key Position | No | If field is a primary key, the position of the primary key element. Starts from 1. Example of `account_id, name` being primary key columns, `account_id` has primaryKeyPosition 1 and `name` primaryKeyPosition 2. Default to -1. |
246
-
| logicalType | Logical Type | Yes | The logical field datatype. One of `string`, `date`, `number`, `integer`, `object`, `array` or `boolean`. |
246
+
| logicalType | Logical Type | No | The logical field datatype. One of `string`, `date`, `number`, `integer`, `object`, `array` or `boolean`. |
247
247
| logicalTypeOptions | Logical Type Options | No | Additional optional metadata to describe the logical type. See [here](#logical-type-options) for more details about supported options for each `logicalType`. |
248
-
| physicalType | Physical Type | Yes | The physical element data type in the data source. For example, VARCHAR(2), DOUBLE, INT. |
248
+
| physicalType | Physical Type | No | The physical element data type in the data source. For example, VARCHAR(2), DOUBLE, INT. |
249
249
| description | Description | No | Description of the element. |
250
250
| required | Required | No | Indicates if the element may contain Null values; possible values are true and false. Default is false. |
251
251
| unique | Unique | No | Indicates if the element contains unique values; possible values are true and false. Default is false. |
@@ -270,7 +270,7 @@ Additional metadata options to more accurately define the data type.
270
270
| array | maxItems | Maximum Items | No | Maximum number of items. |
271
271
| array | minItems | Minimum Items | No | Minimum number of items. |
272
272
| array | uniqueItems | Unique Items | No | If set to true, all items in the array are unique. |
273
-
| date | format | Format | No | Format of the date. Follows the format as prescribed by [JDK DateTimeFormatter](https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html). For example, format 'yyyy-MM-dd'. |
273
+
| date | format | Format | No | Format of the date. Follows the format as prescribed by [JDK DateTimeFormatter](https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html). Default value is using ISO 8601: 'YYYY-MM-DDTHH:mm:ss.SSSZ'. For example, format 'yyyy-MM-dd'. |
274
274
| date | exclusiveMaximum | Exclusive Maximum | No | If set to true, all values are strictly less than the maximum value (values < maximum). Otherwise, less than or equal to the maximum value (values <= maximum). |
275
275
| date | exclusiveMinimum | Exclusive Minimum | No | If set to true, all values are strictly greater than the minimum value (values > minimum). Otherwise, greater than or equal to the minimum value (values >= minimum). |
276
276
| date | maximum | Maximum | No | All date values are less than or equal to this value (values <= maximum). |
@@ -289,6 +289,53 @@ Additional metadata options to more accurately define the data type.
289
289
| string | minLength | Minimum Length | No | Minimum length of the string. |
290
290
| string | pattern | Pattern | No | Regular expression pattern to define valid value. Follows regular expression syntax from ECMA-262 (https://262.ecma-international.org/5.1/#sec-15.10.1). |
291
291
292
+
#### Expressing Date / Datetime / Timezone information
293
+
294
+
Given the complexity of handling various date and time formats (e.g., date, datetime, time, timestamp, timestamp with and without timezone), the existing `logicalType` options currently support only `date`. To specify additional temporal details, `logicalType` should be used in conjunction with `logicalTypeOptions.format` or `physicalType` to define the desired format. Using `physicalType` allows for definition of your data-source specific data type.
295
+
296
+
``` yaml
297
+
version: 1.0.0
298
+
kind: DataContract
299
+
id: 53581432-6c55-4ba2-a65f-72344a91553a
300
+
status: active
301
+
name: date_example
302
+
apiVersion: v3.0.2
303
+
schema:
304
+
# Date Only
305
+
- name: event_date
306
+
logicalType: date
307
+
logicalTypeOptions:
308
+
- format: "yyyy-MM-dd"
309
+
examples:
310
+
- "2024-07-10"
311
+
312
+
# Date & Time (UTC)
313
+
- name: created_at
314
+
logicalType: date
315
+
logicalTypeOptions:
316
+
- format: "yyyy-MM-ddTHH:mm:ssZ"
317
+
examples:
318
+
- "2024-03-10T14:22:35Z"
319
+
320
+
# Time Only
321
+
- name: event_start_time
322
+
logicalType: date
323
+
logicalTypeOptions:
324
+
- format: "HH:mm:ss"
325
+
examples:
326
+
- "08:30:00"
327
+
328
+
# Physical Type with Date & Time (UTC)
329
+
- name: event_date
330
+
logicalType: date
331
+
physicalType: DATETIME
332
+
logicalTypeOptions:
333
+
- format: yyyy-MM-ddTHH:mm:ssZ"
334
+
examples:
335
+
- "2024-03-10T14:22:35Z"
336
+
337
+
```
338
+
292
339
### Authoritative definitions
293
340
294
341
Reference to an external definition on element logic or values.
@@ -595,7 +642,7 @@ team:
595
642
dateIn: 2022-10-01
596
643
- username: daustin
597
644
role: Owner
598
-
comment: Keeper of the grail
645
+
description: Keeper of the grail
599
646
name: David Austin
600
647
dateIn: 2022-10-01
601
648
```
@@ -607,6 +654,8 @@ The UX label is the label used in the UI and other user experiences.
0 commit comments