RECIPROCAL

Returns the reciprocal of the value (¹/ₓ).

Syntax

RECIPROCAL(x)

Arguments

NameTypeDescriptionDefault Value

x

numeric

Returns

Returns a double value.


Examples

xOutput

2

0.5

4

0.25

1

1

0

null

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 x,
        RECIPROCAL(x) AS Output
    FROM default_glue_catalog.upsolver_samples.orders_raw_data
    LET x = 2
    WHERE $commit_time BETWEEN run_start_time() AND run_end_time()
    LIMIT 1;

Query result

xOutput

2

0.5

Last updated