sqoop导出数据到postgresql时设置schema的问题

当使用Sqoop将Hive表导出到PostgreSQL时,默认会导出到publicschema。若需指定其他schema,可以使用`--schema`参数。例如,`sqoopimport...--tablecustom_table--schemacustom_schema`。需要注意的是,`schema`参数应放置在导出参数的最后。此方法成功解决了将数据导入到特定schema的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问题描述:
sqoop导出hive表到pgsql时,默认导出到public下,当需要导出到指定的schema下时,如何设置?

解决方法:
将数据导入到postgresql时应该怎么指定模式名呢,在sqoop官网可以看到下面的细节,
If you need to work with tables that are located in non-default schemas, you can specify schema names via the --schema argument. Custom schemas are supported for both import and export jobs. For example:

sqoop import … --table custom_table – --schema custom_schema

自己尝试过发现,schema参数必须放在导出参数的最后一行。
在这里插入图片描述
完美解决~

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值