Database Reference
In-Depth Information
The SHOW DATABASES statement
To get the list of databases available for Impala, use the
SHOW DATABASE
statement
with the following syntax:
SHOW DATABASES;
Using database-specific query sentence in an example
Now, let's see an example of database-specific statements to understand everything
together. If you have just installed Impala, started it, and run
SHOW DATABASE
, you
will see only one database name,
default
, as shown in the following example:
[Hadoop.testdomain:21000] > show databases;
Query: show databases
Query finished, fetching results ...
+---------+
| name |
+---------+
| default |
+---------+
Returned 1 row(s) in 0.12s
[Hadoop.testdomain:21000] > create database
items;
Query: create database items
[Hadoop.testdomain:21000] > use items;
Query: use items
[Hadoop.testdomain:21000] > create table list
(item string, total int);
Query: create table list (item string, total
int)
[Hadoop.testdomain:21000] > show databases;
Query: show databases
Query finished, fetching results ...
+---------+
| name |
+---------+