Hi Trang,
Here’s a couple of things I noticed when reading the Sqoop documentation about the freeform queries (using the –query):
1) When importing a free-form query, you must specify a destination directory with –target-dir
2) You must also select a splitting column with –split-by
Also these docs mention that if you want to run this type of query in parallel (as in using more than one mapper) you must include the token $CONDITIONS (these conditions are inferred by sqoop and if you double quoter the query, as you did, you must escape the token like this \$CONDITIONS.
So from this it looks like when using the –query format these specific parameters are required by the sqoop language definition. It’s not an issue, it is just the way sqoop was written.
Thanks,
Ted.