v.20.12Improvement

Add cutToFirstSignificantSubdomainWithWWW() function

Add cutToFirstSignificantSubdomainWithWWW(). #16845 (Azat Khuzhin).
Added the function cutToFirstSignificantSubdomainWithWWW() to extract the first significant subdomain from domain names, including handling the 'www' prefix.

Why it matters

This function addresses the need to simplify domain names by extracting their most relevant subdomain segment, helping users analyze and aggregate web traffic or domain-related data more effectively by normalizing domains with or without the 'www' prefix.

How to use it

Use the function in SQL queries as cutToFirstSignificantSubdomainWithWWW(domain_column) to return the first significant subdomain including the 'www' if present. It can be applied directly in the SELECT clause or in WHERE conditions to filter or manipulate domain name data.