datacamp / sqlwhat

https://sqlwhat.readthedocs.io
GNU Affero General Public License v3.0
3 stars 8 forks source link

Support row order independent checking in check_column #81

Closed filipsch closed 7 years ago

filipsch commented 7 years ago

When checking columns, there should be an option to compare the columns without accounting for the order of the rows. This can be done brutally, by simply ordering the column and seeing what happens, or ordering by a certain column, and keeping the permutation to order other columns accordingly (which is more correct I think). As this can raise the number of steps in checking quite a bit, I think you should make this opt-in to start with.

machow commented 7 years ago

in production, using a special function sort_rows inside check_result. How about seeing how things go for the intro to sql course, and then making if opt-in if there's trouble? My feelings toward sorting have softened :p

filipsch commented 7 years ago

@machow The intro courses will not pose any difficulties performance-wise I think, so good idea! Glad to hear about the softening!

machow commented 7 years ago

@filipsch given that one of the intro-sql exercises was timing out, due to trying to COUNT and GROUP BY a table with 9 million rows. I think I might be a bit leery again...!

machow commented 7 years ago

This is currently possible through sort_rows, it just needs to be exposed to SCT creators.