Make ipv4_num_to_string function accepts int32
good first issuehelp wanted
```sql
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.
https://github.com/GreptimeTeam/greptimedb/blob/8a3bd374a89a74fc2dff9ef24d55a71b30c4e1f0/src/common/function/src/scalars/ip/ipv4.rs#L47
0 条评论