How to use SqoopOperator or SqoopHook load data from mysql to hive in airflow project?

Viewed 31

My code throw a error as follows, and I'm not sure my program whether exactly.

No connection paramenters specified. Using regular API for making connection.'
[2022-09-11, 13:51:55 UTC] {sqoop.py:109} INFO - b'22/09/11 21:51:55 ERROR manager.SqlManager: Error executing statement: java.sql.SQLException: No suitable driver found for 10.10.0.10:3306/**

And if I run sqoop command in terminal,that's ok:

sqoop import --connect jdbc:mysql://10.10.0.10:3306/**?autoReconnect=true --username ** --password ** --hive-import --hive-database ods --hive-table tm_person_basic --hive-delims-replacement " " --fields-terminated-by '\035' --hive-partition-key dt --hive-partition-value 20220917 --delete-target-dir --target-dir /user/sqoop/tm_person_basic -m 1 --hive-overwrite --query ' select ** from tm_person_basic WHERE $CONDITIONS'

How to use SqoopOperator or SqoopHook load data from mysql to hive in airflow project?

my dag code: enter image description here

airflow run log: enter image description here

airflow sqoop connection: enter image description here

airflow generate sqoop command "--connect 10.10.0.10:3306/tams_om" not like **jdbc:mysql:**10.10.0.10:3306/tams_om,how to set it correctly?

0 Answers
Related