I want to load a csv file to aurora serverless database.
My sql command is
LOAD DATA LOCAL INFILE '/Users/AAA/book.csv' REPLACE INTO TABLE book fields terminated by ',' lines terminated by '\n' ignore 1 lines (book_id,source_id,@yr,@mo,@da) set year_of_pub = IF(@yr = '',null, @yr), month_of_pub = IF(@mo = '',null, @mo), day_of_pub = IF(@da = '',null, @da);"
This SQL command worked when I uploaded the file to EC2 and loaded data there.
But when I tried to do it on my own laptop with Data API ExecuteSql operation (awscli or boto3)
I got error like:
An error occurred (BadRequestException) when calling the ExecuteSql operation: Unable to open file '/Users/AAA/book.csv'for 'LOAD DATA LOCAL INFILE' command.Due to underlying IOException:
BEGIN NESTED EXCEPTION
java.io.FileNotFoundException
MESSAGE: /Users/AAA/book.csv (No such file or directory)
I want to load a csv file to aurora serverless database.
My sql command is LOAD DATA LOCAL INFILE '/Users/AAA/book.csv' REPLACE INTO TABLE book fields terminated by ',' lines terminated by '\n' ignore 1 lines (book_id,source_id,@yr,@mo,@da) set year_of_pub = IF(@yr = '',null, @yr), month_of_pub = IF(@mo = '',null, @mo), day_of_pub = IF(@da = '',null, @da);"
This SQL command worked when I uploaded the file to EC2 and loaded data there. But when I tried to do it on my own laptop with Data API ExecuteSql operation (awscli or boto3) I got error like: An error occurred (BadRequestException) when calling the ExecuteSql operation: Unable to open file '/Users/AAA/book.csv'for 'LOAD DATA LOCAL INFILE' command.Due to underlying IOException:
BEGIN NESTED EXCEPTION
java.io.FileNotFoundException MESSAGE: /Users/AAA/book.csv (No such file or directory)
Please help!