1. Use bin/hive -help
the help of querying hive
2. Use
bin/hive
the command line to enter hive
3. Basic commands:
- View database
show databases;
- View table name
show tables;
- View the hdfs file system in the hive cli command window
dfs -ls /;
- View the local file system in the hive cli command window
! ls /...
- 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>