greptimedb icon indicating copy to clipboard operation
greptimedb copied to clipboard

Disambiguatation of existing schemas.

Open v0y4g3r opened this issue 2 years ago • 1 comments

What type of enhancement is this?

Other

What does the enhancement do?

Looks like there are too many "schemas" in project:

  • ColumnSchema https://github.com/GreptimeTeam/greptimedb/blob/8959dbcef83507ccd76aaaffd2b44cab6426e68f/src/datatypes/src/schema.rs#L42

  • Schema https://github.com/GreptimeTeam/greptimedb/blob/8959dbcef83507ccd76aaaffd2b44cab6426e68f/src/datatypes/src/schema.rs#L138

  • RawSchema https://github.com/GreptimeTeam/greptimedb/blob/7ba512980a89b76f333af34fa55099f2ddab4d13/src/datatypes/src/schema/raw.rs#L24

  • ProjectedSchema https://github.com/GreptimeTeam/greptimedb/blob/0791c65149efea7fa0acec67531878dbe37186a5/src/storage/src/schema/projected.rs#L105

  • RegionSchema https://github.com/GreptimeTeam/greptimedb/blob/7ba512980a89b76f333af34fa55099f2ddab4d13/src/storage/src/schema/region.rs#L36

  • StoreSchema https://github.com/GreptimeTeam/greptimedb/blob/7ba512980a89b76f333af34fa55099f2ddab4d13/src/storage/src/schema/store.rs#L35

Not to mention there are still arrow's Shema and Parquet's schema.

We need a doc to explain:

  • why these schemas are required
  • the relations and differences of these schemas
  • when to use which schema
  • how to convert these schemas to each other

Implementation challenges

NA

v0y4g3r avatar Dec 12 '22 09:12 v0y4g3r

Find another Schema in server:

https://github.com/GreptimeTeam/greptimedb/blob/e3785fca70c73860ea4cf69a4d3516296ca088ad/src/servers/src/http.rs#L103-L105

waynexia avatar Dec 15 '22 04:12 waynexia

https://github.com/GreptimeTeam/greptimedb/blob/7d29670c8636851f1a1d65fb385fbe5b04e297e0/src/storage/src/metadata.rs#L462

There is also a ColumnsMetadata in the RegionSchema https://github.com/GreptimeTeam/greptimedb/blob/7d29670c8636851f1a1d65fb385fbe5b04e297e0/src/storage/src/schema/region.rs#L44-L49

evenyag avatar Dec 19 '22 07:12 evenyag

Now we have

MichaelScofield avatar Jun 05 '23 07:06 MichaelScofield