【发布时间】:2020-06-02 22:23:46
【问题描述】:
我需要帮助将 postgres 函数迁移到雪花函数。
目前,我有以下函数,它接受一个 ip_address 并返回 ip_address 的起始范围:
...
begin
if (p_ip_address is not null) then
return p_ip_address::inet - '0.0.0.0';
else
return null;
end if;
end
...
我知道我们在雪花中有 PARSE_IP 提供 JSON 文件,但我只需要这个 json 的一部分 (ipv4_range_start)
例如:
Input = 192.168.242.188
Output = 3232297472
【问题讨论】:
标签: snowflake-cloud-data-platform greenplum