CREATE JOB function_operator_example ADD_MISSING_COLUMNS = true ASINSERT INTO default_glue_catalog.upsolver_samples.orders_transformed_data MAP_COLUMNS_BY_NAMESELECT1+1AS add_example1,1+2+3AS add_example2,1.1+2.2AS add_example3FROM default_glue_catalog.upsolver_samples.orders_raw_data WHERE $commit_time BETWEEN run_start_time() AND run_end_time()LIMIT1;
Query result
Subtraction
Subtracts one number from another.
Examples
SQL
CREATE JOB function_operator_example ADD_MISSING_COLUMNS = true ASINSERT INTO default_glue_catalog.upsolver_samples.orders_transformed_data MAP_COLUMNS_BY_NAMESELECT1-1AS sub_example1,1-2-3AS sub_example2,2.2-1.1AS sub_example3FROM default_glue_catalog.upsolver_samples.orders_raw_data WHERE $commit_time BETWEEN run_start_time() AND run_end_time()LIMIT1;
Query result
Negation
Negates the value of a number.
Examples
SQL
CREATE JOB function_operator_example ADD_MISSING_COLUMNS = true ASINSERT INTO default_glue_catalog.upsolver_samples.orders_transformed_data MAP_COLUMNS_BY_NAMESELECT-1AS neg_example1,- (-1) AS neg_example2,-0AS neg_example3FROM default_glue_catalog.upsolver_samples.orders_raw_data WHERE $commit_time BETWEEN run_start_time() AND run_end_time()LIMIT1;
Query result
Multiplication
Multiplies two numbers.
Examples
SQL
CREATE JOB function_operator_example ADD_MISSING_COLUMNS = true ASINSERT INTO default_glue_catalog.upsolver_samples.orders_transformed_data MAP_COLUMNS_BY_NAMESELECT1*0AS mult_example1,1*2*3AS mult_example2,1.1*2.2AS mult_example3FROM default_glue_catalog.upsolver_samples.orders_raw_data WHERE $commit_time BETWEEN run_start_time() AND run_end_time()LIMIT1;
Query result
Division
Divides one number with another.
Note that when dividing integers, the result is truncated, meaning that only the integer portion of the result is returned if the numbers do not divide evenly.
Examples
SQL
CREATE JOB function_operator_example ADD_MISSING_COLUMNS = true ASINSERT INTO default_glue_catalog.upsolver_samples.orders_transformed_data MAP_COLUMNS_BY_NAMESELECT4/2AS div_example1,4/2/2AS div_example2,3/4AS div_example3,2.2/3.3AS div_example4FROM default_glue_catalog.upsolver_samples.orders_raw_data WHERE $commit_time BETWEEN run_start_time() AND run_end_time()LIMIT1;
Query result
Integer division
Divides one integer from another.
Inputs that are not integers are truncated and then divided.
Examples
SQL
CREATE JOB function_operator_example ADD_MISSING_COLUMNS = true ASINSERT INTO default_glue_catalog.upsolver_samples.orders_transformed_data MAP_COLUMNS_BY_NAMESELECT4 _/3as div_example1,4.1 _/3.1as div_example2,4.1/3.1as div_example3,4.8 _/3.8as div_example4,4.8/3.8as div_example5,FROM default_glue_catalog.upsolver_samples.orders_raw_data WHERE $commit_time BETWEEN run_start_time() AND run_end_time()LIMIT1;
Query result
Modulus
Computes the modulus (remainder) from dividing one number with another.
Examples
SQL
CREATE JOB function_operator_example ADD_MISSING_COLUMNS = true ASINSERT INTO default_glue_catalog.upsolver_samples.orders_transformed_data MAP_COLUMNS_BY_NAMESELECT4 % 3AS mod_example1,10 % 4 % 2AS mod_example2,5.5 % 2.2AS mod_example3FROM default_glue_catalog.upsolver_samples.orders_raw_data WHERE $commit_time BETWEEN run_start_time() AND run_end_time()LIMIT1;
Query result
Power
Raises one number to the power of another.
This operator has the same functionality as POW and POWER.
SQL
CREATE JOB function_operator_example ADD_MISSING_COLUMNS = true ASINSERT INTO default_glue_catalog.upsolver_samples.orders_transformed_data MAP_COLUMNS_BY_NAMESELECT2 ^ 2AS pow_example1,3.3 ^ 1.1AS pow_example2FROM default_glue_catalog.upsolver_samples.orders_raw_data WHERE $commit_time BETWEEN run_start_time() AND run_end_time()LIMIT1;
Query result
Example with sample data
The following example uses Upsolver sample data that is available to you through Upsolver.
SQL
CREATE JOB function_operator_example ADD_MISSING_COLUMNS = true ASINSERT INTO default_glue_catalog.upsolver_samples.orders_transformed_data MAP_COLUMNS_BY_NAMESELECT orderid AS order_id,ROUND(nettotal / (1+ taxrate), 2) AS pretax_total, taxrate, nettotalFROM default_glue_catalog.upsolver_samples.orders_raw_data WHERE $commit_time BETWEEN run_start_time() AND run_end_time()LIMIT3;