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

NameTypeDescriptionDefault Value

value

string

Returns

Returns a string value.


Examples

valueOutput

'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 $commit_time BETWEEN run_start_time() AND run_end_time()
    LIMIT 1;

Query result

valueOutput

'www.example.com'

example.com

Last updated