Database Reference
In-Depth Information
dfs -lsr
The Hive CLI also supports basic autocomplete; that is, if you start typing
a keyword or function and press the Tab key, it tries to complete the word.
For example, if you type in cre and press Tab, it will complete it to create .
If you press Tab on a new line, it prompts you if you want a list of all
427 possibilities. The CLI also maintains a history of previous commands
entered. You can retrieve these values by pressing the up- and down-arrow
keys. If you have a previously entered command selected, you can press the
Enter key to run it again.
Creating and Querying Basic Tables
This section covers the basics of creating and organizing tables in Hive, as
well as how to query them. If you are comfortable with SQL, you should find
the commands familiar.
Creating Databases
Hive databases are essentially a way to organize tables. They are similar
to the concept of a schema in SQL Server. In fact, Hive supports SCHEMA
as a synonym for the DATABASE keyword. Databases are most often used
to organize tables when there are multiple groups using the Hive server.
When a database is created, Hive creates a folder in the Hadoop file system,
by default using the same name as specified for the database, with .db
appended to it. Any objects that are created using that database will be
stored in the database's directory. If you don't specify a database when you
create a table, it will be created in the default database.
Tocreateadatabase,usethe CREATE DATABASE command,followedbythe
name of the database:
CREATE DATABASE MsBigData;
Search WWH ::




Custom Search