I have external table with complex datatype,(map(string,array(struct))) and I'm able to select and query this external table without any issue. However if I am trying to load this data to a managed table, it runs forever. Is there any best approach to load this data to managed table in hive?
CREATE EXTERNAL TABLE DB.TBL(
id string ,
list map<string,array<struct<ID:string,col:boolean,col2:string,col3:string,col4:string>>>
) LOCATION <path>
BTW, you can convert table to managed (though this may not work on cloudera distribution due warehouse dir restriction):
If you need to load into another managed table, you can simply copy files into it's location.
--Create managed table (or use existing one)
This will print location along with other info, use it to copy files.
Copy all files from external table location into managed table location, this will work most efficiently, much faster than insert..select:
After copying files, table will be selectable. You may want to analyze table to compute statistics: