1,提交 Workflow query-sqoop1 批作业 时出错:E0803: IO error, E0603: SQL error in operation, The transaction has been rolled back. See the nested exceptions for details on the errors that occurred.
使用HUE提交sqoop脚本通过sqoop将hive表数据导入到mysql时报错:
提交 Workflow query-sqoop1 批作业 时出错:E0803: IO error, E0603: SQL error in operation, The transaction has been rolled back. See the nested exceptions for details on the errors that occurred.
原因是在hue执行命令时直接使用二级命令在终端执行
sqoop-import \
-D org.apache.sqoop.splitter.allow_text_splitter=true \
--connect jdbc:postgresql://postgresql_server:3306/test \
--username username \
--password password \
-m 6 \
--table user \
--columns id,name \
--delete-target-dir \
--target-dir /user/bigdata/sqoop_import_test/postgresql/user
在Hue中执行
import -D org.apache.sqoop.splitter.allow_text_splitter=true --connect jdbc:postgresql://postgresql_server:3306/test --username username --password password -m 6 --table user --columns id,name --delete-target-dir --target-dir /user/bigdata/sqoop_import_test/postgresql/user
区别点 | 终端 | Hue |
---|---|---|
命令 | sqoop-import | import |
换行 | 使用反斜杠()换行 | 不可换行 |
2,查看oozie日志
oozie job -log 0000003-191226020256021-oozie-oozi-W
3,hue执行shell脚本报错:Main Class [org.apache.oozie.action.hadoop.ShellMain], exit code [1]
原因是执行命令时要使用命令的全路径,不能识别环境变量,也不能用软连接。
#!/bin/bash
/etc/alternatives/sqoop export \
--connect "jdbc:mysql://192.168.52.150:3306/scrm_bi?useUnicode=true&characterEncoding=utf-8" \
--username root \
--password '123456' \
--table itcast_visit \
--hcatalog-database itcast_dws \
--hcatalog-table visit_dws \
-m 100