HiveQL Select-Where - Apache Hive

What is Apache HiveQL?

The Hive Query Language (HiveQL) is a query language for Hive to process and analyze structured data in a Metastore. This topic describes about how to use the SELECT statement with WHERE clause.
SELECT statement is used to retrieve the data from a table as well as WHERE clause also retrieves the data from a table. It verifies the data with the condition and gives you a finite result. The built-in operators and functions generate an expression, which fulfils the condition.

Syntax

Given below is the syntax of the SELECT query:

Example

Let us take an example for SELECT…WHERE clause. Assume we have the employee table as given below, with fields named Id, Name, Salary, Designation, and Dept. Generate a query to retrieve the employee details who earn a salary of more than Rs 30000.
The following query retrieves the employee details using the above scenario:
On successful execution of the query, you get to see the following response:

JDBC Program

The JDBC program to apply where clause for the given example is as follows.
Save the program in a file named HiveQLWhere.java. Use the following commands to compile and execute this program.

Output:

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Apache Hive Topics