Apache Hive Tables API

Table metadata operations

OpenAPI Specification

apache-hive-tables-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Apache Hive WebHCat REST Databases Tables API
  version: 1.0.0
  description: WebHCat REST API for Apache Hive providing DDL operations, HiveQL job submission, and Hive Metastore metadata access over HTTP.
  contact:
    email: user@hive.apache.org
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: http://localhost:50111/templeton/v1
  description: WebHCat (Templeton) REST API
tags:
- name: Tables
  description: Table metadata operations
paths:
  /ddl/database/{dbName}/table:
    get:
      operationId: listTables
      summary: Apache Hive List Tables
      description: List all tables in a Hive database.
      tags:
      - Tables
      parameters:
      - name: dbName
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Tables listed
          content:
            application/json:
              schema:
                type: object
                properties:
                  tables:
                    type: array
                    items:
                      type: string
  /ddl/database/{dbName}/table/{tableName}:
    get:
      operationId: getTable
      summary: Apache Hive Get Table
      description: Get schema and metadata for a specific Hive table.
      tags:
      - Tables
      parameters:
      - name: dbName
        in: path
        required: true
        schema:
          type: string
      - name: tableName
        in: path
        required: true
        schema:
          type: string
        description: Table name
      responses:
        '200':
          description: Table retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Table'
        '404':
          description: Table not found
  /ddl/database/{dbName}/table/{tableName}/partition:
    get:
      operationId: listPartitions
      summary: Apache Hive List Partitions
      description: List all partitions for a Hive table.
      tags:
      - Tables
      parameters:
      - name: dbName
        in: path
        required: true
        schema:
          type: string
      - name: tableName
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Partitions listed
          content:
            application/json:
              schema:
                type: object
                properties:
                  partitions:
                    type: array
                    items:
                      $ref: '#/components/schemas/Partition'
components:
  schemas:
    Partition:
      type: object
      description: Hive table partition
      properties:
        tableName:
          type: string
          description: Table name
          example: sales
        dbName:
          type: string
          description: Database name
          example: mydb
        values:
          type: array
          items:
            type: string
          description: Partition key values
          example:
          - 2024-01
          - US
        location:
          type: string
          description: Partition HDFS location
          example: hdfs://namenode/user/hive/warehouse/mydb.db/sales/dt=2024-01/country=US
        numRows:
          type: integer
          format: int64
          description: Approximate row count
          example: 50000
    Table:
      type: object
      description: Hive table metadata
      properties:
        tableName:
          type: string
          description: Table name
          example: sales
        dbName:
          type: string
          description: Database name
          example: mydb
        tableType:
          type: string
          description: Table type (MANAGED_TABLE, EXTERNAL_TABLE, VIRTUAL_VIEW)
          example: MANAGED_TABLE
        comment:
          type: string
          description: Table description
          example: Sales transaction data
        location:
          type: string
          description: HDFS data location
          example: hdfs://namenode/user/hive/warehouse/mydb.db/sales
        inputFormat:
          type: string
          description: Input format class
          example: org.apache.hadoop.hive.ql.io.orc.OrcInputFormat
        outputFormat:
          type: string
          description: Output format class
          example: org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat
        numRows:
          type: integer
          format: int64
          description: Approximate number of rows
          example: 1000000