Member since
11-02-2021
182
Posts
1
Kudos Received
0
Solutions
03-24-2026
12:38 AM
@mohammad_shamim You cannot copy a managed(ACID) table using HDFS GET/PUT commands because there are writeIDs associated with ACID tables, and if that information is missing in HMS, you will not be able to read the data files. Here is the supported way to copy/move a managed table: 1. Create an external table first, on top of the new HDFS path:
CREATE EXTERNAL TABLE ext_source_table (
col1 INT,
col2 STRING,
col3 DOUBLE,
col4 DATE
)
STORED AS ORC
LOCATION '[HDFS PATH]';
2. PERFORM MSCK REAPAIR on the External table and see if you can read it.
MSCK REPAIR ext_source_table;
3. Use CREATE TABLE AS SELECT command to create teh target Managed ACID table from that external table.
e.g
CREATE TABLE target_managed_table
AS
SELECT * FROM ext_source_table;
... View more