Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#46] docs: update the rfc-1 to adapt to the newly designed schema system (#47)

Jerry Shaoacbd882720ef
diff --git a/rfc/rfc-1/catalog-interface.png b/rfc/rfc-1/catalog-interface.png
new file mode 100644
index 0000000000..391979ae47
Binary files /dev/null and b/rfc/rfc-1/catalog-interface.png differ
diff --git a/rfc/rfc-1/rfc-1.md b/rfc/rfc-1/rfc-1.md
index fff705f3d3..a7488f4063 100644
--- a/rfc/rfc-1/rfc-1.md
+++ b/rfc/rfc-1/rfc-1.md
@@ -3,6 +3,7 @@
| Revision | Owner |
| :------- | ---------- |
| v0.1 | Jerry Shao |
+| v0.2 | Jerry Shao |
## Design Prerequisites
@@ -38,7 +39,7 @@ Disadvantages:
Substrait’s type system can be referred here https://substrait.io/types/type_system/.
-## Schema System
+## Meta System
### Prerequisites
@@ -47,6 +48,15 @@ Substrait’s type system can be referred here https://substrait.io/types/type_s
### Schema Entities
+The schema system in Graviton is organized like below:
+
+![Schema System](schema-overview.png)
+
+1. **Lakehouse**: lakehouse is a top-level container that manages all the metadata from DB/EDW, Hive/Iceberg/Hudi, plain files, MQ and others.
+2. **Catalog**: catalog is a collection of metadata from a specific metadata source. For example, “hive.db.table” means this table belongs to Hive catalog under the DB “db”.
+3. **Connector**: connector is 1 to 1 mapping to catalog, 1 connector is binding to 1 catalog, and 1 catalog only has 1 connector. The connector defines how to connect the underlying metadata source.
+4. **Metadata Structure**: metadata structure is defined per metadata source. For example, JDBC and Hive catalog follow “db.table” pattern, file catalog follows “scheme:///<file_path>” pattern.
+
#### SchemaVersion
| Field Name | Field Type | Description | Optional |
@@ -62,18 +72,6 @@ Substrait’s type system can be referred here https://substrait.io/types/type_s
| create_time | timestamp | Google Protobuf timestamp type to represent when entity is created | Required |
| last_modifier | string | The name of user who modified the schema entity last time | Optional |
| last_modified_time | timestamp | Google Protobuf timestamp type to represent when entity is modified | Optional |
-| last_access_user | string | The name of user who acecess the schema entity last time | Optional |
-| last_access_time | timestamp | Google Protobuf timestamp type to represent when entity is accessed | Optional |
-
-#### Tenant
-
-| Field Name | Field Type | Description | Optional |
-| ---------- | ------------- | ------------------------------------------------------------ | -------- |
-| id | uint32 | The unique identifier of the tenant, this is generated by the system | Required |
-| name | string | The name of the tenant | Required |
-| comment | string | The comment of the tenant | Optional |
-| audit_info | AuditInfo | The audit info of the tenant | Required |
-| version | SchemaVersion | The version info of the tenant | Required |
#### Lakehouse
@@ -84,61 +82,26 @@ Substrait’s type system can be referred here https://substrait.io/types/type_s
| comment | string | The comment of the lakehouse | Optional |
| properties | map<string, string> | The properties of the lakehouse | Optional |
| audit_info | AuditInfo | The detailed audit info of lakehouse | Required |
+| version | SchemaVersion | The version info of the stored schema | Required |
-#### Zone
-
-| Field Name | Field Type | Description | Optional |
-| ------------ | ------------------- | ------------------------------------------------------------ | -------- |
-| id | uint64 | The unique identifier of the zone, this is generated by the system | Required |
-| lakehouse_id | uint64 | The unique identifier of the lakehouse which includes this zone | Required |
-| name | string | The name of the zone | Required |
-| comment | string | The comment of the Zone | Required |
-| properties | map<string, string> | The properties of the zone | Optional |
-| audit_info | AuditInfo | The audit info of the zone | Required |
-
-#### Entity
-
-##### Column
-
-| Field Name | Field Type | Description | Optional |
-| ------------------ | -------------- | ------------------------------------------------------------ | -------- |
-| id | uint32 | The unique identifier of the column | Required |
-| entity_id | uint64 | The unique identifier of the parent entity which this column belongs to | Required |
-| entity_snapshot_id | uint64 | The snapshot id of the parent entity which this column belongs to | Required |
-| name | string | The name of the column | Required |
-| type | Substrait Type | The type of the column | Required |
-| comment | string | The comment of the column | Optional |
-| position | uint32 | The position of the column | Required |
-| audit_info | AuditInfo | The audit info of the zone | Required |
-
-Note. The `type` field serialization and deserialization need to follow Substrait's way.
-
-##### Table
-
-**ExtraInfo - VirtualTableInfo**
-
-| Field Name | Field Type | Description | Optional |
-| ------------------- | --------------- | --------------------------------------- | -------- |
-| connection_id (TBD) | uint32 | The unique identifier of the connection | Required |
-| identifier | repeated string | The identifier of the physical table | Required |
-
-**ExtraInfo - ViewTableInfo**
-
-**ExtraInfo - ExternalTableInfo**
+#### Catalog
-**ExtraInfo - ManagedTableInfo**
+| Field Name | Field Type | Description | Optional |
+| ------------ | -------------------------------------- | ------------------------------------------------------------ | -------- |
+| id | uint64 | The unique identifier of the catalog, this is generated by the system | Required |
+| lakehouse_id | uint64 | The unique identifier of the lakehouse which includes this catalog | Required |
+| name | string | The name of the catalog | Required |
+| comment | string | The comment of the catalog | Required |
+| type | Enum of {RELATIONAL, FILE, STREAM, ML} | The type of the catalog, currently we support is "RELATIONAL" (catalog for relational data structure) | Required |
+| properties | map<string, string> | The properties of the catalog | Optional |
+| audit_info | AuditInfo | The audit info of the catalog | Required |
+##### Catalog for relational data structure
+The relational data structure referrers data stored in DB or DWS, and organized hierarchically like `db.table` or `a.b.c`. With such metadata, we defined several catalog interfaces to support manipulating relational metadata.
-| Field Name | Field Type | Description | Optional |
-| ----------- | ------------------- | ------------------------------------------------------------ | -------- |
-| id | uint64 | The unique identifier of the table | Required |
-| zone_id | uint64 | The unique identifier of the zone which this table belongs to | Required |
-| name | string | The name of the table | Required |
-| comment | string | The comment of the table | Optional |
-| type | TableType enum | The type of table | Required |
-| snapshot_id | uint64 | The snapshot id of the table | Required |
-| properties | map<string, string> | The properties of the table | Optional |
-| audit_info | AuditInfo | The audit info of the table | Required |
-| extra_info | oneof ExtraInfo | The extra info of the table | Required |
+![catalog-interface](catalog-interface.png)
+* **BaseCatalog**: `BaseCatalog` is the base class for catalog, the implementation should inherit it to implement its own.
+* **SupportNamespaces**: `SupportNamespaces` provides the APIs to create structured metadata, like `Database`.
+* **TableCatalog**: `TableCatalog` defines the APIs to manipulate `Table` and it's `Column` entities. The specific `TableCatalog` implementation should also implement `Table` and `Column` to satisfy the specific underlying metadata source.
diff --git a/rfc/rfc-1/schema-overview.png b/rfc/rfc-1/schema-overview.png
new file mode 100644
index 0000000000..1bb361bc63
Binary files /dev/null and b/rfc/rfc-1/schema-overview.png differ