Always export only four records while exporting a delimited file

Import stmt
sqoop import
–connect “jdbc:mysql://quickstart.cloudera:3306/retail_db”
–username retail_dba
–password cloudera
–table categories
–as-textfile
–fields-terminated-by ‘#’
–lines-terminated-by ‘$’
–target-dir /home/clouder/sqoop/append/categories_export_delimited
–num-mappers 4
–outdir files

58 records imported.

Export stmt:
sqoop export
–connect “jdbc:mysql://quickstart.cloudera:3306/retail_db”
–username retail_dba
–password cloudera
–table categories_export_delimited
–export-dir /home/clouder/sqoop/append/categories_export_delimited
–input-fields-terminated-by ‘#’
–input-lines-terminated-by ‘$’
–batch
–outdir files

output
first try
mysql> select * from categories_export_delimited;
±------------±-----------------------±-------------------+
| category_id | category_department_id | category_name |
±------------±-----------------------±-------------------+
| 16 | 3 | As Seen on TV! |
| 30 | 6 | Men’s Golf Clubs |
| 1 | 2 | Football |
| 44 | 7 | Hunting & Shooting |
±------------±-----------------------±-------------------+

second try
±------------±-----------------------±-------------------+
| category_id | category_department_id | category_name |
±------------±-----------------------±-------------------+
| 1 | 2 | Football |
| 44 | 7 | Hunting & Shooting |
| 30 | 6 | Men’s Golf Clubs |
| 16 | 3 | As Seen on TV! |
±------------±-----------------------±-------------------+

Always export only 4 records!!! why other records are not exported ?

@pradpalnis - I am able to re-create your issue.

After you did sqoop export, if you checked the data it won’t stored as 58 records due to input-lines-terminated value.
hadoop fs -cat /home/clouder/sqoop/append/categories_export_delimited/part*

I am able to successfully import & export with below, it shows 58 rows in mysql.
Use below in Import
–lines-terminated-by ‘\n’

Use below in Export
–input-lines-terminated-by ‘\n’

Thanks @gnanaprakasam.
By using ‘\n’ able to export all record as expected .
So, we have to use only newline character as line delimiter ? other delimiter won’t work .