tanghui created HIVE-29005:
------------------------------
Summary: iceberg: rename table not modify the metadata_location
Key: HIVE-29005
URL: https://issues.apache.org/jira/browse/HIVE-29005
Project: Hive
Issue Type: Bug
Affects Versions: 4.0.1, 4.0.0-beta-1
Reporter: tanghui
after rename table ,execute add column will Restored the old location
in beeline:
{code:java}
CREATE TABLE n (i int) STORED BY ICEBERG STORED AS ORC;
insert into n values(1),(2),(3);
select * from n ;
ALTER TABLE n RENAME TO nn;
show create table nn;
{code}
this metadata_location is :
hdfs://nameservice1/warehouse/tablespace/external/hive/n/metadata/00001-63de9790-1399-4a52-9753-47f6cf271f1a.met
adata.json'
but location is : hdfs://nameservice1/warehouse/tablespace/external/hive/nn
{code:java}
+----------------------------------------------------+
| createtab_stmt |
+----------------------------------------------------+
| CREATE EXTERNAL TABLE `nn`( |
| `i` int) |
| ROW FORMAT SERDE |
| 'org.apache.iceberg.mr.hive.HiveIcebergSerDe' |
| STORED BY |
| 'org.apache.iceberg.mr.hive.HiveIcebergStorageHandler' |
| |
| LOCATION |
| 'hdfs://nameservice1/warehouse/tablespace/external/hive/nn' |
| TBLPROPERTIES ( |
| 'TRANSLATED_TO_EXTERNAL'='TRUE', |
| 'bucketing_version'='2', |
|
'current-schema'='{"type":"struct","schema-id":0,"fields":[{"id":1,"name":"i","required":false,"type":"int"}]}',
|
| 'current-snapshot-id'='7947486275821849401', |
|
'current-snapshot-summary'='{"added-data-files":"1","added-records":"3","added-files-size":"247","changed-partition-count":"1","total
-records":"3","total-files-size":"247","total-data-files":"1","total-delete-files":"0","total-position-deletes":"0","total-equality-delet
es":"0"}', |
| 'current-snapshot-timestamp-ms'='1749718607090', |
| 'engine.hive.enabled'='true', |
| 'external.table.purge'='TRUE', |
| 'iceberg.orc.files.only'='true', |
|
'metadata_location'='hdfs://nameservice1/warehouse/tablespace/external/hive/n/metadata/00001-63de9790-1399-4a52-9753-47f6cf271f1a.met
adata.json', |
|
'previous_metadata_location'='hdfs://nameservice1/warehouse/tablespace/external/hive/n/metadata/00000-6382fc39-4e17-4626-b081-b200eec
b506a.metadata.json', |
| 'serialization.format'='1', |
| 'snapshot-count'='1', |
| 'table_type'='ICEBERG', |
| 'transient_lastDdlTime'='1749718607', |
| 'uuid'='80dbfeb8-0443-4774-991a-f1a2f9bd482d', |
| 'write.format.default'='orc') |
+----------------------------------------------------
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)