Skip to content

Aurora MySQL 8 Appears to be treating single query instruction as 2 instructions

0
LOAD DATA FROM S3 FILE 's3://bucket-name/path/to/file.csv'
    INTO TABLE `schema_name`.`table_name`
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    LINES TERMINATED BY '\n'
    IGNORE 1 LINES
    (`start_year`,`start_month`,`start_year_mo`,`profile`,`term_length`,`load_zone`,`rate`,`meter_fee`,`supplier_id`,`product_id`,`curve_date`,`expires`,`annual_mwh_from`,`annual_mwh_to`,`market_id`,`iso_id`,`state`,`weather_zone`,`rate_class`,`sub_rate_class`,`por`,`sc`,`includes_grt`,`includes_congestion`,`grt_multiplier`)
    SET matrix_file_id = '02dc7f82-52ba-4843-be82-72f894d06e2d';

Error:

[HY000][1193] Unknown system variable 'matrix_file_id'

Based on the error, it appears to be trying to run the load data query, which runs successfully, then tries to run the SET matrix_file_id = '02dc7f82-52ba-4843-be82-72f894d06e2d'; as a separate query instruction.

What's expected is that the SET should be run with the LOAD DATA query to set a table column value to a set value for all the records inserted.

This works just fine in Aurora MySQL 5.7 but not in Aurora MySQL 8 (8.0.42)

asked a year ago145 views

1 Answer
0

LOAD DATA FROM S3 FILE 's3://bucket-name/path/to/file.csv' INTO TABLE schema_name.table_name FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES (start_year,start_month,start_year_mo,profile,term_length,load_zone,rate,meter_fee,supplier_id,product_id,curve_date,expires,annual_mwh_from,annual_mwh_to,market_id,iso_id,state,weather_zone,rate_class,sub_rate_class,por,sc,includes_grt,includes_congestion,grt_multiplier) SET matrix_file_id = '02dc7f82-52ba-4843-be82-72f894d06e2d';

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.