Просто хотел поделиться.
Протестировано с Vertica 9.0. Кредит также идет на Дебру Далгли sh, чья страница блога помогла мне изначально https://contexturesblog.com/archives/2018/03/29/excel-easter-dates-and-ip-addresses/
select
ipv6,
-- hex01,
-- hex02,
-- hex03,
-- hex04,
-- ip01,
-- ip02,
-- ip03,
-- ip04,
concat(concat(concat(ip01,'.'),concat(ip02,'.')),concat(concat(ip03,'.'),ip04)) ipv4
from
(
select
ip ipv6, /* <== this is the column where the IPV6 is located */
left(right(ip, 9),2) hex01,
substring(right(ip, 9),3,2) hex02,
substring(right(ip, 9),6,2) hex03,
right(right(ip,9),2) hex04,
HEX_TO_INTEGER(left(right(ip, 9),2)) ip01,
HEX_TO_INTEGER(substring(right(ip, 9),3,2)) ip02,
HEX_TO_INTEGER(substring(right(ip, 9),6,2)) ip03,
HEX_TO_INTEGER(right(right(ip,9),2)) ip04
from <table name>
) a;