DDL For Databases & Tables

The below mentioned posts are useful for the beginners and for those who is appearing for CCA159 Exams.

COMPLETE DDL Commands in Hive

This article is to cover all the DDL commands in Hive. “CREATE” DATABASE LEVEL: To create the database with properties CREATE DATABASE TestDB WITH dbProperties(‘Creator: ‘= ‘Username’, ‘Created-Date:’ = ‘01-01-2020’); Or we can just create the database without any properties. CREATE DATABASE TestDB; TABLE LEVEL: Creating a table in HIve with different type of data

Continue reading

Usage of ALTER in Hadoop Hive

Alter is a DDL command which helps in modifying the structure of the database objects. We can change the user provided properties of the database, structure of the tables and name of the objects. Database Level:   Database Properties:ALTER (DATABASE|SCHEMA) database_nameSET DBPROPERTIES (property_name = property_value, …); This helps in modifying the database properties which user

Continue reading

Hive – Extended Properties

In this article, you will learn how to list out the properties of a database or a table in Hive. DATABASE LEVEL: DESCRIBE DATABASE db_name;DESCRIBE SCHEMA db_name;Database or schema both are the same thing. These words can be used interchangeably. DESCRIBE DATABASE EXTENDED db_name; Use the above command to list all the database properties attached

Continue reading

Hive Table Properties

The TBLPROPERTIES clause enables you to use your own metadata key/value pairs to tag the table definition. There are also several predefined table properties, such as last-modified-user and last-modified-time, which Hive automatically adds and manages. To view the properties of a table use the below command in hive prompt. SHOW TBLPROPERTIES tblname; This lists all

Continue reading

Error while dropping the database in HIVE

InvalidOperationException(message:Database test_db2 is not empty. One or more tables exist.)If you receive the error listed above, it means that the database you are attempting to drop is not empty. In order to drop the database, the table(s) must be dropped first. This feature is very good, as most RDBMSs do not have such functionality. If

Continue reading

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s