terascope / teraslice

Scalable data processing pipelines in JavaScript
https://terascope.github.io/teraslice/
Apache License 2.0
50 stars 13 forks source link

data-mate ip functions discussion #2687

Closed ciorg closed 1 month ago

ciorg commented 3 years ago

current functions:

new functions:

ciorg commented 3 years ago

other ip functions to consider:

from presto:

ip_prefix(ip_address, prefix_bits) → ipprefix#
Returns the IP prefix of a given ip_address with subnet size of prefix_bits. ip_address can be either of type VARCHAR or type IPADDRESS.

SELECT ip_prefix(CAST('192.168.255.255' AS IPADDRESS), 9); -- {192.128.0.0/9}
SELECT ip_prefix('2001:0db8:85a3:0001:0001:8a2e:0370:7334', 48); -- {2001:db8:85a3::/48}
ip_subnet_range(ip_prefix)#
Return an array of 2 IP addresses. The array contains the smallest and the largest IP address in the subnet specified by ip_prefix.

SELECT ip_subnet_range(IPPREFIX '1.2.3.160/24'); -- [{1.2.3.0}, {1.2.3.255}]
SELECT ip_subnet_range(IPPREFIX '64:ff9b::52f4/120'); -- [{64:ff9b::5200}, {64:ff9b::52ff}]

functions from ipaddr.js a module that we already use

ipv4 specific

ipv6 specific

other:

kstaken commented 1 month ago

I believe we have reasonable coverage on these now.