Import Table From Sqoop to Hive Without Data

The below command helps in creating a table in Hive based on the MySQL table’s definition. 

sqoop create-hive-table
–table employees
–hive-table emp;

This will just create the table structure in Hive as “Emp” based on MySQL’s Employees table’s structure and no data will be imported. 



If you look at the above screens, the data types are converted automatically. The varchar became string and the decimal became “double” in Hive. 

Before implementing, make sure the table “Employees” exists in MySQL retail_db database and the table “Emp” does not exists in Hive. By default, the table will be imported in “default” database in Hive.

Leave a Reply

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

You are commenting using your 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