ipv4_to_int64¶
Description¶
Given an IPv4 address string in dotted-quad format, convert the address to an integer representing the address.
Addresses are handled in big-endian (network) byte order.
Return type¶
int64
Domain¶
This is a scalar function (calculates a single output value for a single input row.)
Categories¶
Usage¶
ipv4_to_int64(ipv4)
Argument |
Type |
Optional |
Repeatable |
Restrictions |
---|---|---|---|---|
ipv4 |
string |
no |
no |
none |
Examples¶
make_col ipint:ipv4_to_int64(ipstr)
Assuming there’s a string input column with IP addresses, outputs the corresponding parsed ip addresses as integers in network byte order.
ipstr (input) |
ipint (output) |
---|---|
8.8.4.4 |
134743044 |
10.0.0.1 |
167772161 |
10.0.0.1/16 |
null |
127.0.0.1 |
2130706433 |
127.0.0.1/24 |
null |
128.1.2.3 |
2147549699 |
172.30.2.3 |
2887647747 |
192.168.0.3 |
3232235523 |
200.1.2.3 |
3355509251 |
1.2.3.300 |
null |
1.2.3.4.5 |
null |
1.2.3 |
null |
localhost |
null |