Closed zfj1 closed 1 year ago
Impressive work @zfj1! Let us review and test for a bit.
Hello @zfj1. I'm going to go ahead and merge this PR to stage
, and then open up a new PR, #421 , from stage
to master
. That PR will be where your code is reviewed and changes may be requested. This process needs to be done to protect our matlab licenses.
This pull request addresses #89 and #144, adding two important features from the python implementation to MATLAB. I chose to implement these together because the universal set semantics make working with unions much easier. Specifically, since unions may not share any non-key attributes, the universal set allows promotion of non-key attributes to the primary key where appropriate.
Where possible, I've tried to mimic the python implementation. One exception is that as implemented here the universal sets support projection semantics (e.g.,
dj.U('old_key->new_key')
). I'm not sure if the python version supports this, since I don't currently have the python distribution set up, though this feature could be removed if desired.To summarize the changes for
dj.U
:dj.U
which supports restriction by, joining on, and aggregation on a relvardj.internal.GeneralRelvar.compile
which handlesdj.U
dj.internal.Header
which handles updating the primary keydistinct
field todj.internal.Header
similar to the python implementation in order to compile the sql properlyTo summarize the changes for the union operator:
dj.internal.Header
to ensure that unioned keys are compiled in the same order, as required by MySQL