Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Sqoop import using last-value from a hdfs file

avatar
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

avatar
Mentor
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

View solution in original post

1 REPLY 1

avatar
Mentor
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