New Contributor
Posts: 1
Registered: ‎09-05-2018
Accepted Solution

Sqoop import using last-value from a hdfs file

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.
Posts: 1,903
Kudos: 435
Solutions: 305
Registered: ‎07-31-2013

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

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."