How to give custom name to Sqoop output files How to give custom name to Sqoop output files hadoop hadoop

How to give custom name to Sqoop output files


You can't do it with sqoop directly, but you can rename them in HDFS after sqoop is done importing:

today=`date +%Y-%m-%d`files=$(hadoop fs -ls /path-to-files | awk  '{print $8}')for f in $files; do hadoop fs -mv $f $f$today; done

The first command gets today's date. The second command gets all the filenames within your directory. The third command renames those files, appending the date.


Yes we can ! see here

sqoop import -D mapreduce.output.basename=`date +%Y-%m-%d`