> For the complete documentation index, see [llms.txt](https://upsolver.gitbook.io/content/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://upsolver.gitbook.io/content/reference-1/sql-commands/connections/create-connection/hive-metastore.md).

# Hive Metastore

Establishing a Hive Metastore connection allows Upsolver to integrate with the Hive ecosystem, enabling you to create, modify, and query tables within Upsolver. These tables can also be queried from other Hive-compatible services and the Upsolver UI.

This documentation assumes that you have created the Amazon S3 connection `s3` with the correct write permissions to the specified storage location. Refer to Upsolver's documentation on creating an [Amazon S3](/content/reference-1/sql-commands/connections/create-connection/amazon-s3.md) connection for more details.

```sql
CREATE HIVE_METASTORE CONNECTION <connection_name>  
    URI = 'thrift://<hostname>:<port>'  
    [ COMMENT = '<comment>' ]  
    [ DEFAULT_SCHEMA = '<default_schema>' ]  
    [ USER_NAME = '<username>' ]  
    [ PASSWORD = '<password>' ]  
    [ CLIENT_PROPERTIES = ( PROPERTY = 'VALUE' [, ...] ) ]  
    [ MAX_CONCURRENT_OPERATIONS = <integer> ]  
    [ DEFAULT_STORAGE_CONNECTION = <storage_connection_identifier> ]  
    [ DEFAULT_STORAGE_LOCATION = 's3://<bucket>/<prefix>/' ]
```

## Connection Options

#### `URI` — Required

* **Type**: text\
  The URI of your Hive Metastore service, usually in the `thrift://<hostname>:<port>` format.

#### `COMMENT` — Optional

* **Type**: text\
  (Optional) A description or comment regarding this connection.

#### `DEFAULT_SCHEMA` — Optional

* **Type**: text\
  (Optional) The default schema to use for tables under this connection.

#### `USER_NAME` — Optional

* **Type**: text\
  (Optional) The username for authentication to Hive Metastore.

#### `PASSWORD` — Optional

* **Type**: text\
  (Optional) The password for authentication to Hive Metastore.

#### `CLIENT_PROPERTIES` — Optional

* **Type**: text\
  (Optional) Additional client properties for the Hive connection. Formatted as a list: `CLIENT_PROPERTIES = ( PROPERTY = 'VALUE' [, ...] )`.

#### `MAX_CONCURRENT_OPERATIONS` — Optional

* **Type**: integer\
  (Optional) The maximum number of concurrent operations that can be used by Upsolver servers for this connection.

#### `DEFAULT_STORAGE_CONNECTION` — Optional

* **Type**: identifier\
  (Optional) An Amazon S3 connection identifier with the appropriate credentials to write to the provided storage location.

#### `DEFAULT_STORAGE_LOCATION` — Optional

* **Type**: text\
  (Optional) The Amazon S3 path that serves as the default storage location for the underlying files associated with tables created under this metastore connection.

## Minimum Example

```sql
CREATE HIVE_METASTORE CONNECTION my_hive_connection  
    URI = 'thrift://hive.upsolver.com:9083'  
    DEFAULT_STORAGE_CONNECTION = s3  
    DEFAULT_STORAGE_LOCATION = 's3://test-bucket/prefix/';
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://upsolver.gitbook.io/content/reference-1/sql-commands/connections/create-connection/hive-metastore.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
