| <?xml version="1.0" encoding="UTF-8"?> |
| <!DOCTYPE html |
| PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> |
| <head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| |
| <meta name="copyright" content="(C) Copyright 2025" /> |
| <meta name="DC.rights.owner" content="(C) Copyright 2025" /> |
| <meta name="DC.Type" content="concept" /> |
| <meta name="DC.Title" content="Overview of Impala Databases" /> |
| <meta name="DC.Relation" scheme="URI" content="../topics/impala_schema_objects.html" /> |
| <meta name="prodname" content="Impala" /> |
| <meta name="prodname" content="Impala" /> |
| <meta name="version" content="Impala 3.4.x" /> |
| <meta name="version" content="Impala 3.4.x" /> |
| <meta name="DC.Format" content="XHTML" /> |
| <meta name="DC.Identifier" content="databases" /> |
| <link rel="stylesheet" type="text/css" href="../commonltr.css" /> |
| <title>Overview of Impala Databases</title> |
| </head> |
| <body id="databases"> |
| |
| |
| <h1 class="title topictitle1" id="ariaid-title1">Overview of Impala Databases</h1> |
| |
| |
| |
| |
| <div class="body conbody"> |
| |
| <p class="p"> |
| In Impala, a database is a logical container for a group of tables. Each database defines a separate |
| namespace. Within a database, you can refer to the tables inside it using their unqualified names. Different |
| databases can contain tables with identical names. |
| </p> |
| |
| |
| <p class="p"> Creating a database is a lightweight operation. There are minimal |
| database-specific properties to configure, such as |
| <code class="ph codeph">LOCATION</code> and <code class="ph codeph">COMMENT</code>. </p> |
| |
| <p class="p">You can change the owner of a database with the <code class="ph codeph">ALTER |
| DATABASE</code> statement. </p> |
| |
| |
| <p class="p"> |
| Typically, you create a separate database for each project or application, to avoid naming conflicts between |
| tables and to make clear which tables are related to each other. The <code class="ph codeph">USE</code> statement lets |
| you switch between databases. Unqualified references to tables, views, and functions refer to objects |
| within the current database. You can also refer to objects in other databases by using qualified names |
| of the form <code class="ph codeph"><var class="keyword varname">dbname</var>.<var class="keyword varname">object_name</var></code>. |
| </p> |
| |
| |
| <p class="p"> |
| Each database is physically represented by a directory in HDFS. When you do not specify a <code class="ph codeph">LOCATION</code> |
| attribute, the directory is located in the Impala data directory with the associated tables managed by Impala. |
| When you do specify a <code class="ph codeph">LOCATION</code> attribute, any read and write operations for tables in that |
| database are relative to the specified HDFS directory. |
| </p> |
| |
| |
| <p class="p"> |
| There is a special database, named <code class="ph codeph">default</code>, where you begin when you connect to Impala. |
| Tables created in <code class="ph codeph">default</code> are physically located one level higher in HDFS than all the |
| user-created databases. |
| </p> |
| |
| |
| <div class="p"> |
| Impala includes another predefined database, <code class="ph codeph">_impala_builtins</code>, that |
| serves as the location for the |
| <a class="xref" href="../shared/../topics/impala_functions.html#builtins">built-in functions</a>. To see |
| the built-in functions, use a statement like the following: |
| <pre class="pre codeblock"><code>show functions in _impala_builtins; |
| show functions in _impala_builtins like '*<var class="keyword varname">substring</var>*'; |
| </code></pre> |
| </div> |
| |
| |
| <p class="p"> |
| <strong class="ph b">Related statements:</strong> |
| </p> |
| |
| |
| <p class="p"> |
| <a class="xref" href="impala_create_database.html#create_database">CREATE DATABASE Statement</a>, |
| <a class="xref" href="impala_drop_database.html#drop_database">DROP DATABASE Statement</a>, <a class="xref" href="impala_use.html#use">USE Statement</a>, |
| <a class="xref" href="impala_show.html#show_databases">SHOW DATABASES</a> |
| </p> |
| |
| </div> |
| |
| <div class="related-links"> |
| <div class="familylinks"> |
| <div class="parentlink"><strong>Parent topic:</strong> <a class="link" href="../topics/impala_schema_objects.html">Impala Schema Objects and Object Names</a></div> |
| </div> |
| </div></body> |
| </html> |