【发布时间】:2015-05-21 08:35:48
【问题描述】:
- 我已经从 HIVE 终端创建了两个数据库 DB1 和 DB2。
- 运行“使用 DB1”并创建了 ORC 格式的表 T1,其分区为年、月和日,并加载了一些记录。
- 运行“使用 DB2”,然后我使用 DDL 脚本创建了 ORC 格式的表 T2,它的结构与 DB1.T1 相同。
- 我在 DB2.T2 中插入了一些记录,以便在 HDFS-Hive 仓库中为分区创建一些目录结构。
- 我运行了 Hadoop fs -cp /apps/hive/warehouse/DB1.db/T1/* /apps/hive/warehouse/DB2.db/T2
- 它复制了文件并在 /apps/hi../DB2.T2 中构建了剩余的目录结构。
问题是来自 DB2.T2 的选择计数未返回从 DB1.T1 复制的最新记录。
有人可以解释一下背后的原因吗? 它适用于普通文本格式的表格。
谢谢,
阿比
【问题讨论】:
-
你能准确地逐个显示你运行的命令吗?
-
1.创建数据库DB1; 2.使用DB1; 3. CREATE TABLE
e1(namestring, PARTITIONED BY (yearint,monthint,dayint,idint) 存储为 orc; 4. 插入表 e1 分区(年, month,day,site_id) SELECT name, year, month, day, id from master; 5. 创建数据库 DB2; 6. 使用 DB2; 7. CREATE TABLEe_arc(namestring, PARTITIONED BY (yearint ,monthint,dayint,idint) 存储为 orc; 8. haddop fs -cp /apps/hive/warehouse/db1.db/e1/* /apps/hive/warehouse/db2.db /e_arc/ 9. select * from e_arc 返回 null。Normal table 使用这些步骤。