User loginNavigation |
For a relational language, how treat KeyValues, Streams in relations with operators that add or remove "columns"I'm building a relational language where I wish to treat everything as a relation. The main point is to provide a common core of relational operators (aka: Queries) that work across all. A "relation" here is a table with a header of fields, columns and rows. I have a container that match directly this, that internally is an array:
Now, I have other containers that are Key/Value like a hashmap and BTreeMap, and single value like Generators, ranges and vectors. Only generators, as being read-only forward-only can be say to output a fixed schema. You can say a hashmap, for example, is a relation that look like:
And a vector one like
With all of them, I wanna provide the same operations like:
Now my dilema is what to do for some operations that add or remove columns, like joins and projection:
What could be the best option here? 1- Say that kv/array have fixed schemas and can't grow or shrink their headers 2- Say a KV only have fixed the KEY and the value header is flattened, so it become:
The problem is not what OUTPUT. I could just output tuples. Is how REPRESENT the relation if it be more than the KV. So, If I have 10 columns, what is the best option to put inside a KV? Consider that the relational model allow to rename columns, and add and remove them. Another problem is that KV like Btree allow to model... trees. If I think instead of Btree as a index behind a table, the language lost the ability of "naturally" model trees. BTW, I wanna to have AGDTs. P.D: Other potential question is: What kind of container could work alike "table" but also alike hashmaps/trees? How model a type that allow several "backends"? P.D: Originally here: https://www.reddit.com/r/ProgrammingLanguages/comments/awkdrb/for_a_relational_language_how_treat_kv_and/ but not good answers... so I ask here with a bit of more details. By mamcx at 2019-03-18 01:40 | LtU Forum | previous forum topic | next forum topic | other blogs | 6452 reads
|
Browse archives
Active forum topics |
Recent comments
20 weeks 1 day ago
20 weeks 1 day ago
20 weeks 1 day ago
42 weeks 2 days ago
46 weeks 4 days ago
48 weeks 1 day ago
48 weeks 1 day ago
50 weeks 6 days ago
1 year 3 weeks ago
1 year 3 weeks ago