Comparison

Comparison operators

Less than

Returns true when the first value is less than the second value (e.g. 2 < 1 returns false while 1 < 2 would return true).

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 
        orderid,
        nettotal
    FROM default_glue_catalog.upsolver_samples.orders_raw_data 
    WHERE ($commit_time BETWEEN run_start_time() AND run_end_time())
    AND nettotal < 500
    LIMIT 3;

Query result

Greater than

Returns true when the first value is greater than the second value (e.g. 1 > 2 returns false while 2 > 1 would return true).

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 
        orderid,
        nettotal
    FROM default_glue_catalog.upsolver_samples.orders_raw_data 
    WHERE ($commit_time BETWEEN run_start_time() AND run_end_time())
    AND nettotal > 500
    LIMIT 3;

Query result

Less than or equal to

Returns true when the first value is less than or equal to the second value (e.g. 1.1 <= 1 returns false while 1 <= 1 would return true).

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 
        orderid,
        nettotal
    FROM default_glue_catalog.upsolver_samples.orders_raw_data 
    WHERE ($commit_time BETWEEN run_start_time() AND run_end_time())
    AND nettotal <= 500
    LIMIT 3;

Query result

Greater than or equal to

Returns true when the first value is greater than or equal to the second value (e.g. 1 >= 1.1 returns false while 1 >= 1 would return true).

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 
        orderid,
        nettotal
    FROM default_glue_catalog.upsolver_samples.orders_raw_data 
    WHERE ($commit_time BETWEEN run_start_time() AND run_end_time())
    AND nettotal >= 500
    LIMIT 3;

Query result

Equal

Returns true when the first value is equal to the second value (e.g. 1 = 2 returns false while 1 = 1 would return true).

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 
        orderid,
        shippinginfo_address_city
    FROM default_glue_catalog.upsolver_samples.orders_raw_data 
    WHERE ($commit_time BETWEEN run_start_time() AND run_end_time())
    AND shippinginfo_address_state = 'NY'
    LIMIT 3;

Query result

Not equal

Returns true when the first value is equal to the second value (e.g. 1 != 1 returns false while 1 != 2 would return true).

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 
        orderid,
        shippinginfo_address_state
    FROM default_glue_catalog.upsolver_samples.orders_raw_data 
    WHERE ($commit_time BETWEEN run_start_time() AND run_end_time())
    AND shippinginfo_address_state != 'NY'
    LIMIT 3;

Query result

Last updated