You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Ben Kietzman (Jira)" <ji...@apache.org> on 2021/02/05 19:18:00 UTC

[jira] [Created] (ARROW-11509) [C++][Compute] Overhaul CanCast() helper function

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)