Sqoop Export Failing Lecture 57

Hello, when I try to run the sqoop export that you have specified. It does not work for me. I did a DESCRIBE FORMATTED on my daily_revenue table and got this LOCATION: hdfs://nn01.itversity.com:8020/user/rkapur68/warehouse/rkapur68_sqoop_retail.db/daily_revenue

I used that location, starting from /user, in this sqoop export as shown here. However, it shows that the export failed. I do not understand why, please help.

Hi @Rajeev_Kapur,

This error occurs because of your target table might have different schema from the source data file. please make sure target table have similar schema as the data file (/user/rkapur68/warehouse/rkapur68_sqoop_retail.db/daily_revenue ).

here i am trying to export data into mysql table which have similar schema as source data file and it’s working for me.

sqoop export \
 --connect jdbc:mysql://ms.itversity.com:3306/retail_export \
 --username retail_user \
 --password itversity \
 --export-dir /user/shubham/warehouse/shubham_retail_db.db/orders \
 --table order_export

below is the table schema which is similar to orders data(source) file-

Sir, the lecture 57 says that we should be able to export from HDFS like Hive (which is where my image /user/rkapur68/warehouse/rkapur68_sqoop_retail.db/daily_revenue is) to a RDBMS like MySQL. The structure of the table is the same. In HIVE, order_date field is STRING and revenue field is FLOAT whilst in MYSQL order_date is varchar(25) and revenue is float type. Still, however, it fails. May you please explain why?