1 MySQL import data to HDFs
1.1./sqoop Import--connect jdbc:mysql://192.168.116.132:3306/sqoop--username root--password 123456--table test_user --target-dir/sqoop/test_user-m 2--fields-terminated-by "\ T"--columns "id,name"--where ' id>2 and Id<=6 '
--connect Connection Database
--username Users
--password Password
--table Table Name
--target-dir Target directory/sqoop/test_user
-M 2 mapreduce execution
--fields-terminated-by use "\ T" to separate the comma by default.
--columns only import ID and name two fields
--where Adding conditional filter statements to be held in quotation marks.
1.2./sqoop Import--connect jdbc:mysql://192.168.116.132:3306/sqoop--username root--password 123456--query ' SELECT * From Test_user where ID < 9 and ID > 1 and $CONDITIONS '--target-dir/sqoop/test_user4-m 2--split-by test_user.id
--query directly with query statements so that joins can query multiple tables
-M 1 can be executed greater than 1 if you want multiple maps to set how much data each map reads, separated by--split-by
--split-by test_user.id
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.