You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Turns out the actual issue is due to `#[derive(PartialEq)]` on `ScalarImpl`. Its actually quite a bad thing to have as there should not be any meaningful notion of PartialEq on ScalarImpl.
BTW, could we borrow the idea of PartialOrd to return None when comparing different scalar types?
Indeed. Not sure if it would be useful, but that seems the most broad statement that is still correct.
jon-chuang
changed the title
refactor(types): Do not derive e.g. PartialEq on ScalarImpl
refactor(types): Do not derive e.g. Ord on ScalarImplOct 17, 2022
Actually, I think there should be rare cases to directly compare two datums in production: every comparison should be done by expressions (expect for the current implementation of dynamic filter). 🤔 So to avoid misusing it, maybe we can directly panic when comparing different scalar types.
Originally posted by @jon-chuang in #5771 (comment)
e.g. Int64() > Int32() is always true due to enum position rather than our actual comparison.
This doesn't seem like behaviour we would want.
If we want, we can define manually semantically correct PartialEq on ScalarImpl that agrees with our expression framework.
The text was updated successfully, but these errors were encountered: