Getting started with hive commands

1. Use bin/hive -helpthe help of querying hive
Insert picture description here2. Use bin/hivethe command line to enter hive
3. Basic commands:

  • View database
show databases;

Insert picture description here

  • View table name
show tables;

Insert picture description here

  • View the hdfs file system in the hive cli command window
dfs -ls /;

Insert picture description here

  • View the local file system in the hive cli command window
! ls /...

Insert picture description here

  • Exit hive cli
quit;

Or exit;it's okay, there is no difference in the new version of hive.

  • Information display configuration after query

    Add the following configuration information in the hive-site.xml file, you can achieve the display of the current database, and query table header information configuration

<property>
	<name>hive.cli.print.header</name>
	<value>true</value>
</property>

<property>
	<name>hive.cli.print.current.db</name>
	<value>true</value>
</property>

Insert picture description here

Published 39 original articles · won praise 1 · views 4620

Guess you like

Origin blog.csdn.net/thetimelyrain/article/details/104124609