Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elevate schema to a first-class construct, deprecate table? #45

Open
hollasch opened this issue Jun 8, 2021 · 0 comments
Open

Elevate schema to a first-class construct, deprecate table? #45

hollasch opened this issue Jun 8, 2021 · 0 comments

Comments

@hollasch
Copy link
Owner

hollasch commented Jun 8, 2021

Or put another way, should a table just be an array with a schema? Note that graphs also employ schemas, which is essentially just a vector of name-type information. Current approach:

[# // Table
    [ id:(integer32:0) name:(text:) rank:(double:0) ]  // First array is interpreted as a schema
    [ ... ] // Data row 1
    [ ... ] // Data row 2
    [ ... ] // Data row 3
    ...
#]

Instead, if a schema was enclosed in [# ... #] delimeters (to use a stand-in for now), a table would just be an array with a schema:

[ // Regular array (so far)
    [#[ ... ]#]  // Schema must be first element. A schema is an array of name-type information.
    [ ... ]   // Data row 1
    [ ... ]   // Data row 2
    [ ... ]   // Data row 3
    ...
]

It is still an open question whether we should allow rows without explicit brackets. That is, given a schema with N elements, the first N elements would define row 1, the next N elements row 2, and so on. It would be an error for an array with schema of size N to have M elements, where M mod N ≠ 0.

Note that a typed array is then just a table with a schema of a single component:

[[#(double:0)#] 1, 3.4, -8.6, 10.2, 0, 0, 1.8 ]

There's a possible problem with this approach, since graph nodes or edges can be tables. If we eliminate a special table signifier (something in [# ... #] delimeters), then the "array with a schema is a table" has to be well understood. I think that's ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant