Open rohanjain101 opened 1 year ago
It's a good idea but there isn't a good spot for this kind of optimization today so it'll be challenging to add. It might be possible to do this with implicit casting. Type coercion (implicit casting) happens today when expressions move from unbound (not tied to any input schema) to bound (tied to a specific input schema).
This type coercion is enabled per-function so maybe SetLookupFunction could have a custom DispatchBest implementation that first attempts to dispatch exact and, if that fails, changes to a custom "always return false" function :shrug:
Either way, we don't have much precedent for this kind of thing and I think one could argue that this should be solved higher up than Arrow compute in some kind of expression rewrite pass (this doesn't exist today either).
Describe the enhancement requested
In the following example:
It would be nice if this could return false instead of raising an error, given that its impossible for 255 to be in an int8 array. This would be more in line with isin in Pandas as well:
Component(s)
Python