1. Install sqoop
Download sqoop-1.2.0.tar.gz (version 1.20 is compatible with Hadoop0.20)
Put the hadoop-core-0.20.2-cdh3u3.jar, hadoop-tools-0.20.2-cdh3u3.jar into the sqoop/lib directory, the two jar packages are out of cloudera company, you can go to its official website to download.
2. import data from mysql
Go to the sqo
First of all, we need to install sqoop. I use sqoop1. Secondly, we need ojdbc6.jar. The jar package is as follows: The www.oracle.comtechnetworkdatabaseenterprise-editionjdbc-112010-090769.html will copy the decompressed package to the lib directory under the sqoop installation directory and finally execute our import
First of all, we need to install sqoop. I use
Tags: style class blog Code color useThe Sqoop version for the 1.4.4,hadoop version for the 2.2.0,hive version for the 0.11.0,hive metadata is stored in MySQL, and when you use Sqoop to import data from MySQL to hive, you are always prompted not to find the hive database that you specified. In fact, the database already exists in hive, the hive path is also set in the S
Tags: lin replace tell database hang CAs install prompt relationshipThe sqoop1.4.6 how to import MySQL data into the Sqoop installation of Hadoop is described in the previous article , and the following is a simple use command for data interoperability between the two. Display MySQL database information, General Sqoop installation testSqoop list-databases--connect jdbc:mysql://192.168.2.101:3306/--username
Label:Error Description: Since my Hadoop cluster is automatically installed with Cloudera Manager online, their installation path must follow the Cloudera rules, and only see the official documentation for Cloudera, see:/http Www.cloudera.com/content/cloudera/en/documentation/core/latest/topics/cdh_ig_jdbc_driver_install.html According to the official website, in the corresponding/var/lib/sqoop directory (official network said do not put in the/opt/cl
The current use of Sqoop is to import data from Oracle into HBase.sqoop Import--connect jdbc:oracle:thin:@192.168.193.37:1521:hispacedb --username hwmarket --password hwmarket37--m 1--query "Select G.imei,g.id as Sign, to_char (g.logindate, ' Yyyy-mm-dd hh24:mi:ss ') as CR Tdate,g.buildnumber,g.modelnumber,g.firmwarever as Firmware,g.hispacenumber,g.cno,to_char (G.updateTime, ' Yyyy-mm-dd hh24:mi:ss ') as UpdateTime, G.net,g.source, ' density, ' s
Simple application of Sqoop:
Requirements: First the data in the Hive data table WordCount into the MySQL database;
Hive Datasheet view:
Its file location in HDFs:
Build MySQL datasheet, we also called WordCount:
To build a table statement:
CREATE TABLE WordCount (Name varchar (300),ID int (one) DEFAULT 0);
Import the data from the above hive into the MySQL database wordcount table:
Sqoop
Tags: hiveOne, sqoop in synchronizing MySQL table structure to hiveSqoop create-hive-table--connect jdbc:mysql://ip:3306/sampledata--table t1--username Dev--password 1234--hive-table T1;Execution to this step exits, but in Hadoop's HDFs/hive/warehouse/directory is not found T1 table directory,But the normal execution is done as follows:The error is that Hive's jar package is missing.All of the jar packages should be like this:This is all the hadoop-2.
One: Two ways to Sqoop incremental importIncremental Import Arguments:
Argument
Description
--check-column (col)
Specifies the column to is examined when determining which rows to import. (the column should not being of type Char/nchar/varchar/varnchar/longvarchar/longnvarchar)
--incremental (mode)
Specifies how Sqoop determines
Operation Details: https://www.cnblogs.com/xiaodf/p/6030102.html
Note: You need to create a table structure to be exported before exporting. An error occurs if the exported table does not exist in the database, and the data in the table repeats if multiple exports are repeated;
CREATE TABLE Emp_demo as SELECT * from EMP where 1=2;
CREATE TABLE Salgrade_demo as SELECT * from Salgrade where 1=2;
Export all fields of a table
Sqoop export--connect jdbc:
Sqoop imported hive field names from mysql, sqoophive
There are some keyword restrictions in hive, so some field names are available in mysql, but it won't work when it comes to hive.
For example, order must be changed to order1. The following lists some of the field names we found that cannot be used in hive.
Order => order1
Sort => sort1
Reduce => performance1
Cast => cast1
Directory => directory1
How can I not query
Tags: DSL java style order man LAN 2.7 CLI policyObjectiveThis article is primarily a summary of the pits that were encountered when importing data from MySQL to hive with Sqoop. Environment:
System: Centos 6.5
hadoop:apache,2.7.3
mysql:5.1.73
jdk:1.8
sqoop:1.4.7
Hadoop runs in pseudo-distributed mode. One, the import command usedI mainly refer to an article to test, Sqoop:im
Solution to the problem when the date type is poured into hive when the Oracle database is present1. Description of the problem:Using Sqoop to pour the Oracle data table into hive, the date data in Oracle will be truncated in seconds, leaving only ' yyyy-mm-dd ' instead of ' yyyy-mm-dd HH24:mi:ss ' format, followed by ' Hh24:mi: SS ' is automatically truncated, and this truncation can cause problems in parsing processing of time requirements to second
Tags: export exp single quote BSP import local condition target connectorData Sheet First class: Data in the database is imported into HDFs #数据库驱动jar包用mysql-connector-java-5.1. to-bin, otherwise there may be an error!./sqoop Import--connect Jdbc:mysql://localhost:3306/erpdb--username root--password 123456--table tbl_dep--columns ' uuid, name, Tele ': Output: part-m-00000:1, President of the Office,8888
2, purchasing department,6668
3,
Simply write the steps to sqoop the order table into the HBase table.The following table:1. Open HBase through the hbase shell.2. Create an HBase tableCreate ' So ','o'3. Import the data of so table into HBase.Opt file:--connect: Database--username: Database user name--password: Database Password--table: Tables that need to be sqoop--columns: Columns in a tableTable in the--hbase-table:hbase--column-family
Today using Sqoop to import a table, I went to the database of data volume of 650 data, but I import data into the Hive table when there are 563 data, it is very strange, I think the data is wrong, and then more than a few times to import data discovery is the same problem.Then I went to the value of the data field ID and found out how the data that built the primary key could be empty. Then I went to look at the data in the database found that the da
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.