jeremydaly / data-api-client

A "DocumentClient" for the Amazon Aurora Serverless Data API
MIT License
444 stars 63 forks source link

issue with execute_statement__LOAD DATA LOCAL INFILE #8

Closed rongqiibri closed 4 years ago

rongqiibri commented 5 years ago

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!

jeremydaly commented 5 years ago

This sounds like an issue with Data API and not this wrapper library. Please report this to the Data API team at AWS.

rongqiibri commented 5 years ago

I see. Thanks