2021-08-11 17:17:55 +00:00
# Table
This schema defines the Table entity. A Table organizes data in rows and columns and is defined by a Schema. OpenMetadata does not have a separate abstraction for Schema. Both Table and Schema are captured in this entity.
2021-08-13 15:48:38 +00:00
**$id:** [**https://open-metadata.org/schema/entity/data/table.json** ](https://open-metadata.org/schema/entity/data/table.json )
2021-08-11 17:17:55 +00:00
Type: `object`
## Properties
2021-08-13 15:48:38 +00:00
* **id** `required`
* Unique identifier of this table instance.
2021-08-16 05:20:54 +00:00
* $ref: [../../type/basic.json\#/definitions/uuid ](../types/basic.md#types-definitions-in-this-schema )
2021-08-13 15:48:38 +00:00
* **name** `required`
* Name of a table. Expected to be unique within a database.
2021-08-16 05:20:54 +00:00
* $ref: [\#/definitions/tableName ](table.md#types-definitions-in-this-schema )
2021-08-13 15:48:38 +00:00
* **description**
* Description of a table.
* Type: `string`
* **href**
* Link to this table resource.
2021-08-16 05:20:54 +00:00
* $ref: [../../type/basic.json\#/definitions/href ](../types/basic.md#types-definitions-in-this-schema )
2021-08-13 15:48:38 +00:00
* **tableType**
* $ref: [\#/definitions/tableType ](table.md#/definitions/tableType )
* **fullyQualifiedName**
* Fully qualified name of a table in the form `serviceName.databaseName.tableName` .
* Type: `string`
* **columns** `required`
* Columns in this table.
* Type: `array`
* **Items**
2021-08-16 05:20:54 +00:00
* $ref: [\#/definitions/column ](table.md#types-definitions-in-this-schema )
2021-08-13 15:48:38 +00:00
* **tableConstraints**
* Table constraints.
* Type: `array`
* **Items**
2021-08-16 05:20:54 +00:00
* $ref: [\#/definitions/tableConstraint ](table.md#types-definitions-in-this-schema )
2021-08-13 15:48:38 +00:00
* **usageSummary**
* Latest usage information for this table.
2021-08-16 05:20:54 +00:00
* $ref: [../../type/usageDetails.json ](../types/usage-details.md )
2021-08-13 15:48:38 +00:00
* **owner**
* Owner of this table.
2021-08-16 05:20:54 +00:00
* $ref: [../../type/entityReference.json ](../types/entity-reference.md )
2021-08-13 15:48:38 +00:00
* **followers**
* Followers of this table.
2021-08-16 05:20:54 +00:00
* $ref: [../../type/entityReference.json\#/definitions/entityReferenceList ](../types/entity-reference.md#types-definitions-in-this-schema )
2021-08-13 15:48:38 +00:00
* **database**
* Reference to Database that contains this table.
2021-08-16 05:20:54 +00:00
* $ref: [../../type/entityReference.json ](../types/entity-reference.md )
2021-08-13 15:48:38 +00:00
* **tags**
* Tags for this table.
* Type: `array`
* **Items**
2021-08-16 05:20:54 +00:00
* $ref: [../../type/tagLabel.json ](../types/tag-label.md )
2021-08-13 15:48:38 +00:00
* **joins**
* Details of other tables this table is frequently joined with.
2021-08-16 05:20:54 +00:00
* $ref: [\#/definitions/tableJoins ](table.md#types-definitions-in-this-schema )
2021-08-13 15:48:38 +00:00
* **sampleData**
* Sample data for a table.
2021-08-16 05:20:54 +00:00
* $ref: [\#/definitions/tableData ](table.md#types-definitions-in-this-schema )
2021-08-11 17:17:55 +00:00
## Types definitions in this schema
2021-08-13 15:48:38 +00:00
**tableType**
2021-08-13 08:26:20 -07:00
2021-08-13 15:48:38 +00:00
* This schema defines the type used for describing different types of tables.
* Type: `string`
* The value is restricted to the following:
1. _"Regular"_
2. _"External"_
3. _"View"_
4. _"SecureView"_
5. _"MaterializedView"_
2021-08-11 17:17:55 +00:00
**columnDataType**
2021-08-13 15:48:38 +00:00
* This enum defines the type of data stored in a column.
* Type: `string`
* The value is restricted to the following:
1. _"NUMBER"_
2. _"TINYINT"_
3. _"SMALLINT"_
4. _"INT"_
5. _"BIGINT"_
6. _"FLOAT"_
7. _"DOUBLE"_
8. _"DECIMAL"_
9. _"NUMERIC"_
10. _"TIMESTAMP"_
11. _"TIME"_
12. _"DATE"_
13. _"DATETIME"_
14. _"INTERVAL"_
15. _"STRING"_
16. _"MEDIUMTEXT"_
17. _"TEXT"_
18. _"CHAR"_
19. _"VARCHAR"_
20. _"BOOLEAN"_
21. _"BINARY"_
22. _"VARBINARY"_
23. _"ARRAY"_
24. _"BLOB"_
25. _"LONGBLOB"_
26. _"MEDIUMBLOB"_
27. _"MAP"_
28. _"STRUCT"_
29. _"UNION"_
30. _"SET"_
31. _"GEOGRAPHY"_
32. _"ENUM"_
33. _"JSON"_
2021-08-11 17:17:55 +00:00
**columnConstraint**
2021-08-13 15:48:38 +00:00
* This enum defines the type for column constraint.
* Type: `string`
* The value is restricted to the following:
1. _"NULL"_
2. _"NOT\_NULL"_
3. _"UNIQUE"_
4. _"PRIMARY\_KEY"_
* Default: _"NULL"_
2021-08-11 17:17:55 +00:00
**tableConstraint**
2021-08-13 15:48:38 +00:00
* This enum defines the type for table constraint.
* Type: `object`
* **Properties**
* **constraintType**
* Type: `string`
* The value is restricted to the following:
1. _"UNIQUE"_
2. _"PRIMARY\_KEY"_
3. _"FOREIGN\_KEY"_
* **columns**
* List of column names corresponding to the constraint.
* Type: `array`
* **Items**
* Type: `string`
2021-08-11 17:17:55 +00:00
**columnName**
2021-08-13 15:48:38 +00:00
* Local name \(not fully qualified name\) of the column.
* Type: `string`
* The value must match this pattern: `^[^.]*$`
* Length: between 1 and 64
2021-08-11 17:17:55 +00:00
**tableName**
2021-08-13 15:48:38 +00:00
* Local name \(not fully qualified name\) of a table.
* Type: `string`
* The value must match this pattern: `^[^.]*$`
* Length: between 1 and 64
2021-08-11 17:17:55 +00:00
**fullyQualifiedColumnName**
2021-08-13 15:48:38 +00:00
* Fully qualified name of the column that includes `serviceName.databaseName.tableName.columnName` .
* Type: `string`
* Length: between 1 and 256
2021-08-11 17:17:55 +00:00
**column**
2021-08-13 15:48:38 +00:00
* This schema defines the type for a column in a table.
* Type: `object`
* **Properties**
* **name** `required`
* $ref: [\#/definitions/columnName ](table.md#/definitions/columnName )
* **columnDataType** `required`
* Data type of the column \(int, date etc.\).
* $ref: [\#/definitions/columnDataType ](table.md#/definitions/columnDataType )
* **description**
* Description of the column.
* Type: `string`
* **fullyQualifiedName**
* $ref: [\#/definitions/fullyQualifiedColumnName ](table.md#/definitions/fullyQualifiedColumnName )
* **tags**
* Tags associated with the column.
* Type: `array`
* **Items**
* $ref: [../../type/tagLabel.json ](table.md#....typetaglabel.json )
* **columnConstraint**
* Column level constraint.
* $ref: [\#/definitions/columnConstraint ](table.md#/definitions/columnConstraint )
* **ordinalPosition**
* Ordinal position of the column.
* Type: `integer`
2021-08-11 17:17:55 +00:00
**columnJoins**
2021-08-13 15:48:38 +00:00
* This schema defines the type to capture how frequently a column is joined with columns in the other tables.
* Type: `object`
* This schema does not accept additional properties.
* **Properties**
* **columnName**
* $ref: [\#/definitions/columnName ](table.md#/definitions/columnName )
* **joinedWith**
* Fully qualified names of the columns that this column is joined with.
* Type: `array`
* **Items**
* Type: `object`
* **Properties**
* **fullyQualifiedName**
* $ref: [\#/definitions/fullyQualifiedColumnName ](table.md#/definitions/fullyQualifiedColumnName )
* **joinCount**
* Type: `integer`
2021-08-11 17:17:55 +00:00
**tableJoins**
2021-08-13 15:48:38 +00:00
* This schema defines the type to capture information about how columns in this table are joined with columns in the other tables.
* Type: `object`
* This schema does not accept additional properties.
* **Properties**
* **startDate**
* Date can be only from today going back to last 29 days.
* $ref: [../../type/basic.json\#/definitions/date ](table.md#....typebasic.jsondefinitionsdate )
* **dayCount**
* Type: `integer`
* Default: `1`
* **columnJoins**
* Type: `array`
* **Items**
* $ref: [\#/definitions/columnJoins ](table.md#/definitions/columnJoins )
2021-08-11 17:17:55 +00:00
**tableData**
2021-08-13 15:48:38 +00:00
* This schema defines the type to capture rows of sample data for a table.
* Type: `object`
* This schema does not accept additional properties.
* **Properties**
* **columns**
* List of local column names \(not fully qualified column names\) of the table.
* Type: `array`
* **Items**
* $ref: [\#/definitions/columnName ](table.md#/definitions/columnName )
* **rows**
* Data for multiple rows of the table.
* Type: `array`
* **Items**
* Data for a single row of the table within the same order as columns fields.
* Type: `array`
2021-08-11 17:17:55 +00:00