Fix use mysql as metastore transaction bug.
<property>
<name>sqoop.metastore.client.enable.autoconnect</name>
<value>true</value>
<description>If true, Sqoop will connect to a local metastore
for job management when no other metastore arguments are
provided.
</description>
</property>
<property>
<name>sqoop.metastore.client.autoconnect.url</name>
<value>jdbc:mysql:https://127.0.0.1:3306/sqoop?createDatabaseIfNotExist=true</value>
</property>
<property>
<name>sqoop.metastore.client.autoconnect.username</name>
<value>sqoop</value>
</property>
<property>
<name>sqoop.metastore.client.autoconnect.password</name>
<value>test</value>
</property>
</configuration>
CREATE TABLE SQOOP_ROOT (
version INT,
propname VARCHAR(128) NOT NULL,
propval VARCHAR(256),
CONSTRAINT SQOOP_ROOT_unq UNIQUE (version, propname)
);
INSERT INTO
SQOOP_ROOT
VALUES(
NULL,
'sqoop.mysqldb.job.storage.version',
'0'
);
Create test job
sqoop job -D sqoop.hbase.add.row.key=true --meta-connect "jdbc:mysql:https://127.0.0.1:3306/sqoop?user=sqoop&password=test" \
--create sqoop_incr_test -- import --verbose -m 2 \
--connect "jdbc:mysql:https://127.0.0.1:3306/testtable" --username testuser --password "pswd" \
--table "sqooptest" \
--hbase-table sqooptest --column-family data --hbase-row-key "id" --columns "id, name, update_time" \
--split-by id --incremental append --check-column id --hbase-create-table
Run test job
sqoop job -D sqoop.hbase.add.row.key=true \
--meta-connect "jdbc:mysql:https://127.0.0.1:3306/sqoop?user=sqoop&password=test" --exec sqoop_incr_test
Sqoop metastore password should not contain special chars, such as "/". Those chars will failed when connect to mysql.
The following patch fix the transaction bug. However, the autoconnect is not working. My friend Song Hou and I fixed the autoconnect problem.