Sqoop export delimters error

Hi, am getting below error when am running the below sqoop statement
sqoop export --connect “jdbc:mysql://nn01.itversity.com:3306/retail_export”
–username=retail_dba
–password=itversity
–table department_test
–export-dir /apps/hive/warehouse/sqoop_import_govtham.departments_test
–input-fields-terminated-by ‘\001’
–input-lines-terminated-by ‘\n’
–num-mappers 2
–batch
–outdir java_files
–input-null-string nvl
–input-null-non-string -1

Thanks
Goutham

Can you check the Export directory again and try export one more time .

@Goutham

Hi Goutham,

I think username and password has ‘=’. we have to use like --username retail_dba --password itversity.

@Goutham

Can you check below highlighted part is correct,

sqoop export --connect “jdbc:mysql://nn01.itversity.com:3306/retail_export” \ --username=retail_dba \ --password=itversity \ –table department_test \ --export-dir /apps/hive/warehouse/sqoop_import_govtham.departments_test \ --input-fields-terminated-by ‘\001’ \ --input-lines-terminated-by ‘\n’ \ --num-mappers 2 \ --batch \ --outdir java_files \ --input-null-string nvl \ --input-null-non-string -1

department_test is your mysql table exists and /apps/hive/warehouse/sqoop_import_govtham.departments_test has data in it.

i tried by changing the export-dir still no luck
sqoop export --connect “jdbc:mysql://nn01.itversity.com:3306/retail_export”
–username retail_dba
–password itversity
–table department_test
–export-dir /apps/hive/warehouse/departments_test
–input-fields-terminated-by ‘\001’
–input-lines-terminated-by ‘\n’
–num-mappers 2
–batch
–outdir java_files
–input-null-string nvl
–input-null-non-string -1

tables are pointing correct only

i removed ‘=’ and tired but still failing

I think nvl should be enclosed in double quotes “nvl”

I ran the below the query, still same issue
sqoop export --connect “jdbc:mysql://nn01.itversity.com:3306/retail_export”
–username retail_dba
–password itversity
–table department_test
–export-dir /apps/hive/warehouse/departments_test
–input-fields-terminated-by ‘\001’
–input-lines-terminated-by ‘\n’
–num-mappers 2
–batch
–outdir java_files
–input-null-string “nvl”
–input-null-non-string -1

Hi,

I ran the same query in my system successfully. Please can you check once weather you created department_test table in database and also this path '/apps/hive/warehouse/departments_test ’ contains the data.

@Goutham -
Input file shows it’s delimited with “,”. So you have to give --input-fields-terminated-by ‘,’
/apps/hive/warehouse/departments_test

With this change the above export working fine for me.

Thanks Gnan, it is working fine