Altering a database schema
In this recipe, you will learn how to alter a database in Hive.
Getting ready
The ALTER DATABASE
command in Hive is used to alter dbproperties
or set the dbproperties
of a database. Using the ALTER DATABASE
command, we can only alter dbproperties
and nothing else (not even the name and directory location of a database can be altered). No other metadata about the database can be changed. The general format for altering a database is as follows:
ALTER (DATABASE|SCHEMA) database_name SET DBPROPERTIES (property_name=property_value, ...);
Where:
DATABASE|SCHEMA
: These are the same thing. These words can be used interchangeably:
SET DBPROPERTIES (property_name=property_value, ...)
This clause is used to set the properties for ...
Get Apache Hive Cookbook 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.