sqoop导入时与在hive中创建表相关的查询
我正在尝试将 sqoop 从 SQL Server 导入到 Hive 中。 当我执行 sqoop-import 命令时,问题是导入任务已完成, 我可以看到HDFS上的完整数据(在/user/hive/warehouse/table_name_dir下) 但是当我在 Hive CLI 中执行“SHOW TABLES”命令时,我无法看到列表中的表。
(一旦我尝试过:导入表后,发生了与上面相同的事情,然后我在 Hive CLI 中运行 CREATE TABLE QUERY,采用与导入的字段相同的字段,并且我能够在 Hive CLI 中查看和访问该表。但我不认为每次表演时这都是有效的方式)。
请给我一些解决方案 我是否遗漏了任何步骤或者有什么问题? 我不明白为什么会发生? 感谢大家
I am trying for sqoop import from SQL Server into Hive.
When I execute sqoop-import command, the problem is that import task gets completed,
I can see the complete data on HDFS (under /user/hive/warehouse/table_name_dir)
but when I execute "SHOW TABLES " command in HIve CLI I am not able to see the table in the list.
(Once I have tried like: after importing the table same thing happened as above then I run the CREATE TABLE QUERY in Hive CLI taking the same field as that was in imported one and I was able to see and access the table in Hive CLI. But I dont think this is effective way every time I perform).
Pls suggest me some solution
Is there any step I missed out or is there any problem?
I am not getting why it is happening?
Thanks to all
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我也遇到过类似的问题,并且花了将近 4 天的时间。我尝试了几乎所有可用的选项,但未能成功。
后来,我在 https://issues.apache.org/jira/browse/ 发现了一些有趣的东西HADOOP-5887
我认为,这个问题已经在 Hadoop 0.21.0 及更高版本中得到修复。因此,如果您可以将版本升级到 0.21.0,这个问题可能会得到解决。我什至正在尝试升级它。
谢谢,
拉古
I have faced similar issue and spent almost 4 days on this. I tried almost all the available options, but could not succeed.
Later, I found something interesting at https://issues.apache.org/jira/browse/HADOOP-5887
I think, this issue has been fixed in Hadoop 0.21.0 and later releases. So, if you can uplgrade your version to 0.21.0, this issue might get fixed up. I am trying to upgrade it even.
Thanks,
Raghu
您可以尝试使用 create-hive-table 工具根据 HDFS 中存在的表使用表定义填充 Hive 元存储。
点击 create-hive-table 的链接
You can try create-hive-table tool to populate a Hive metastore with the table definition based on the table present in HDFS.
Follow the link for create-hive-table