如果 table 是快照 table,有没有办法将值插入 table?
Is there any way to insert values into a table if the table is snapshottable?
我需要对 table 执行 INSERT 操作,该操作是在 snapshottable location, 那可能吗?
(我一直在使用 Hive 1.1)
CREATE TABLE tablename (x string, y string)
LOCATION'/tmp/snapshots_test/';
INSERT INTO TABLE tablename VALUES('x','y');
其中 /tmp/snapshots_test/ 设置为快照table:
hdfs dfsadmin -allowSnapshot /tmp/snapshots_test
我发现,如果table分区,即使位置是快照table目录也可以执行插入操作,但是,它可能不起作用取决于 Hive 版本。
无论如何,总是可以只删除快照table目录中的文件,避免通过Hive命令删除所有目录。
我需要对 table 执行 INSERT 操作,该操作是在 snapshottable location, 那可能吗?
(我一直在使用 Hive 1.1)
CREATE TABLE tablename (x string, y string)
LOCATION'/tmp/snapshots_test/';
INSERT INTO TABLE tablename VALUES('x','y');
其中 /tmp/snapshots_test/ 设置为快照table:
hdfs dfsadmin -allowSnapshot /tmp/snapshots_test
我发现,如果table分区,即使位置是快照table目录也可以执行插入操作,但是,它可能不起作用取决于 Hive 版本。
无论如何,总是可以只删除快照table目录中的文件,避免通过Hive命令删除所有目录。