Tuesday, May 30, 2017
Sqoop : example to pull data from mysql
Example1:
sqoop import --connect jdbc:mysql:<localhost>/<databasename> --username=<username> --password-file <password file location> -table <tablename> -m 1 --compression-codec=snappy --as-avrodatafile --warehouse-dir=<hdfs location for creating datafiles>
Example 2:
sqoop import --connect jdbc:mysql:<localhost>/<databasename> --username=<username> --password=<password> -table <tablename> -m 1 --compression-codec=snappy --as-avrodatafile --warehouse-dir=<hdfs location for creating datafiles>
We can use this flag to overwrite the data pulled
--hive-overwrite flag
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment