用于配置单元视图的 sqoop 导出

sqoop export for hive views

我正在尝试将配置单元视图 sqoop 到 SQL 服务器数据库,但是我收到“找不到对象错误”。 sqoop 导出是否适用于配置单元视图?

sqoop export --connect 'jdbc:jtds:sqlserver:<Connection String>' --table 'tax_vw' --hcatalog-database default --hcatalog-table tax_vw --connection-manager org.apache.sqoop.manager.SQLServerManager --driver net.sourceforge.jtds.jdbc.Driver --username XXX  --password YYY --update-mode allowinsert

INFO hive.metastore: Connected to metastore. ERROR tool.ExportTool: Encountered IOException running export job: java.io.IOException: NoSuchObjectException(message:default.tax_vw table not found)

需要这方面的帮助。

不幸的是,使用 sqoop 导出是不可能的,即使指定了 --hcatalog-table,它也只适用于 tables,如果不在 HCatalog 模式下,它只支持从目录导出, sqoop-export.

也不支持查询

您可以将视图数据加载到 table:

create table tax_table as select * from default.tax_vw;

并使用--hcatalog-table tax_table