Forrest logo
back to the hive tool

hive:tldr:8a4ac

hive: Start a Hive interactive shell.
$ hive
try on your machine

Hive is a command-line interface that enables users to interact with Apache Hive, a data warehouse infrastructure built on top of Hadoop. Hive provides a SQL-like language called HiveQL that allows users to write queries in a declarative manner and process data stored in Hadoop Distributed File System (HDFS) or other compatible file systems.

When you execute the "hive" command, it opens the Hive shell, which is an interactive environment for running HiveQL queries. The shell allows you to type HiveQL statements, which are then processed and executed on your Hadoop cluster.

Once inside the Hive shell, you can perform various operations such as creating and managing databases, tables, and partitions, importing and exporting data, executing queries, and more. Hive handles the conversion of HiveQL queries into MapReduce or Tez jobs, allowing you to perform scalable data processing and analysis on big datasets.

Here are a few common examples of commands you can use within the Hive shell:

  • SHOW DATABASES: Lists all available databases.
  • USE database_name: Switches to a specific database.
  • SHOW TABLES: Lists all tables in the selected database.
  • CREATE TABLE table_name: Creates a new table.
  • LOAD DATA INPATH 'path_to_data' INTO TABLE table_name: Loads data from a file into a table.
  • SELECT * FROM table_name: Retrieves all records from a table.
  • INSERT INTO TABLE table_name VALUES (value1, value2, ...): Inserts new records into a table.
  • DESCRIBE table_name: Provides the structure and metadata of a table.

By using Hive, you can leverage the power and flexibility of the Hadoop ecosystem, process large volumes of data, and perform complex data analytics tasks using familiar SQL-like syntax.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the hive tool