Sqoop job failed with “Malformed option in options file” error

Recently I discovered a bug in Sqoop that it wrongly detects a malformed query in options file, but in fact the query is totally correct. Example as below sqoop command: sqoop –options-file /path/to/options-file.txt and in the /path/to/options-file.txt, it contains the following content: import –connect jdbc:mysql://…… –username XXXXXXXX –password XXXXXXXX –query …