![]() |
VOOZH | about |
We are going to create a database and create a table in our database. And will cover Database operations in HIVE Using CLOUDERA - VMWARE Work Station. Let's discuss one by one.
Introduction:
Requirements:
Cloudera:
Cloudera enables you to deploy and manage Apache Hadoop, manipulate and analyze your data, and keep that data secure and protected.
Step 1: On your desktop VMware workstation is available. Open that.
👁 ImageStep 2: Now you will get an interface. Click on open a virtual device.
👁 ImageStep 3: Select path - In this step, you have to select the path and file where you have downloaded the file.
👁 ImageStep 4: Now your virtual environment is creating.
👁 ImageStep 5: You can view your virtual machine details in this path.
👁 ImageStep 6: Now open the terminal to get started with hive commands.
👁 ImageStep 7: Now type hive in the terminal. It will give output as follows.
[cloudera@quickstart ~]$ hive 2020-12-09 20:59:24,314 WARN [main] mapreduce.TableMapReduceUtil: The hbase-prefix-tree module jar containing PrefixTreeCodec is not present. Continuing without it. Logging initialized using configuration in file:/etc/hive/conf.dist/hive-log4j.properties WARNING: Hive CLI is deprecated and migration to Beeline is recommended. hive>
Step 8: Now, you are all set and ready to start typing your hive commands.
1. Create a database
Syntax:
create database database_name;
Example:
create database geeksportal;
Output:
👁 Image2. Creating a table
Syntax:
create database.tablename(columns);
Example:
create table geeksportal.geekdata(id int,name string);
Here id and string are the two columns.
Output :
👁 Image3. Display Database
Syntax:
show databases;
Output: Display the databases created.
👁 Image4. Describe Database
Syntax:
describe database database_name;
Example:
describe database geeksportal;
Output: Display the HDFS path of a particular database.
👁 Image