You are on page 1of 4

(/)

Hive Indexes and View with Example


What is a View?
Views are similar to tables, which are generated based on
the requirements.

Automate your Python Projects


We can save any result set data as a view in Hive
Choose from an inventory of 400+ vetted packages Usage is similar to as views used in SQL
including NumPy, SciPy and more.
All type of DML operations can be performed on a view
ActiveState Open

Creation of View:

Syntax:

Create VIEW <VIEWNAME> AS SELECT

Example:

Hive>Create VIEW Sample_ViewAS SELECT * FROM employees WHERE salary>25000

In this example, we are creating view Sample_View where it will display all the row values
with salary field greater than 25000.

What is Index?
Indexes are pointers to particular column name of a table.

The user has to manually define the index


Wherever we are creating index, it means that we are creating pointer to particular
column name of table
Any Changes made to the column present in tables are stored using the index value
created on the column name.

Syntax:

/
Create INDEX <INDEX_NAME> ON TABLE < TABLE_NAME(column names)>

Example:

Create INDEX sample_Index ON TABLE guruhive_internaltable(id)

Here we are creating index on table guruhive_internaltable for column name id.

 Prev (/hive-partitions-buckets-example.html) Report a Bug

Next  (/hive-queries-implementation.html)

YOU MIGHT LIKE:

HIVE HIVE HIVE

(/hive-metastore- (/hive-partitions-buckets- (/hive-create-alter-drop-


configuration-mysql.html) example.html) table.html) (/hive-
(/hive-metastore- (/hive-partitions- create-alter-drop-
configuration- buckets-example.html) table.html)
mysql.html) Hive Partitions & Buckets Hive Create, Alter & Drop
HIVE Metastore with Example Table
Configuration with MYSQL (/hive-partitions-buckets- (/hive-create-alter-drop-
(/hive-metastore- example.html) table.html)
configuration-mysql.html)

HIVE HIVE
/
(/hive-join-subquery.html) (/hive-user-defined-
(/hive-join- functions.html)
subquery.html) (/hive-user-
Hive Join & SubQuery defined-functions.html)
Tutorial with Examples Hive Function: Built-in &
(/hive-join-subquery.html) UDF (User Defined
Functions)
(/hive-user-defined-
functions.html)

Hive Tutorials
2) Install and Configuration (/installation-configuration-hive-mysql.html)

3) Metastore Configuration (/hive-metastore-configuration-mysql.html)

4) Data operations in Hive (/data-operations-hive.html)

5) Create, Alter & Drop Table (/hive-create-alter-drop-table.html)

6) Partitions & Buckets (/hive-partitions-buckets-example.html)

7) Indexes and View (/hive-indexes-view-example.html)

8) Queries and Implementation (/hive-queries-implementation.html)

9) Join & SubQuery (/hive-join-subquery.html)

10) Query Language & Operators (/hive-query-language-built-operators-functions.html)

11) Function: Built-in & UDF (/hive-user-defined-functions.html)

12) Data Extraction Using Hive (/data-extraction-hive.html)

 (https://www.facebook.com/guru99com/)
 (https://twitter.com/guru99com) 
(https://www.linkedin.com/company/guru99/)

(https://www.youtube.com/channel/UC19i1XD6k88KqHlET8atqFQ)

(https://forms.aweber.com/form/46/724807646.htm)

About
/
About Us (/about-us.html)
Advertise with Us (/advertise-us.html)
Write For Us (/become-an-instructor.html)
Contact Us (/contact-us.html)

Career Suggestion
SAP Career Suggestion Tool (/best-sap-module.html)
Software Testing as a Career (/software-testing-career-
complete-guide.html)

Interesting
eBook (/ebook-pdf.html)
Blog (/blog/)
Quiz (/tests.html)
SAP eBook (/sap-ebook-pdf.html)

Execute online
Execute Java Online (/try-java-editor.html)
Execute Javascript (/execute-javascript-online.html)
Execute HTML (/execute-html-online.html)
Execute Python (/execute-python-online.html)

© Copyright - Guru99 2020


        Privacy Policy (/privacy-policy.html)  |  Affiliate
Disclaimer (/affiliate-earning-disclaimer.html)  |  ToS
(/terms-of-service.html)

You might also like