Time for action – fixing the mapping and re-running the export
In this case, however, let us do what probably makes more sense—modifying the definition of the employee table to make it consistent in both data sources.
Start the
mysql
utility:$ mysql -u hadoopuser -p hadooptest Enter password:
Change the type of the
start_date
column:mysql> alter table employees modify column start_date timestamp;
You will receive the following response:
Query OK, 0 rows affected (0.02 sec) Records: 0 Duplicates: 0 Warnings: 0
Display the table definition:
mysql> describe employees;
Quit the
mysql
tool:mysql> quit;
Perform the Sqoop export:
sqoop export --connect jdbc:mysql://10.0.0.100/hadooptest --username hadoopuser –P –table employees --export-dir /user/hive/warehouse/employees --input-fields-terminated-by '\001' --input-lines-terminated-by '\n'
You will receive the following response:
12/05/27 09:17:39 INFO mapreduce.ExportJobBase: Exported 10 records.
Check the number of records in...