You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "jojochuang (via GitHub)" <gi...@apache.org> on 2024/12/18 21:46:07 UTC

[PR] HDDS-11962. [Docs] Hive Integration [ozone]

jojochuang opened a new pull request, #7596:
URL: https://github.com/apache/ozone/pull/7596

   ## What changes were proposed in this pull request?
   HDDS-11962. [Docs] Hive Integration
   
   Please describe your PR in detail:
   * Add a simple user guide for Hive users to access Ozone.
   * This doc is built on top of #7588. Will rebase once the DistCp user doc is merged.
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-11947
   
   ## How was this patch tested?
   
   ./hadoop-ozone/dev-support/checks/docs.sh passed.
   
   <img width="1137" alt="Screenshot 2024-12-18 at 1 42 41 PM" src="https://github.com/user-attachments/assets/3d7a8ab5-97e0-4677-9607-82ecc814d3d3" />
   
   <img width="1136" alt="Screenshot 2024-12-18 at 1 42 48 PM" src="https://github.com/user-attachments/assets/fd5276ac-a44e-41cb-9129-56ecf2b084fc" />
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-11962. [Docs] Hive Integration [ozone]

Posted by "errose28 (via GitHub)" <gi...@apache.org>.
errose28 commented on code in PR #7596:
URL: https://github.com/apache/ozone/pull/7596#discussion_r1892856553


##########
hadoop-hdds/docs/content/integration/Hive.md:
##########
@@ -0,0 +1,86 @@
+---
+title: Hive
+weight: 4
+menu:
+   main:
+      parent: "Application integrations"
+---
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+Hive has supported Ozone since Apache Hive 4.0 through [HIVE-26360](https://issues.apache.org/jira/browse/HIVE-26360).
+
+To enable Hive to work with Ozone paths, ensure that the Ozone `ozone-filesystem-hadoop3` JAR file is added to the Hive classpath.
+
+# Accessing Ozone Data in Hive
+
+Hive provides two approaches to interact with Ozone:
+
+* External Tables
+* Managed Tables
+
+## External Tables
+
+You can create an external table in Hive using data stored in Ozone. For example:
+
+```sql
+CREATE EXTERNAL TABLE external_table (
+    id INT,
+    name STRING
+)
+LOCATION 'ofs://ozone1/vol1/bucket1/table1';
+```
+
+You can verify that Hive correctly references the Ozone path by running:

Review Comment:
   What is the expected output to know whether or not Hive is referencing Ozone here?



##########
hadoop-hdds/docs/content/integration/Hive.md:
##########
@@ -0,0 +1,86 @@
+---
+title: Hive
+weight: 4
+menu:
+   main:
+      parent: "Application integrations"
+---
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+Hive has supported Ozone since Apache Hive 4.0 through [HIVE-26360](https://issues.apache.org/jira/browse/HIVE-26360).
+
+To enable Hive to work with Ozone paths, ensure that the Ozone `ozone-filesystem-hadoop3` JAR file is added to the Hive classpath.
+
+# Accessing Ozone Data in Hive
+
+Hive provides two approaches to interact with Ozone:
+
+* External Tables
+* Managed Tables
+
+## External Tables
+
+You can create an external table in Hive using data stored in Ozone. For example:
+
+```sql
+CREATE EXTERNAL TABLE external_table (
+    id INT,
+    name STRING
+)
+LOCATION 'ofs://ozone1/vol1/bucket1/table1';
+```
+
+You can verify that Hive correctly references the Ozone path by running:
+
+```sql
+SHOW CREATE EXTERNAL TABLE external_table;
+```
+
+## Managed Tables
+
+Hive allows you to configure the Warehouse Directory to store managed tables in Ozone.
+
+To do this, set 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>
+<property>
+  <name>hive.metastore.warehouse.external.dir</name>
+  <value>ofs://ozone1/vol1/bucket1/external/</value>
+</property>
+```
+
+To create a managed table:
+```sql
+CREATE TABLE myTable (
+    id INT,
+    name STRING
+)
+```
+
+You can also load data from an Ozone location into a Hive table. For example:
+
+```sql
+LOAD DATA INPATH 'ofs://ozone1/vol1/bucket1/table.csv' INTO TABLE myTable;
+```
+
+## Using the S3A Protocol
+In addition to ofs, Hive can access Ozone via the S3 Gateway using the S3A file system. For more details, refer to the [S3 Protocol]({{< ref "interface/S3.md">}}) documentation.

Review Comment:
   Let's also link to the hadoop docs on s3a here, and maybe hive's specific docs on s3a integration if they exist.



##########
hadoop-hdds/docs/content/integration/Hive.md:
##########
@@ -0,0 +1,86 @@
+---
+title: Hive
+weight: 4
+menu:
+   main:
+      parent: "Application integrations"
+---
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+Hive has supported Ozone since Apache Hive 4.0 through [HIVE-26360](https://issues.apache.org/jira/browse/HIVE-26360).

Review Comment:
   Technically this Jijra is unresolved which looks strange. If we can resolve it I think we should link it, but in the current state it's a bit confusing.



##########
hadoop-hdds/docs/content/integration/Hive.md:
##########
@@ -0,0 +1,86 @@
+---
+title: Hive
+weight: 4
+menu:
+   main:
+      parent: "Application integrations"
+---
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+Hive has supported Ozone since Apache Hive 4.0 through [HIVE-26360](https://issues.apache.org/jira/browse/HIVE-26360).
+
+To enable Hive to work with Ozone paths, ensure that the Ozone `ozone-filesystem-hadoop3` JAR file is added to the Hive classpath.
+
+# Accessing Ozone Data in Hive
+
+Hive provides two approaches to interact with Ozone:
+
+* External Tables
+* Managed Tables
+
+## External Tables
+
+You can create an external table in Hive using data stored in Ozone. For example:
+
+```sql
+CREATE EXTERNAL TABLE external_table (
+    id INT,
+    name STRING
+)
+LOCATION 'ofs://ozone1/vol1/bucket1/table1';
+```
+
+You can verify that Hive correctly references the Ozone path by running:
+
+```sql
+SHOW CREATE EXTERNAL TABLE external_table;
+```
+
+## Managed Tables
+
+Hive allows you to configure the Warehouse Directory to store managed tables in Ozone.
+
+To do this, set the following properties in the `hive-site.xml` configuration file:

Review Comment:
   nit. Not every sentence needs to be a new line. This creates strange looking "pseudo-paragraphs" in the rendered document. These two can be a single line.



##########
hadoop-hdds/docs/content/integration/Hive.md:
##########
@@ -0,0 +1,86 @@
+---
+title: Hive
+weight: 4
+menu:
+   main:
+      parent: "Application integrations"
+---
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+Hive has supported Ozone since Apache Hive 4.0 through [HIVE-26360](https://issues.apache.org/jira/browse/HIVE-26360).

Review Comment:
   nit. Top level heading should be the first piece of content in the document. I think markdownlint on the new website will flag this. Hugo does some weird stuff using the `title` front matter at the top but IMO its better to keep it standard markdown.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-11962. [Docs] Hive Integration [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #7596:
URL: https://github.com/apache/ozone/pull/7596#issuecomment-2554333051

   Thanks @jojochuang for the patch.  The Hive doc looks good.
   
   > * This doc is built on top of HDDS-11948 ... Will rebase once the DistCp user doc is merged.
   
   If you would like to open separate PRs for doc pages, but not for the index page: create PRs for each content page, and add the same index page in all.  But do not add other content pages.
   
   This way any PR can be merged first, the rest only need removal of the index.  Rather than requiring specific order in the chain.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-11962. [Docs] Hive Integration [ozone]

Posted by "jojochuang (via GitHub)" <gi...@apache.org>.
jojochuang commented on code in PR #7596:
URL: https://github.com/apache/ozone/pull/7596#discussion_r1894371312


##########
hadoop-hdds/docs/content/integration/Hive.md:
##########
@@ -0,0 +1,86 @@
+---
+title: Hive
+weight: 4
+menu:
+   main:
+      parent: "Application integrations"
+---
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+Hive has supported Ozone since Apache Hive 4.0 through [HIVE-26360](https://issues.apache.org/jira/browse/HIVE-26360).
+
+To enable Hive to work with Ozone paths, ensure that the Ozone `ozone-filesystem-hadoop3` JAR file is added to the Hive classpath.
+
+# Accessing Ozone Data in Hive
+
+Hive provides two approaches to interact with Ozone:
+
+* External Tables
+* Managed Tables
+
+## External Tables
+
+You can create an external table in Hive using data stored in Ozone. For example:
+
+```sql
+CREATE EXTERNAL TABLE external_table (
+    id INT,
+    name STRING
+)
+LOCATION 'ofs://ozone1/vol1/bucket1/table1';
+```
+
+You can verify that Hive correctly references the Ozone path by running:
+
+```sql
+SHOW CREATE EXTERNAL TABLE external_table;
+```
+
+## Managed Tables
+
+Hive allows you to configure the Warehouse Directory to store managed tables in Ozone.
+
+To do this, set 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>
+<property>
+  <name>hive.metastore.warehouse.external.dir</name>
+  <value>ofs://ozone1/vol1/bucket1/external/</value>
+</property>
+```
+
+To create a managed table:
+```sql
+CREATE TABLE myTable (
+    id INT,
+    name STRING
+)
+```
+
+You can also load data from an Ozone location into a Hive table. For example:
+
+```sql
+LOAD DATA INPATH 'ofs://ozone1/vol1/bucket1/table.csv' INTO TABLE myTable;
+```
+
+## Using the S3A Protocol
+In addition to ofs, Hive can access Ozone via the S3 Gateway using the S3A file system. For more details, refer to the [S3 Protocol]({{< ref "interface/S3.md">}}) documentation.

Review Comment:
   Cloudera's user doc https://docs.cloudera.com/cdp-private-cloud-base/7.1.9/ozone-storing-data/topics/ozone-access-ozone-s3-using-s3a-filesystem.html is the most comprehensive and accurate one. However I'll refrain from linking a vendor's doc in Apache.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-11962. [Docs] Hive Integration [ozone]

Posted by "ayushtkn (via GitHub)" <gi...@apache.org>.
ayushtkn commented on code in PR #7596:
URL: https://github.com/apache/ozone/pull/7596#discussion_r1897478497


##########
hadoop-hdds/docs/content/integration/Hive.md:
##########
@@ -0,0 +1,86 @@
+---
+title: Hive
+weight: 4
+menu:
+   main:
+      parent: "Application integrations"
+---
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+Hive has supported Ozone since Apache Hive 4.0 through [HIVE-26360](https://issues.apache.org/jira/browse/HIVE-26360).

Review Comment:
   I resolved it now :-), maybe I forgot, but I did add Ozone in the 4.0.x release changes 
   https://hive.apache.org/docs/latest/overview-of-major-changes_283118379/



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-11962. [Docs] Hive Integration [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai merged PR #7596:
URL: https://github.com/apache/ozone/pull/7596


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-11962. [Docs] Hive Integration [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on code in PR #7596:
URL: https://github.com/apache/ozone/pull/7596#discussion_r1910843401


##########
hadoop-hdds/docs/content/integration/Hive.md:
##########
@@ -0,0 +1,170 @@
+---
+title: Hive
+weight: 4
+menu:
+   main:
+      parent: "Application Integrations"
+---
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+# Overview

Review Comment:
   ```suggestion
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-11962. [Docs] Hive Integration [ozone]

Posted by "errose28 (via GitHub)" <gi...@apache.org>.
errose28 commented on code in PR #7596:
URL: https://github.com/apache/ozone/pull/7596#discussion_r1911602401


##########
hadoop-hdds/docs/content/integration/Hive.md:
##########
@@ -0,0 +1,170 @@
+---
+title: Hive
+weight: 4
+menu:
+   main:
+      parent: "Application Integrations"
+---
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+# Overview
+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

Review Comment:
   Do we want to keep mentioning o3fs? Do we have plans to deprecate/remove it in Ozone 2.0?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-11962. [Docs] Hive Integration [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
adoroszlai commented on PR #7596:
URL: https://github.com/apache/ozone/pull/7596#issuecomment-2585349896

   Thanks @jojochuang for the patch, @ayushtkn, @errose28 for the review.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-11962. [Docs] Hive Integration [ozone]

Posted by "jojochuang (via GitHub)" <gi...@apache.org>.
jojochuang commented on PR #7596:
URL: https://github.com/apache/ozone/pull/7596#issuecomment-2557679991

   <img width="1344" alt="Screenshot 2024-12-20 at 12 30 22 PM" src="https://github.com/user-attachments/assets/ca7b7945-05f0-4289-9fd8-5d35ef98e35d" />
   
   <img width="1386" alt="Screenshot 2024-12-20 at 12 30 32 PM" src="https://github.com/user-attachments/assets/a512b02f-38f8-4d79-becd-0a8e02ff55e7" />
   
   <img width="1386" alt="Screenshot 2024-12-20 at 12 30 47 PM" src="https://github.com/user-attachments/assets/ca0238be-c25a-4e36-9d6c-688298f9dbd5" />
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-11962. [Docs] Hive Integration [ozone]

Posted by "jojochuang (via GitHub)" <gi...@apache.org>.
jojochuang commented on code in PR #7596:
URL: https://github.com/apache/ozone/pull/7596#discussion_r1909604365


##########
hadoop-hdds/docs/content/integration/Hive.md:
##########
@@ -0,0 +1,170 @@
+---
+title: Hive
+weight: 4
+menu:
+   main:
+      parent: "Application Integrations"
+---
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+# Overview
+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.
+* The metadata is stored under the external warehouse directory.
+* Note: Dropping an external table in Hive does not delete the associated data.
+
+You can also have the metadata for the external tables stored in Ozone too by applying the following configuration in the `hive-site.xml` file:

Review Comment:
   Thanks for the feedback! Please take a look at the updated doc again.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-11962. [Docs] Hive Integration [ozone]

Posted by "ayushtkn (via GitHub)" <gi...@apache.org>.
ayushtkn commented on code in PR #7596:
URL: https://github.com/apache/ozone/pull/7596#discussion_r1901487538


##########
hadoop-hdds/docs/content/integration/Hive.md:
##########
@@ -0,0 +1,170 @@
+---
+title: Hive
+weight: 4
+menu:
+   main:
+      parent: "Application Integrations"
+---
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+# Overview
+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.
+* The metadata is stored under the external warehouse directory.
+* Note: Dropping an external table in Hive does not delete the associated data.
+
+You can also have the metadata for the external tables stored in Ozone too by applying the following configuration in the `hive-site.xml` file:

Review Comment:
   Metadata is stored in HMS. only the Data is stored Storage layer, the below config will configure to store the data for External table by default in the specified path, if the path isn't explicitly specified while creating the external table.



##########
hadoop-hdds/docs/content/integration/Hive.md:
##########
@@ -0,0 +1,170 @@
+---
+title: Hive
+weight: 4
+menu:
+   main:
+      parent: "Application Integrations"
+---
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+# Overview
+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.
+* The metadata is stored under the external warehouse directory.

Review Comment:
   data is stored in the external warehouse directory, if no LOCATION is specified when creating an external table, maybe if not needed we can drop the explanation of external table itself, that goes bit into Hive scope



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-11962. [Docs] Hive Integration [ozone]

Posted by "ayushtkn (via GitHub)" <gi...@apache.org>.
ayushtkn commented on code in PR #7596:
URL: https://github.com/apache/ozone/pull/7596#discussion_r1897475474


##########
hadoop-hdds/docs/content/integration/Hive.md:
##########
@@ -0,0 +1,161 @@
+---
+title: Hive
+weight: 4
+menu:
+   main:
+      parent: "Application Integrations"
+---
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+# Overview
+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>
+<property>
+  <name>hive.metastore.warehouse.external.dir</name>
+  <value>ofs://ozone1/vol1/bucket1/external/</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`

Review Comment:
   Managed Tables will be stored in that path, `MANAGEDLOCATION`  is for Managed Tables, `LOCATION` is for External Tables
   
   https://cwiki.apache.org/confluence/display/hive/languagemanual+ddl#LanguageManualDDL-Create/Drop/Alter/UseDatabase



##########
hadoop-hdds/docs/content/integration/Hive.md:
##########
@@ -0,0 +1,161 @@
+---
+title: Hive
+weight: 4
+menu:
+   main:
+      parent: "Application Integrations"
+---
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+# Overview
+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>
+<property>
+  <name>hive.metastore.warehouse.external.dir</name>
+  <value>ofs://ozone1/vol1/bucket1/external/</value>
+</property>

Review Comment:
   not sure if this should be under the Managed table, the external.dir is for the external table
   https://github.com/apache/hive/blob/rel/release-4.0.0/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/conf/MetastoreConf.java#L1721-L1724



##########
hadoop-hdds/docs/content/integration/Hive.md:
##########
@@ -0,0 +1,161 @@
+---
+title: Hive
+weight: 4
+menu:
+   main:
+      parent: "Application Integrations"
+---
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+# Overview
+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>
+<property>
+  <name>hive.metastore.warehouse.external.dir</name>
+  <value>ofs://ozone1/vol1/bucket1/external/</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';
+```
+
+### Verifying the External Table Path
+To confirm the table's metadata and location, use:
+
+```sql
+SHOW CREATE EXTERNAL TABLE external_table;
+```

Review Comment:
   I don't think this works? I gave a quick try on 4.0.1 & it gives me Syntax Error
   <img width="1724" alt="image" src="https://github.com/user-attachments/assets/b8ddf020-cc47-41e8-a0e6-638b0ba2e590" />
   
   `External` ain't required, show create table <table Name> works irrespective of the table type
   
   Should change to `` SHOW CREATE TABLE external_table;``
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


Re: [PR] HDDS-11962. [Docs] Hive Integration [ozone]

Posted by "jojochuang (via GitHub)" <gi...@apache.org>.
jojochuang commented on code in PR #7596:
URL: https://github.com/apache/ozone/pull/7596#discussion_r1899771249


##########
hadoop-hdds/docs/content/integration/Hive.md:
##########
@@ -0,0 +1,161 @@
+---
+title: Hive
+weight: 4
+menu:
+   main:
+      parent: "Application Integrations"
+---
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+# Overview
+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>
+<property>
+  <name>hive.metastore.warehouse.external.dir</name>
+  <value>ofs://ozone1/vol1/bucket1/external/</value>
+</property>

Review Comment:
   i'll rewrite this part.



##########
hadoop-hdds/docs/content/integration/Hive.md:
##########
@@ -0,0 +1,161 @@
+---
+title: Hive
+weight: 4
+menu:
+   main:
+      parent: "Application Integrations"
+---
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+# Overview
+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>
+<property>
+  <name>hive.metastore.warehouse.external.dir</name>
+  <value>ofs://ozone1/vol1/bucket1/external/</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';
+```
+
+### Verifying the External Table Path
+To confirm the table's metadata and location, use:
+
+```sql
+SHOW CREATE EXTERNAL TABLE external_table;
+```

Review Comment:
   ah yes you're right. I probably copied it from Impala without update.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org