Ben Kietzman created ARROW-11509:
------------------------------------
Summary: [C++][Compute] Overhaul CanCast() helper function
Key: ARROW-11509
URL: https://issues.apache.org/jira/browse/ARROW-11509
Project: Apache Arrow
Issue Type: Bug
Components: C++
Affects Versions: 3.0.0
Reporter: Ben Kietzman
{\{CanCast(const DataType& from, const DataType& to)}} is intended to return
true iff a cast can be made between the provided types. Since it currently only
consults the type_id of the types and the kernels implementing the casts, it
will return true for some unsupported casts. For example:
{{CanCast(*list(null()), *list(list(int32())))}} currently returns true, even
though that cast is not supported. It would also be useful to provide an
overloads to specify restrictions on a cast; for example \{{CanCast(int32(),
int8(), guaranteed_safe)}} would return false since int32 may overflow when
cast to int8
--
This message was sent by Atlassian Jira
(v8.3.4#803005)