v.21.1New Features

Support isIPv4String and isIPv6String Functions Similar to MySQL

Support builtin function isIPv4String && isIPv6String like MySQL. #18349 (Du Chuan).
Added builtin functions isIPv4String and isIPv6String to ClickHouse, providing functionality similar to MySQL for validating IPv4 and IPv6 address strings.

Why it matters

These functions solve the problem of quickly verifying whether a given string is a valid IPv4 or IPv6 address in queries. This enhances data validation capabilities and simplifies IP address handling within ClickHouse.

How to use it

Use the functions directly in your SQL queries by calling isIPv4String(string) or isIPv6String(string). They return a boolean indicating if the string is a valid IPv4 or IPv6 address respectively. For example:

SELECT isIPv4String('192.168.0.1');
SELECT isIPv6String('2001:0db8::1');