fix joins for missing key columns#187
Conversation
|
@daikonradish @mchav, can you review this pr? |
|
We've left some comments, but in general your code looks good. Some of it is very stylish! Thank you for your effort. |
|
@mchav @daikonradish fixed all the issues. check once? |
| import Type.Reflection | ||
| import Prelude hiding (filter, take) | ||
|
|
||
| #if MIN_VERSION_random(1,3,0) |
There was a problem hiding this comment.
Does this prevent compilation? What ghc and build tool are you using?
There was a problem hiding this comment.
no for the repo’s normal build. this module enables CPP, and MIN_VERSION_random(...) is provided by cabal preprocessing. i tested it with ghc 9.10.3 and cabal-install 3.16.1.0 in the nix dev shell, and the repo ci also builds with cabal. if someone compiles the file with bare ghc outside cabal, then that macro would not be defined.
|
@mchav check now? |
| (callingFunctionName context) | ||
| errorString | ||
| show (ColumnNotFoundException columnName callPoint availableColumns) = columnNotFound columnName callPoint availableColumns | ||
| show (ColumnsNotFoundException columnNames callPoint availableColumns) = columnsNotFound columnNames callPoint availableColumns |
There was a problem hiding this comment.
I meant we should consolidate the two error paths since the two exceptions are practically the same. ColumnNotFound should be a special case of columns not found with a single element lost.
closes #118
summary
this fixes the join behavior when a requested join key does not exist. instead of silently hashing an empty key set and producing cartesian style output, joins now fail fast with the existing columnnotfoundexception.
what changed
behavior
before this change, a missing join column could fall through to hashing zero key columns, which made every row hash the same and could expand into cartesian style output. after this change, the join fails immediately with the missing column name and the existing available column context.
verification