ABS

Computes the absolute value of the given input.

Syntax

ABS(X)

Arguments

X

Type: numeric

A numeric value.

Returns

Type: same as input

The absolute value of X.

Examples

XOutput

-3

3

3

3

1 + 1

2

0

0

1.1

1.1

-1.1

1.1

-1 - 5

6

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 
        ABS(-3) AS abs_example
    FROM default_glue_catalog.upsolver_samples.orders_raw_data 
    WHERE time_filter()
    LIMIT 1;

Query result

abs_example

3

Last updated