INNER JOIN

INNER JOIN or JOIN returns rows meeting the join conditions from both sides of joined tables. The JOIN keyword can also be omitted by comma-separated table names; this is called an implicit join. Here are examples of the HQL JOIN operation:

  1. First, prepare a table to join with and load data to it:
      > CREATE TABLE IF NOT EXISTS employee_hr (      > name string,      > employee_id int,      > sin_number string,      > start_date date      > )      > ROW FORMAT DELIMITED      > FIELDS TERMINATED BY '|';      No rows affected (1.732 seconds)            > LOAD DATA INPATH '/tmp/hivedemo/data/employee_hr.txt'      > OVERWRITE INTO TABLE employee_hr;      No rows affected (0.635 seconds)
  1. Perform an INNER JOIN between two tables with equal and unequal join conditions, along with complex expressions ...

Get Apache Hive Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.