Managed tables

The following is a sample command to define a Hive managed table:

Create Table < managed_table_name>  
   Column1 <data type>, 
   Column2 <data type>, 
   Column3 <data type> 
Row format delimited Fields Terminated by "t"; 

When the preceding query is executed, Hive creates the table and the metadata is updated in the metastore accordingly. But the table is empty. So, data can be loaded into this table by executing the following command:

Load data inpath <hdfs_folder_name> into table <managed_table_name>; 

After executing the previous command, the data is moved from <hdfs_folder_name> to the Hive table's default location /user/hive/warehouse/<managed_table_name. This default folder, /user/hive/warehouse, is defined in hive-site.xml and ...

Get Modern Big Data Processing with Hadoop now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.