【发布时间】:2014-04-28 11:41:04
【问题描述】:
我已使用 Sqoop 命令将数据从 MySQL 导入 Hive。
sqoop import --connect jdbc:mysql://mysql_server/db1 --username userid --password passwd --query 'select col1, col2, sum(col3), sum(col4), sum(col5), sum(col6) from table1 WHERE $CONDITIONS group by col1, col2' --split-by col1 --hive-import --hive-home /root/dev/hive-0.11.0 --create-hive-table --hive-table hive_table1 --target-dir imported_data。数据成功导入,我也可以查询导入的表。但是第二天当我连接到蜂巢并显示表格时,它没有返回任何东西。 Hive 中只有一个数据库,因此不会出现任何混淆。
我担心的是,一旦我与 Hive 断开连接,内部表就会被删除?无论如何,导入的数据是否应该只驻留在 Hive 中,而不应该驻留在 HDFS 上?
【问题讨论】: