This is an automated email from the ASF dual-hosted git repository.
weichiu pushed a commit to branch HDDS-9225-website-v2
in repository https://gitbox.apache.org/repos/asf/ozone-site.git
The following commit(s) were added to refs/heads/HDDS-9225-website-v2 by this
push:
new ffa2aac3 HDDS-14069. adding hive integration doc (#163)
ffa2aac3 is described below
commit ffa2aac339234569be21bef8d3dd371312d8f307
Author: Jason O'Sullivan <[email protected]>
AuthorDate: Wed Dec 10 17:55:02 2025 +0000
HDDS-14069. adding hive integration doc (#163)
Co-authored-by: Wei-Chiu Chuang <[email protected]>
---
docs/04-user-guide/03-integrations/01-hive.md | 163 +++++++++++++++++++++++++-
1 file changed, 162 insertions(+), 1 deletion(-)
diff --git a/docs/04-user-guide/03-integrations/01-hive.md
b/docs/04-user-guide/03-integrations/01-hive.md
index c5966949..2e2f0d10 100644
--- a/docs/04-user-guide/03-integrations/01-hive.md
+++ b/docs/04-user-guide/03-integrations/01-hive.md
@@ -1,3 +1,164 @@
+---
+sidebar_label: Hive
+---
+
# Hive
-**TODO:** File a subtask under
[HDDS-9858](https://issues.apache.org/jira/browse/HDDS-9858) and complete this
page or section.
+Apache Hive has supported Apache Ozone since Hive 4.0. To enable Hive to work
with Ozone paths, ensure that the `ozone-filesystem-hadoop3` JAR is added to
the Hive classpath.
+
+## Supported Access Protocols
+
+Hive supports the following protocols for accessing Ozone data:
+
+- ofs
+- o3fs
+- s3a
+
+## Supported Replication Types
+
+Hive is compatible with Ozone buckets configured with either:
+
+- RATIS (Replication)
+- Erasure Coding
+
+## Accessing Ozone Data in Hive
+
+Hive provides two methods to interact with data in Ozone:
+
+- Managed Tables
+- External Tables
+
+### Managed Tables
+
+#### Configuring the Hive Warehouse Directory in Ozone
+
+To store managed tables in Ozone, update the following properties in the
`hive-site.xml` configuration file:
+
+```xml
+<property>
+ <name>hive.metastore.warehouse.dir</name>
+ <value>ofs://ozone1/vol1/bucket1/warehouse/</value>
+</property>
+```
+
+#### Creating a Managed Table
+
+You can create a managed table with a standard `CREATE TABLE` statement:
+
+```sql
+CREATE TABLE myTable (
+ id INT,
+ name STRING
+);
+```
+
+#### Loading Data into a Managed Table
+
+Data can be loaded into a Hive table from an Ozone location:
+
+```sql
+LOAD DATA INPATH 'ofs://ozone1/vol1/bucket1/table.csv' INTO TABLE myTable;
+```
+
+#### Specifying a Custom Ozone Path
+
+You can define a custom Ozone path for a database using the `MANAGEDLOCATION`
clause:
+
+```sql
+CREATE DATABASE d1 MANAGEDLOCATION 'ofs://ozone1/vol1/bucket1/data';
+```
+
+Tables created in the database d1 will be stored under the specified path:
+
+`ofs://ozone1/vol1/bucket1/data`
+
+#### Verifying the Ozone Path
+
+You can confirm that Hive references the correct Ozone path using:
+
+```sql
+SHOW CREATE DATABASE d1;
+```
+
+Output Example:
+
+```text
++----------------------------------------------------+
+| createdb_stmt |
++----------------------------------------------------+
+| CREATE DATABASE `d1` |
+| LOCATION |
+| 'ofs://ozone1/vol1/bucket1/external/d1.db' |
+| MANAGEDLOCATION |
+| 'ofs://ozone1/vol1/bucket1/data' |
++----------------------------------------------------+
+```
+
+### External Tables
+
+Hive allows the creation of external tables to query existing data stored in
Ozone.
+
+#### Creating an External Table
+
+```sql
+CREATE EXTERNAL TABLE external_table (
+ id INT,
+ name STRING
+)
+LOCATION 'ofs://ozone1/vol1/bucket1/table1';
+```
+
+- With external tables, the data is expected to be created and managed by
another tool.
+- Hive queries the data as-is.
+- Note: Dropping an external table in Hive does not delete the associated data.
+
+To set a default path for external tables, configure the following property in
the `hive-site.xml` file:
+
+```xml
+<property>
+ <name>hive.metastore.warehouse.external.dir</name>
+ <value>ofs://ozone1/vol1/bucket1/external/</value>
+</property>
+```
+
+This property specifies the base directory for external tables when no
explicit LOCATION is provided.
+
+#### Verifying the External Table Path
+
+To confirm the table's metadata and location, use:
+
+```sql
+SHOW CREATE TABLE external_table;
+```
+
+Output Example:
+
+```text
++----------------------------------------------------+
+| createtab_stmt |
++----------------------------------------------------+
+| CREATE EXTERNAL TABLE `external_table`( |
+| `id` int, |
+| `name` string) |
+| ROW FORMAT SERDE |
+| 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' |
+| STORED AS INPUTFORMAT |
+| 'org.apache.hadoop.mapred.TextInputFormat' |
+| OUTPUTFORMAT |
+| 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' |
+| LOCATION |
+| 'ofs://ozone1/vol1/bucket1/table1' |
+| TBLPROPERTIES ( |
+| 'bucketing_version'='2', |
+| 'transient_lastDdlTime'='1734725573') |
++----------------------------------------------------+
+```
+
+## Using the S3A Protocol
+
+In addition to ofs, Hive can access Ozone using the S3 Gateway via the S3A
file system.
+
+For more information, consult:
+
+- The [S3 Protocol](../01-client-interfaces/03-s3.md)
+- The [Hadoop
S3A](https://hadoop.apache.org/docs/current/hadoop-aws/tools/hadoop-aws/index.html)
documentation.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]