← 返回命令列表

Linux command

hive 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Start Hive shell

hive

Execute query

hive -e "SELECT * FROM [table]"

Run script file

hive -f [script.hql]

Set configuration

hive --hiveconf [key=value]

Silent mode

hive -S -e "[query]"

说明

Hive is a data warehouse system for Hadoop. It provides SQL-like query language (HiveQL) for querying large datasets stored in HDFS. The tool translates queries to MapReduce, Tez, or Spark jobs. It's used for data analysis and ETL on big data platforms.

参数

-e _QUERY_
Execute query.
-f _FILE_
Execute script file.
-S, --silent
Silent mode.
--hiveconf _KEY=VALUE_
Set configuration.
--database _DB_
Use database.
-i _FILE_
Initialization file.
--help
Display help information.

FAQ

What is the hive command used for?

Hive is a data warehouse system for Hadoop. It provides SQL-like query language (HiveQL) for querying large datasets stored in HDFS. The tool translates queries to MapReduce, Tez, or Spark jobs. It's used for data analysis and ETL on big data platforms.

How do I run a basic hive example?

Run `hive` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -e _QUERY_ do in hive?

Execute query.