如何使用sqoop在Hive中创建外部表。需要建议 [英] How to create external table in Hive using sqoop. Need suggestions

查看:682
本文介绍了如何使用sqoop在Hive中创建外部表。需要建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用sqoop我可以创建托管表,但不能创建外部表。



请让我知道从数据仓库中卸载数据并将其加载的最佳实践Hive外部表。



1.仓库中的表是分区的。一些是明智的分区,一些是明智的分区。



请在生产环境中使用您的想法或做法。

解决方案

Sqoop不支持创建Hive外部表。相反,您可以:使用Sqoop codegen命令生成用于创建与远程RDBMS表相匹配的Hive内部表的SQL(请参阅 a href =http://sqoop.apache.org/docs/1.4.2/SqoopUserGuide.html#_literal_sqoop_codegen_literal =nofollow> http://sqoop.apache.org/docs/1.4.2/SqoopUserGuide。

  • 修改生成的SQL以创建一个Hive外部表

  • 在Hive中执行修改后的SQL

  • 运行您的Sqoop导入命令,加载到预先创建的Hive外部表中


  • Using sqoop I can create managed table but not the externale table.

    Please let me know what are the best practices to unload data from data warehouse and load them in Hive external table.

    1.The tables in warehouse are partitioned. Some are date wise partitioned some are state wise partitioned.

    Please put your thoughts or practices used in production environment.

    解决方案

    Sqoop does not support creating Hive external tables. Instead you might:

    1. Use the Sqoop codegen command to generate the SQL for creating the Hive internal table that matches your remote RDBMS table (see http://sqoop.apache.org/docs/1.4.2/SqoopUserGuide.html#_literal_sqoop_codegen_literal)
    2. Modify the generated SQL to create a Hive external table
    3. Execute the modified SQL in Hive
    4. Run your Sqoop import command, loading into the pre-created Hive external table

    这篇关于如何使用sqoop在Hive中创建外部表。需要建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆