Importing MySQL data into a hive table with Sqoop

Source: Internet
Author: User
Tags sqoop

First, the data of a MySQL table is imported into HDFs using Sqoop

1.1, first in MySQL to prepare a test table

Mysql> descUser_info;+-----------+-------------+------+-----+---------+-------+|Field|Type| Null | Key | Default |Extra|+-----------+-------------+------+-----+---------+-------+|Id| int( One)|YES|     | NULL    |       || user_name | varchar( -)|YES|     | NULL    |       ||Age| int( One)|YES|     | NULL    |       ||Address| varchar( -)|YES|     | NULL    |       |+-----------+-------------+------+-----+---------+-------+4Rowsinch Set(0.14sec) MySQL> Select *  fromUser_info;+------+-----------+------+--------------------+|Id| user_name |Age|Address|+------+-----------+------+--------------------+|    1 |Zhangsan|    - |Shenzhen Nanshang||    2 |Lisi|    - |Shenzhen Futian||    3 |Wangwu|    at |Shenzhen Luohu||    4 |Cailiu|    - |Shenzhen Guangming||    5 |Zhuqi|    - |Shenzhen Baoan||    6 |Houba|    - |Shenzhen Xili||    7 |Laojiu|    - |Shenzhen Yantian|+------+-----------+------+--------------------+7Rowsinch Set(0.00sec) MySQL> 

The first 100 data in the User_info table are exported below, as long as ID user_name and age 3 fields, the data exists under the HDFs directory/tmp/sqoop/user_info.

Importing MySQL data into a hive table with Sqoop

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.