天天看点

迁移phoenix与hbase关联表数据

先禁用旧表

disable ‘temp:old_table’

再将旧表备份成快照

snapshot ‘temp:old_table’, ‘tableSnapshot’

克隆快照数据到新表(注意:新表不能先建,如果已经存在会报错)

clone_snapshot ‘tableSnapshot’, ‘temp:new_table’

查看新表数据和旧表数据是否一样(记录数)

count ‘temp:old_table’

scan ‘temp:old_table’

没问题后删除快照

delete_snapshot ‘tableSnapshot’

删除旧表数据

drop ‘temp:old_table’

再在phoenix中新建和hbase同名称的表(注意:必须先将hbase表迁移后再新建phoenix去映射,不然做聚合会报错)

继续阅读