How will you rename a table in Hive without using ALTER command?

We can use IMPORT/EXPORT statements to rename a table in Hive.

We first export the original table to a location by EXPORT statement.

hive> EXPORT TABLE tableName TO ’TEMP_LOCATION’

Then we create new table with IMPORT statement.

hive> IMPORT TABLE newTableName FROM ’TEMP_LOCATION’

Read the full book at www.amazon.com
Posted in Hive, Hive Interview Questions

Leave a Reply

Your email address will not be published. Required fields are marked *

*