Apache Sqoop References

ยท

1 min read

๐Ÿšจ I'm writing this blog as a reference to myself regarding all things related to databases. If you find the content a bit unstructured or if it doesn't make sense that's the reason why.

Export data from Hadoop to the MySQL database using Sqoop

sqoop export \
--connect jdbc:mysql://<Public DNS>:3306/<database name>\
--table <table name> \
--username root --password 123 \
--export-dir /user/root/<database directory> \
--fields-terminated-by ',' --lines-terminated-by '\n'

Import data into the HDFS cluster from MySQL tables

sqoop import \
--connect jdbc:mysql://<Public DNS>:3306/<database name> \
--table <table name> \
--username root --password 123 \
--target-dir /user/root/<HDFS directory> \
-m 1
ย