
In the syntax for drop database Hive command, “if exists” clause is used to avoid any errors that might occur if the programmer tries to delete a database which does not exist. For deleting a database in Hive along with the existing tables, users must change the mode from RESTRICT to CASCADE. In Hadoop Hive, the mode is set as RESTRICT by default and users cannot delete it unless it is non-empty. This command is used for deleting an already created database in Hive and the syntax is as follows - DROP (DATABASE) database_name Usage of Drop Database Command in Hive hive> drop database if exists firstDB CASCADE Usage of Create Database Command in Hive hive> create database if not exists firstDB comment "This is my first demo" location '/user/hive/warehouse/newdb' with DBPROPERTIES ('createdby'='abhay','createdfor'='dezyre') In the above syntax for create database command, the values mentioned in square brackets are optional. Let’s look at the usage of the top hive commands in HQL on both databases and tables –ĭDL Commands on Databases in Hive Create Database in HiveĪs the name implies, this DDL command in Hive is used for creating databases. DDL Commands in Hive CREATEĭatabases,Tables,Table Properties,Partitions,Functions,Index

DDL commands are the statements that are responsible for defining and changing the structure of a database or table in Hive. SQL users might already be familiar with what DDL commands are but for readers who are new to SQL, DDL refers to Data Definition Language. Learn Hadoop by working on interesting Big Data and Hadoop Projects DDL Commands in Hive Hive is a friendlier data warehouse tool for users from ETL or database background who are accustomed to using SQL for querying data. Hive makes data processing on Hadoop easier by providing a database query interface to hadoop.

Hive Installation must be completed successfully.Pre-requisites to follow this Hive Tutorial
#Hive minecraft server commands how to#
This hadoop hive tutorial shows how to use various Hive commands in HQL to perform various operations like creating a table in hive, deleting a table in hive, altering a table in hive, etc. What will you learn from this hive tutorial?
