• Home
  • Docker
  • Kubernetes
  • LLMs
  • Java
  • Ubuntu
  • Maven
  • Big Data
  • Archived
Big Data | Manage Hive Databases
  1. References
  2. Internal (managed) Tables vs External Tables
  3. Supported file formats
  4. Create a database (using external tables)

  1. References
    See these pages for more details about Apache Hive:
    https://cwiki.apache.org/confluence/display/Hive/GettingStarted
    https://cwiki.apache.org/confluence/display/Hive/LanguageManual
    https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF
  2. Internal (managed) Tables vs External Tables
    See: https://cwiki.apache.org/confluence/display/Hive/Managed+vs.+External+Tables

    • Internal (managed) Table: Hive manage both the metadata and the data of the table.
      If a managed table is dropped then the table data and its metadata are deleted.
      The data of a managed table (for a specific database DATABASE-NAME.db) is stored under the hive.metastore.warehouse.dir directory (default: /hive/warehouse/).


    • External Table: Hive manage only the metadata of the table while the data is located into a location specified when the table is created.
      If an external table is dropped then only the table metadata is deleted.


    You can use the command DESCRIBE FORMATTED table_name to identify if a table is an internal (managed) or an external table.
    The command displays MANAGED_TABLE for internal table type and EXTERNAL_TABLE for external table type.

    Describe internal tables:

    Describe external tables:
  3. Supported file formats
    See these pages for more details about supported file formats:
    https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL

    Create Table statement:

    Supported file formats:

    Example: ORC Table
  4. Create a database (using external tables)
    Create HDFS location:

    Switch to "hive" user:

    Create Hive database:

    Define Hive tables:

    Create Hive tables (using hive command line):

    Create Hive tables (using beeline command line):

    Validate Hive database and tables:

    Drop Hive database (metadata):

    Drop Hive database (data):
© 2025  mtitek