Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Sqoop import using last-value from a hdfs file

Solved Go to solution
Highlighted

Sqoop import using last-value from a hdfs file

New Contributor
I was trying to sqoop data using --last-value property whose value will be read from a hdfs file.

the hdfs file has following content-
'1900-01-01 00:00:00.000'

mylastValue=`hadoop fs -cat propertiesFile.txt`

when I use --last-value ${mylastValue}

The sqoop argument splits at the space in the lastValue passed and I get Error parsing arguments.
1 ACCEPTED SOLUTION

Accepted Solutions

Re: Sqoop import using last-value from a hdfs file

Master Guru
This is a shell behaviour, not Sqoop.

"When referencing a variable, it is generally advisable to enclose its name
in double quotes."

"Use double quotes to prevent word splitting. An argument enclosed in
double quotes presents itself as a single word, even if it contains
whitespace separators."

- http://tldp.org/LDP/abs/html/quotingvar.html
1 REPLY 1

Re: Sqoop import using last-value from a hdfs file

Master Guru
This is a shell behaviour, not Sqoop.

"When referencing a variable, it is generally advisable to enclose its name
in double quotes."

"Use double quotes to prevent word splitting. An argument enclosed in
double quotes presents itself as a single word, even if it contains
whitespace separators."

- http://tldp.org/LDP/abs/html/quotingvar.html