bustub icon indicating copy to clipboard operation
bustub copied to clipboard

fix(executor): add sum column for test

Open skyzh opened this issue 3 years ago • 5 comments

Signed-off-by: Alex Chi [email protected]

close https://github.com/cmu-db/bustub/issues/260

tested with sample solution, which works fine.

By the way, it seems that all our execution tests' test data are randomly generated (table_generator.cpp), which might make things hard when someone want to debug their code and see what's wrong. I will look into the possibility of having some tables of fixed value in our tests in the future if possible.

skyzh avatar Aug 07 '22 16:08 skyzh

// Should have sum_c >= 0

... because table test_1's colC has uniform distribution of 0-9999. So we can only assert >=0 here. The check is somehow meaningless, but at least we can check if the column is present or not.

skyzh avatar Aug 07 '22 16:08 skyzh

On randomly generated test data: it is OK if you make the student-facing tests deterministic and easy to debug, but the private grading tests should remain effectively random and unguessable by students. This is to prevent people from hard-coding answers by trying to leak test information from autograder output.

lmwnshn avatar Aug 07 '22 16:08 lmwnshn

Not sure whether sum_c aggregator is using column A or C. I'll look into the code and ensure this fix is correct before merging.

skyzh avatar Aug 07 '22 16:08 skyzh

... because table test_1's colC has uniform distribution of 0-9999. So we can only assert >=0 here. The check is somehow meaningless, but at least we can check if the column is present or not.

I would add this to the test comments directly so that students do not puzzle over what the test is trying to do.

lmwnshn avatar Aug 07 '22 16:08 lmwnshn

Not sure whether sum_c aggregator is using column A or C. I'll look into the code and ensure this fix is correct before merging.

It should be using colC now. Also added comments about the sumC >= 0 check.

skyzh avatar Aug 07 '22 17:08 skyzh

Is this confirmed to work with the refsols? It looks good to me, I just want to verify before approval.

garrisonhess avatar Aug 20 '22 03:08 garrisonhess

Yes it works for refsol.

skyzh avatar Aug 20 '22 03:08 skyzh