Links

TOP_PRIVATE_DOMAIN

Get the top private domain from a domain name. For example, for www.example.com will return example.com

Syntax

TOP_PRIVATE_DOMAIN(value)

Arguments

Name
Type
Description
Default Value
value
string

Returns

string

Examples

value
Output
'www.example.com'
example.com
'www.example.co.uk'
example.co.uk
'www.example.uk.com'
example.uk.com

Transformation job example

SQL

CREATE JOB function_operator_example
ADD_MISSING_COLUMNS = true
AS INSERT INTO default_glue_catalog.upsolver_samples.orders_transformed_data MAP_COLUMNS_BY_NAME
SELECT value,
TOP_PRIVATE_DOMAIN(value) AS Output
FROM default_glue_catalog.upsolver_samples.orders_raw_data
LET value = 'www.example.com'
WHERE time_filter()
LIMIT 1;

Query result

value
Output
'www.example.com'
example.com