3 ms·
Map and project aren't the same thing. Map can't be part of the algebra because it breaks the closure property. Project is a single, specific function. I agree
by davidmathers 17y ago
Map and project aren't the same thing. Map can't be part of the algebra because it breaks the closure property. Project is a single, specific function.
I agree with your sentiment though. It looks like Nick took names from SQL where available ("where") and from relational algebra otherwise ("project"). I would rather the names came from ruby first.
- dmnd 17y agoI don't know much (anything) about relational algebra or breaking closure properties, so I'm glad my sentiment was clear despite that error. Is project different from map because it can only output a subset of the attributes that go in, whereas an arbitrary thing can come out of map?
- davidmathers 17y agoExactly. Project is just an operator that takes a table and gives you a table with a different number of attributes. All the relational operations take and return table values (aka relation values), which is what makes the algebra closed under operations. SQL select actually combines project and map (with select...as) by letting you define maps for the individual attributes of the table. That's fine since you can't break the table structure. You just can't map on tables or table rows.