apjanke / octave-tablicious

Table (relational, tabular data) implementation for GNU Octave
https://apjanke.github.io/octave-tablicious/
GNU General Public License v3.0
29 stars 11 forks source link

Degenerate natural `realjoin` should be Cartesian product #14

Closed apjanke closed 5 years ago

apjanke commented 5 years ago

Right now, a degenerate realjoin (that is, no variable names in common) produces an error, just like a degenerate join. In relational algebra, a degenerate join (no key columns in common) produces a Cartesian product, not an error. realjoin should probably do that.

The “plain” join should not degenerate to cartesian product, for Matlab compatibility: I'm pretty sure Matlab's table's join requires at least 1 common key column, defined either naturally or by input options.

apjanke commented 5 years ago

I've added a cartesian() method so this would be easy to implement now.

apjanke commented 5 years ago

Done in https://github.com/apjanke/octave-table/commit/022d6c9bed8e7f06b390277bc67fba4de2e50440.