Documentation
¶
Index ¶
- type Relation
- func CartesianProduct(relations ...Relation) Relation
- func Join(relations ...Relation) Relation
- func Nest(s Relation, attrAttrs frozen.Map[string, frozen.Set[string]]) Relation
- func New(header []string, tuples ...[]any) Relation
- func Project(s Relation, attrs ...string) Relation
- func Unnest(s Relation, attr string) Relation
- type RelationBuilder
- type Tuple
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Relation ¶
func CartesianProduct ¶
func Join ¶
Join returns all {x, y, z} such that s has {x, y} and t has {y, z}. x, y and z represent sets of keys:
x: keys unique to maps in s y: keys common to maps in both z: keys unique to maps in t
It is assumed that all maps in s have the same keys and likewise for t.
func Nest ¶
Nest returns a relation with some attributes nested as subrelations.
Example:
input:
_c_ _a__
|_1_|_10_|
|_1_|_11_|
|_2_|_13_|
|_3_|_11_|
|_4_|_14_|
|_3_|_10_|
|_4_|_13_|
nest(input, {aa: {a}}):
_c_ ___aa___
| 1 | _a__ |
| | |_10_| |
|___|_|_11_|_|
| 2 | _a__ |
|___|_|_13_|_|
| 3 | _a__ |
| | |_10_| |
|___|_|_11_|_|
| 4 | _a__ |
| | |_13_| |
|___|_|_14_|_|
type RelationBuilder ¶
type RelationBuilder = frozen.SetBuilder[Tuple]
Click to show internal directories.
Click to hide internal directories.