从Postgre到Hive并转换为ORC格式



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

  1. 我使用了下面的命令:

sqoop import——hcatalog-home/usr/hdp/current/hive-webhcat——connectjdbc:postgresql:///——username user——password PWD——hcatalog-table表——hcatalog-storage-stanza存储为orcfile"——create-hcatalog-table -m 1

我得到以下错误:

错误的工具。ImportTool:导入失败:org.apache.hive.hcatalog.common.HCatException: 2016:错误操作不支持:默认存储到事务表中。代理猪/不支持Mapreduce

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

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

错误:

信息hcat。SqoopHCatUtilities: FAILED:执行错误,返回代码1从org.apache.hadoop.hive.ql.exec.DDLTask。MetaException(信息:表默认。副本失败,严格管理表检查的原因如下:表被标记为托管)

  1. 和我添加了一些谷歌后,添加——hcatalog-external-table在两种不同的格式

sqoop import——hcatalog-home/usr/hdp/current/hive-webhcat——connectjdbc:postgresql:///——username user——password PWD——table表——hcatalog-table表——hcatalog-storage-stanza "存储为orcfile tblproperties ("transactional"="false")"——create-hcatalog-table——hcatalog-external-table

sqoop import——hcatalog-home/usr/hdp/current/hive-webhcat——connectjdbc:postgresql:///——username user——password PWD——表表——hcatalog-database违约——hcatalog-external-table表hcatalog-storage-stanza"存储为orcfile tblproperties("transactional"="false";——create-hcatalog-table -m 1

我试了以上两种方法,

错误提示:

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

现在,我卡住了…如有任何帮助,不胜感激。

成功了!可能对你有帮助参数 :进口——连接jdbc: postgresql://* * * *: 5432/cloudoffice_2——用户名dbmanager——密码文件********——表hive_ua_test_with_column_5——hcatalog-database临时——hcatalog-tableua_test_adb——分割了id- m4——hcatalog-storage-stanza存储为orc tblproperties ("orc.compress"=" snap ")——详细——Created>=1661356800和Created>1661443200——hive-partition-key日期——hive-partition-value2022-08-25——列id, ip_address

最新更新