, the following error message appears: ERROR tool. Importtool:error during Import:no primary key could is found for table creater_user.popt_cas_redirect_his. Specify one with--split-by or perform a sequential import with '-M 1 '. In this case, in order to better use the Sqoop parallel import function, we need to understand the principle of Sqoop parallel import i
time stamps, such as:--incremental lastmodified--check-column created--last-value ' 2012-02-01 11:0:00 'is to import only created data that is larger than ' 2012-02-01 11:0:00 '.
Bin/sqoop job--meta-connect jdbc:hsqldb:hsql://10.106.1.234:16000/sqoop--create job_zyztest13--Import--connect JDBC:ORACLE:THIN:@10.106.1.236:1521:ORCL--username sqoop--password
database table into HDFS Note: By default, 4 map tasks are used, each of which writes the data it imports into a separate file, 4 files in the same directory, and in this case-m1 means that only one map task text file cannot be saved as a binary field, and the null value and string value "null" cannot be distinguished from each other. After executing the following command, a Enterprise.java file is generated that can be used by the LS Enterprise.java view, code generation is a necessary part of
Use
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
--connect Connection Database
--username Users
--password Password
--table Table Name
--target-dir Target direc
statement)Sqoop Import--connect jdbc:mysql://192.168.1.10:3306/itcast--username root--password 123 \--query ' SELECT * from Trade_detail where ID > 2 and $CONDITIONS '--split-by trade_detail.id--target-dir '/sqoop/td3 'Note: If you use the--query command, it is important to note that the argument after the where, and $CONDITIONS This parameter must be addedAnd t
a brief summary of the SQOOP implementation process:As you can see, after the--split-by is set up, the job is segmented by the set value and the number of slices is set to-m (the default job cut score is 4 if the-M 5 is not set). This more complex SQL statement has been tested to be well supported by Sqoop.Adjusting the hive data typeAfter successful execution of the above task, it is detected that the dat
Install and configure Sqoop for MySQL in the Hadoop cluster environment,
Sqoop is a tool used to transfer data from Hadoop to relational databases. It can import data from a relational database (such as MySQL, Oracle, and S) into Hadoop HDFS, you can also import HDFS data to a relational database.
One of the highlights of Sqoop is that data can be imported from a
Sqoop is a tool used to transfer data from Hadoop and relational databases. It can be used to transfer data from a relational database (such as MySQL, Oracle, and S)
Sqoop is a tool used to transfer data from Hadoop and relational databases. It can be used to transfer data from a relational database (such as MySQL, Oracle, and S)
Sqoop is a tool used to tran
You need to use sqoop to import data from the original MySQL database to hbase. The steps and problem records for installing and configuring sqoop are as follows:
1. The project uses hadoop version 1.0.3, so the corresponding sqoop is sqoop-1.4.3.bin _ hadoop-1.0.0, MySQL JDBC is mysql-connector-java-5.1.24
2. Decompre
Sqoop is a tool used to transfer data from Hadoop and relational databases to the HDFS of a relational database (such as MySQL, Oracle, Postgres, etc.). HDFs data can also be directed into a relational database.
One of the highlights of Sqoop is the fact that you can import data from a relational database to HDFs via Hadoop MapReduce.
I. Installation of Sqoop1, download
An error is reported when Sqoop is used to migrate data between Hive and MySQL databases.
An error is reported when Sqoop is used to migrate data between Hive and MySQL databases.
Run./sqoop create-hive-table -- connect jdbc: mysql: // 192.168.1.10: 3306/ekp_11 -- table job_log -- username root -- password 123456 -- hive-table job_log
Prepare to copy the tab
Mysql/oracle and Hdfs/hbase mutual data via SqoopThe following will focus on the implementation of MySQL and HDFS interoperability data through Sqoop, and the mutual guidance between MySQL and Hbase,oracle and HBase gives the final command.One, MySQL and HDFS Mutual guidance dataEnvironment:Host machine operating system for Win7,mysql installed on host, host address is 192.168.66.963 Virtual machine operating systems are ubuntu-12.04.1-32 bitThree vir
fast access to data that is different from JDBC and can be used by--direct.sqoop Work Flow1. Read the table structure to import the data, generate the run class, default is QueryResult, hit the jar package, and then submit it to Hadoop2. Set up the job, the main is to set the various parameters3. This is where Hadoop executes the MapReduce to execute the import command,1) The first thing to do is to slice the data, i.e. DatasplitDatadrivendbinputformat.getsplits (Jobcontext Job)2) After splitti
Tags: Oda ADO website connected head map targe PWD DigitalSqoop is a database used in Hadoop and relational databases (Oracle,mysql ... Open source tools for data transfer between The following is an example of MySQL, SQL Server, using Sqoop to import data from MySQL, SQL Server into Hadoop (HDFS, Hive) #导入命令及参数介绍 Common parameters
Name of parameter
Parameter description
--connect
JDBC Connection string
Installation of 1.sqoop1.1 Integration with Hadoop and hive, modifying the/opt/cdh/sqoop-1.4.5-cdh5.3.6/conf/sqoop-env.sh file 1.2 Verifying that the installation is successful Bin/sqoop version view Sqoop versions 2.sqoop Basic Operation2.1 View
\
--username SCOTT--password Tiger
Table Emp_demo \
--columns "Empno,ename,job,sal,comm" \
--export-dir '/user/ Hadoop/emp '
M 1;
The specified field of the export table uses the specified separator
To see how the demo works, first delete the data that already exists in the table.
DELETE from Emp_demo;
Sqoop export--connect jdbc:oracle:thin:@192.168.1.107:1521:orcl \
--username SCOTT--password Tiger
Table Emp_demo \
--columns "Empno,ename,job,sa
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
, resulting in an inconsistent error in the final result. Let's take a look at how the data is stored in HDFs. We run Hadoop fs-cat/user/hadoop/student/part-m-00000, we can see that the original field and the field are separated by ', ', this is sqoop default, this time, if a field worth contains ', ', A separate error occurs when inserting data into hive. Because Hive is also separated by ', '. 2. Analyzing Problems Comparing the results of the tabl
'--split-by tbl_dep.uuid--target-dir '/sqoop/td3 ': Output: part-m-00000:3Sales Department6888
4Transportation Center3434
5The center of Library and Tube5666 Part-m-00001:6Human resources1234
7Finance Department9999 Part-m-00002: part-m-00003: - 222 222Note: If you use--query This command, you need to be aware of the parameters in the where, and $CONDITIONS This parameter must
table does not exist in HBase, create--hbase-table the corresponding HBase table name--hbase-row-key the Rowkey in the HBase table, note the format--column-family The column family of the HBase table--where import is the Where condition for MySQL tables, as in SQL--split-by Create_time By default Sqoop uses 4 concurrent execution tasks, you need to develop a split
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.