首页 > 解决方案 > Sqoop 从 Postgre 到 Hive 并转换为 ORC 格式

问题描述

我正在尝试将一些表从 Postgres sqoop 到 Hive,并在 sqooping 时将它们转换为 ORC。

  1. 我使用了以下命令。

sqoop import --hcatalog-home /usr/hdp/current/hive-webhcat --connect jdbc:postgresql:/// --username user --password pwd --table table --hcatalog-database default --hcatalog-table表 --hcatalog-storage-stanza "存储为 orcfile" --create-hcatalog-table -m 1

我收到以下错误:

错误工具.ImportTool:导入失败:org.apache.hive.hcatalog.common.HCatException:2016:不支持错误操作:不支持从 Pig/Mapreduce 存储到事务表 default.agent

  1. 我把 sqoop 改成这样,添加了 tblproperties ("transactional"="false")

sqoop import --hcatalog-home /usr/hdp/current/hive-webhcat --connect jdbc:postgresql:/// --username user --password pwd --table table --hcatalog-database default --hcatalog-table表 --hcatalog-storage-stanza "存储为 orcfile tblproperties ("transactional"="false")" --create-hcatalog-table -m 1

错误:

信息 hcat.SqoopHCatUtilities:失败:执行错误,从 org.apache.hadoop.hive.ql.exec.DDLTask 返回代码 1。MetaException(message:Table default.duplicates 由于以下原因未能通过严格的托管表检查:表被标记为托管表但不是事务性的。)

  1. 我在谷歌搜索后添加了以下内容,以两种不同的格式添加了 --hcatalog-external-table

sqoop import --hcatalog-home /usr/hdp/current/hive-webhcat --connect jdbc:postgresql:/// --username user --password pwd --table table --hcatalog-database default --hcatalog-table表 --hcatalog-storage-stanza "存储为 orcfile tblproperties ("transactional"="false")" --create-hcatalog-table --hcatalog-external-table -m 1

sqoop import --hcatalog-home /usr/hdp/current/hive-webhcat --connect jdbc:postgresql:/// --username user --password pwd --table table --hcatalog-database default --hcatalog-external -table table --hcatalog-storage-stanza "存储为 orcfile tblproperties ("transactional"="false")" --create-hcatalog-table -m 1

我尝试了上面给出的两个,

这是错误:

错误工具.BaseSqoopTool:无法识别的参数:--hcatalog-external-table

现在,我被困住了..任何帮助表示赞赏。

标签: postgresqlhadoopsqooporc

解决方案


推荐阅读