Skip to content

Make ipv4_num_to_string function accepts int32 #7977

@killme2008

Description

@killme2008
mysql> select ipv4_num_to_string(3232235521::uint32);
+------------------------------------------------------------------+
| ipv4_num_to_string(arrow_cast(Int64(3232235521),Utf8("UInt32"))) |
+------------------------------------------------------------------+
| 192.168.0.1                                                      |
+------------------------------------------------------------------+
1 row in set (0.01 sec)

mysql> select ipv4_num_to_string(3232235521);
ERROR 1815 (HY000): (PlanQuery): Failed to plan SQL: Error during planning: Failed to coerce arguments for 'ipv4_num_to_string': cannot coerce Int64 to Exact([UInt32]). No matching function for 'ipv4_num_to_string(Int64)'. You may need an explicit cast.
    Candidate functions:
    ipv4_num_to_string(UInt32)

We could update the ipv4_num_to_string signature to accept Int32 and automatically coerce the input type.

TypeSignature::Exact(vec![DataType::UInt32]),

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions