Github user markhamstra commented on the issue:
https://github.com/apache/spark/pull/22039
Hmmm... sorry to be late to this, but making pattern matches exhaustive by
adding a catch-all case that then throws an exception, while easy, should be
considered as a less than optimal fix. Ideally, the type handling should be
tightened up so that the match can be exhaustive without a catch-all. The
reason for this is that if in the future a type is added such that the pattern
match should be extended to handle that type, then the presence of a catch-all
will give the false impression that the new type is being handled, no compiler
warning will be thrown, etc. If the pattern match is made exhaustive without a
catch-all and the compiler option to convert warnings to errors is used, then
it becomes pretty much impossible that future type additions/additional
necessary cases will be silently mishandled.
Now I realize that it is not always feasible to achieve that level of type
safety in Scala code, but has adequate consideration been given to making the
effort here, or was this just a quick hack to make the compiler shut up?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]