Categories

Jan 12 in Big Data | Hadoop
Q: How will you rename a table in Hive without using ALTER command?

1 Answer

Jan 12

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’

Click here to read more about Loan/Mortgage
Click here to read more about Insurance

Related questions

Madanswer
Jan 31 in Cassandra
Jan 12 in Big Data | Hadoop
Jan 12 in Big Data | Hadoop
...