You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by "maomaodev (via GitHub)" <gi...@apache.org> on 2026/08/27 15:25:24 UTC

[PR] [KYUUBI #7664][DOC] Reformat and improve docs for KSHC [kyuubi]

maomaodev opened a new pull request, #7667:
URL: https://github.com/apache/kyuubi/pull/7667

   <!--
   Thanks for sending a pull request!
   
   Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/master/contributing/code/index.html
     2. If the PR is related to an issue in https://github.com/apache/kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
   -->
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new feature, clarify the use cases.
     2. If you fix a bug, you can clarify why it is a bug, and what versions are affected.
   -->
   1. Reformat KSHC docs from RST to Markdown, as described in the issue https://github.com/apache/kyuubi/issues/7434.
   2. Enrich the description for KSCH.
   
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   Tested by building the documentation and comparing the pages against the live site:
   ```
   open https://kyuubi.readthedocs.io/en/master/connector/spark/hive.html
   open _build/html/connector/spark/hive.html
   ```
   
   
   ### Was this patch assisted by generative AI tooling?
   <!--
   If generative AI tooling has assisted in authoring or reviewing this patch, please include
   an 'Assisted-by: ' trailer that identifies the agent and/or model.
   For example: 'Assisted-by: Claude Opus 4.7' or 'Assisted-by: Claude:claude-opus-4-7'.
   If no, write 'No'.
   Please refer to the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
   -->
   Assisted-by: DeepSeek-V4-Pro


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


Re: [PR] [KYUUBI #7664][DOC] Reformat and improve docs for KSHC [kyuubi]

Posted by "maomaodev (via GitHub)" <gi...@apache.org>.
maomaodev commented on code in PR #7667:
URL: https://github.com/apache/kyuubi/pull/7667#discussion_r3877827589


##########
docs/connector/spark/hive.md:
##########
@@ -0,0 +1,166 @@
+<!--
+- 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
+
+You may know that the Apache Spark has built-in support for accessing Hive tables, it works well in most cases,
+but is limited to one Hive Metastore. The Kyuubi Spark Hive connector(KSHC) implemented a Hive connector based
+on Spark DataSource V2 API, supports accessing multiple Hive Metastore in a single Spark application.
+
+## Hive Integration
+
+To enable the integration of Kyuubi Spark SQL engine and Hive connector through
+Spark DataSource V2 API, you need to:
+
+- Referencing the Hive connector [dependencies](#kshc-dependencies)
+- Setting the Spark catalog [configurations](#kshc-configurations)
+
+(kshc-dependencies)=
+
+### Dependencies
+
+The **classpath** of Kyuubi Spark SQL engine with Hive connector supported consists of
+
+1. kyuubi-spark-sql-engine-{{ release }}_2.12.jar, the engine jar deployed with a Kyuubi distribution
+2. a copy of Spark distribution
+3. kyuubi-spark-connector-hive_2.12-{{ release }}, which can be found in the [Maven Central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-spark-connector-hive)
+
+In order to make the Hive connector packages visible for the runtime classpath of engines, we can use one of these methods:
+
+1. Put the Kyuubi Hive connector packages into `$SPARK_HOME/jars` directly
+2. Set `spark.jars=/path/to/kyuubi-hive-connector`
+
+```{note}
+Starting from v1.9.2 and v1.10.0, KSHC jars available in the [Maven Central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-spark-connector-hive) guarantee binary compatibility across
+multiple Spark versions, so a single jar works across them without rebuilding.
+```
+
+(kshc-configurations)=
+
+### Configurations
+
+To activate functionality of Kyuubi Spark Hive connector, we can set the following configurations:
+
+```properties
+spark.sql.catalog.hive_catalog                      org.apache.kyuubi.spark.connector.hive.HiveTableCatalog
+spark.sql.catalog.hive_catalog.hive.metastore.uris  thrift://metastore-host:port
+spark.sql.catalog.hive_catalog.<other.hive.conf>    <value>
+spark.sql.catalog.hive_catalog.<other.hadoop.conf>  <value>
+```
+
+Besides the catalog-level configurations above, the Kyuubi Spark Hive connector provides the following configurations:
+
+|                              Key                               |      Default      |                                                                                                          Meaning                                                                                                           |  Type   | Since  |
+|----------------------------------------------------------------|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|--------|
+| `spark.sql.kyuubi.hive.connector.externalCatalog.share.policy` | `ONE_FOR_ALL`     | The share policy for the external catalog. `ONE_FOR_ONE` means an external catalog is used by only one `HiveTableCatalog`, while `ONE_FOR_ALL` shares an external catalog globally across the catalogs with the same name. | string  | 1.7.0  |
+| `spark.sql.catalog.<catalog>.delegation.token.renewal.enabled` | `true`            | Whether to enable delegation token renewal for the Kerberized Hive Metastore of this catalog.                                                                                                                              | boolean | 1.8.0  |
+| `spark.sql.kyuubi.hive.connector.read.convertMetastoreParquet` | `true`            | When enabled, the data source Parquet reader is used to process Parquet tables created by HiveQL syntax, instead of the Hive SerDe.                                                                                        | boolean | 1.11.0 |
+| `spark.sql.kyuubi.hive.connector.read.convertMetastoreOrc`     | `true`            | When enabled, the data source ORC reader is used to process ORC tables created by HiveQL syntax, instead of the Hive SerDe.                                                                                                | boolean | 1.11.0 |
+| `spark.sql.kyuubi.hive.connector.dropTableAsPurgeTable`        | `false`           | When enabled, `DROP TABLE` completely removes its data by skipping HDFS trash, equivalent to the `PURGE TABLE` command.                                                                                                    | boolean | 1.12.0 |
+| `spark.sql.catalog.<catalog>.hive.metastore.warehouse.dir`     | &lt;undefined&gt; | The default warehouse directory for the catalog, taking precedence over the global `spark.sql.warehouse.dir` when creating a database.                                                                                     | string  | 1.12.0 |
+
+```{note}
+Catalog-level configurations (`spark.sql.catalog.<catalog>.*`) are captured when the catalog is
+initialized, so they must be present at the Spark application bootstrap (in `spark-defaults.conf`
+or via `--conf`). Setting them through `SET` after the catalog has been created does not take
+effect, e.g. `SET spark.sql.catalog.<catalog>.<key>=<value>`.
+```
+
+## Hive Connector Operations
+
+Taking `CREATE NAMESPACE` as an example,
+
+```sql
+CREATE NAMESPACE ns;
+```
+
+Taking `CREATE TABLE` as an example,
+
+```sql
+CREATE TABLE hive_catalog.ns.foo (
+  id bigint COMMENT 'unique id',
+  data string)
+USING parquet;
+```
+
+Taking `SELECT` as an example,
+
+```sql
+SELECT * FROM hive_catalog.ns.foo;
+```
+
+Taking `INSERT` as an example,
+
+```sql
+INSERT INTO hive_catalog.ns.foo VALUES (1, 'a'), (2, 'b'), (3, 'c');
+```
+
+Taking `DROP TABLE` as an example,
+
+```sql
+DROP TABLE hive_catalog.ns.foo;
+```
+
+Taking `DROP NAMESPACE` as an example,
+
+```sql
+DROP NAMESPACE hive_catalog.ns;
+```
+
+## Features
+
+Since v1.11.0, KSHC uses the data source Parquet/ORC reader to process Parquet and ORC tables
+created by HiveQL syntax by default, instead of the Hive SerDe. This enables vectorized reading.
+Set `spark.sql.kyuubi.hive.connector.read.convertMetastoreParquet` and
+`spark.sql.kyuubi.hive.connector.read.convertMetastoreOrc` to `false` to fall back to the Hive
+SerDe.
+
+Since v1.12.0, KSHC supports the `PURGE TABLE` command. By default, `DROP TABLE` moves the table
+data to the HDFS trash. Set `spark.sql.kyuubi.hive.connector.dropTableAsPurgeTable` to `true` to
+make `DROP TABLE` skip the HDFS trash and completely remove its data, behaving like `PURGE TABLE`.
+
+Since v1.13.0, KSHC supports Dynamic Partition Pruning (DPP) for partitioned Hive tables, which
+significantly reduces the amount of data scanned when joining against large partitioned tables.
+DPP is implemented by wrapping Spark's built-in `ParquetScan` / `OrcScan`. As a result, native
+engines such as Gluten and Comet cannot recognize these scans by class name, so KSHC-converted

Review Comment:
   Dropped the statement entirely.



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


Re: [PR] [KYUUBI #7664][DOC] Reformat and improve docs for KSHC [kyuubi]

Posted by "maomaodev (via GitHub)" <gi...@apache.org>.
maomaodev commented on code in PR #7667:
URL: https://github.com/apache/kyuubi/pull/7667#discussion_r3877832818


##########
docs/connector/spark/hive.md:
##########
@@ -0,0 +1,166 @@
+<!--
+- 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
+
+You may know that the Apache Spark has built-in support for accessing Hive tables, it works well in most cases,
+but is limited to one Hive Metastore. The Kyuubi Spark Hive connector(KSHC) implemented a Hive connector based
+on Spark DataSource V2 API, supports accessing multiple Hive Metastore in a single Spark application.
+
+## Hive Integration
+
+To enable the integration of Kyuubi Spark SQL engine and Hive connector through
+Spark DataSource V2 API, you need to:
+
+- Referencing the Hive connector [dependencies](#kshc-dependencies)
+- Setting the Spark catalog [configurations](#kshc-configurations)
+
+(kshc-dependencies)=
+
+### Dependencies
+
+The **classpath** of Kyuubi Spark SQL engine with Hive connector supported consists of
+
+1. kyuubi-spark-sql-engine-{{ release }}_2.12.jar, the engine jar deployed with a Kyuubi distribution
+2. a copy of Spark distribution
+3. kyuubi-spark-connector-hive_2.12-{{ release }}, which can be found in the [Maven Central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-spark-connector-hive)
+
+In order to make the Hive connector packages visible for the runtime classpath of engines, we can use one of these methods:
+
+1. Put the Kyuubi Hive connector packages into `$SPARK_HOME/jars` directly
+2. Set `spark.jars=/path/to/kyuubi-hive-connector`
+
+```{note}
+Starting from v1.9.2 and v1.10.0, KSHC jars available in the [Maven Central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-spark-connector-hive) guarantee binary compatibility across
+multiple Spark versions, so a single jar works across them without rebuilding.
+```
+
+(kshc-configurations)=
+
+### Configurations
+
+To activate functionality of Kyuubi Spark Hive connector, we can set the following configurations:
+
+```properties
+spark.sql.catalog.hive_catalog                      org.apache.kyuubi.spark.connector.hive.HiveTableCatalog
+spark.sql.catalog.hive_catalog.hive.metastore.uris  thrift://metastore-host:port
+spark.sql.catalog.hive_catalog.<other.hive.conf>    <value>
+spark.sql.catalog.hive_catalog.<other.hadoop.conf>  <value>
+```
+
+Besides the catalog-level configurations above, the Kyuubi Spark Hive connector provides the following configurations:
+
+|                              Key                               |      Default      |                                                                                                          Meaning                                                                                                           |  Type   | Since  |
+|----------------------------------------------------------------|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|--------|
+| `spark.sql.kyuubi.hive.connector.externalCatalog.share.policy` | `ONE_FOR_ALL`     | The share policy for the external catalog. `ONE_FOR_ONE` means an external catalog is used by only one `HiveTableCatalog`, while `ONE_FOR_ALL` shares an external catalog globally across the catalogs with the same name. | string  | 1.7.0  |
+| `spark.sql.catalog.<catalog>.delegation.token.renewal.enabled` | `true`            | Whether to enable delegation token renewal for the Kerberized Hive Metastore of this catalog.                                                                                                                              | boolean | 1.8.0  |
+| `spark.sql.kyuubi.hive.connector.read.convertMetastoreParquet` | `true`            | When enabled, the data source Parquet reader is used to process Parquet tables created by HiveQL syntax, instead of the Hive SerDe.                                                                                        | boolean | 1.11.0 |
+| `spark.sql.kyuubi.hive.connector.read.convertMetastoreOrc`     | `true`            | When enabled, the data source ORC reader is used to process ORC tables created by HiveQL syntax, instead of the Hive SerDe.                                                                                                | boolean | 1.11.0 |
+| `spark.sql.kyuubi.hive.connector.dropTableAsPurgeTable`        | `false`           | When enabled, `DROP TABLE` completely removes its data by skipping HDFS trash, equivalent to the `PURGE TABLE` command.                                                                                                    | boolean | 1.12.0 |
+| `spark.sql.catalog.<catalog>.hive.metastore.warehouse.dir`     | &lt;undefined&gt; | The default warehouse directory for the catalog, taking precedence over the global `spark.sql.warehouse.dir` when creating a database.                                                                                     | string  | 1.12.0 |
+
+```{note}
+Catalog-level configurations (`spark.sql.catalog.<catalog>.*`) are captured when the catalog is
+initialized, so they must be present at the Spark application bootstrap (in `spark-defaults.conf`
+or via `--conf`). Setting them through `SET` after the catalog has been created does not take
+effect, e.g. `SET spark.sql.catalog.<catalog>.<key>=<value>`.
+```
+
+## Hive Connector Operations
+
+Taking `CREATE NAMESPACE` as an example,
+
+```sql
+CREATE NAMESPACE ns;
+```
+
+Taking `CREATE TABLE` as an example,
+
+```sql
+CREATE TABLE hive_catalog.ns.foo (
+  id bigint COMMENT 'unique id',
+  data string)
+USING parquet;
+```
+
+Taking `SELECT` as an example,
+
+```sql
+SELECT * FROM hive_catalog.ns.foo;
+```
+
+Taking `INSERT` as an example,
+
+```sql
+INSERT INTO hive_catalog.ns.foo VALUES (1, 'a'), (2, 'b'), (3, 'c');
+```
+
+Taking `DROP TABLE` as an example,
+
+```sql
+DROP TABLE hive_catalog.ns.foo;
+```
+
+Taking `DROP NAMESPACE` as an example,
+
+```sql
+DROP NAMESPACE hive_catalog.ns;
+```
+
+## Features
+
+Since v1.11.0, KSHC uses the data source Parquet/ORC reader to process Parquet and ORC tables
+created by HiveQL syntax by default, instead of the Hive SerDe. This enables vectorized reading.
+Set `spark.sql.kyuubi.hive.connector.read.convertMetastoreParquet` and
+`spark.sql.kyuubi.hive.connector.read.convertMetastoreOrc` to `false` to fall back to the Hive
+SerDe.
+
+Since v1.12.0, KSHC supports the `PURGE TABLE` command. By default, `DROP TABLE` moves the table
+data to the HDFS trash. Set `spark.sql.kyuubi.hive.connector.dropTableAsPurgeTable` to `true` to
+make `DROP TABLE` skip the HDFS trash and completely remove its data, behaving like `PURGE TABLE`.
+
+Since v1.13.0, KSHC supports Dynamic Partition Pruning (DPP) for partitioned Hive tables, which
+significantly reduces the amount of data scanned when joining against large partitioned tables.
+DPP is implemented by wrapping Spark's built-in `ParquetScan` / `OrcScan`. As a result, native
+engines such as Gluten and Comet cannot recognize these scans by class name, so KSHC-converted
+Parquet/ORC tables silently fall back to the JVM read path and can no longer be offloaded.
+
+## Advanced Usages
+
+Though KSHC is a pure Spark DataSource V2 connector which isn't coupled with Kyuubi deployment, due to the
+implementation inside `spark-sql`, you should not expect KSHC works properly with `spark-sql`, and
+any issues caused by such a combination usage won't be considered at this time. Instead, it's recommended
+using BeeLine with Kyuubi as a drop-in replacement for `spark-sql`, or switching to `spark-shell`.
+
+KSHC supports accessing Kerberized Hive Metastore and HDFS, by using keytab, or TGT cache, or Delegation Token.
+It's not expected to work properly with multiple KDC instances, the limitation comes from JDK Krb5LoginModule,
+for such cases, consider setting up Cross-Realm Kerberos trusts, then you just need to talk with one KDC.
+
+For HMS Thrift API used by Spark, it's known that Hive 2.3.9 client is compatible with HMS from 2.1 to 4.0, and
+Hive 2.3.10 client is compatible with HMS from 1.1 to 4.0, such version combinations should cover the most cases.
+For other corner cases, KSHC also supports `spark.sql.catalog.<catalog_name>.spark.sql.hive.metastore.jars` and
+`spark.sql.catalog.<catalog_name>.spark.sql.hive.metastore.version` as well as the Spark built-in Hive datasource
+does, you can refer to the Spark documentation for details.
+
+## Limitations
+
+Currently, KSHC has the following limitations:
+
+- KSHC does not support Hive functions / UDFs.

Review Comment:
   Rephrased to clarify that only persistent views/UDFs (`CREATE VIEW / CREATE FUNCTION / SHOW VIEWS / SHOW FUNCTIONS`) fail through a KSHC catalog, while temporary views and temporary functions are unaffected. Also added `spark_catalog` as the workaround.



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


Re: [PR] [KYUUBI #7664][DOC] Reformat and improve docs for KSHC [kyuubi]

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #7667:
URL: https://github.com/apache/kyuubi/pull/7667#discussion_r3873726762


##########
docs/connector/spark/hive.md:
##########
@@ -0,0 +1,166 @@
+<!--
+- 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
+
+You may know that the Apache Spark has built-in support for accessing Hive tables, it works well in most cases,
+but is limited to one Hive Metastore. The Kyuubi Spark Hive connector(KSHC) implemented a Hive connector based
+on Spark DataSource V2 API, supports accessing multiple Hive Metastore in a single Spark application.
+
+## Hive Integration
+
+To enable the integration of Kyuubi Spark SQL engine and Hive connector through
+Spark DataSource V2 API, you need to:
+
+- Referencing the Hive connector [dependencies](#kshc-dependencies)
+- Setting the Spark catalog [configurations](#kshc-configurations)
+
+(kshc-dependencies)=
+
+### Dependencies
+
+The **classpath** of Kyuubi Spark SQL engine with Hive connector supported consists of
+
+1. kyuubi-spark-sql-engine-{{ release }}_2.12.jar, the engine jar deployed with a Kyuubi distribution
+2. a copy of Spark distribution
+3. kyuubi-spark-connector-hive_2.12-{{ release }}, which can be found in the [Maven Central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-spark-connector-hive)
+
+In order to make the Hive connector packages visible for the runtime classpath of engines, we can use one of these methods:
+
+1. Put the Kyuubi Hive connector packages into `$SPARK_HOME/jars` directly
+2. Set `spark.jars=/path/to/kyuubi-hive-connector`
+
+```{note}
+Starting from v1.9.2 and v1.10.0, KSHC jars available in the [Maven Central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-spark-connector-hive) guarantee binary compatibility across
+multiple Spark versions, so a single jar works across them without rebuilding.
+```
+
+(kshc-configurations)=
+
+### Configurations
+
+To activate functionality of Kyuubi Spark Hive connector, we can set the following configurations:
+
+```properties
+spark.sql.catalog.hive_catalog                      org.apache.kyuubi.spark.connector.hive.HiveTableCatalog
+spark.sql.catalog.hive_catalog.hive.metastore.uris  thrift://metastore-host:port
+spark.sql.catalog.hive_catalog.<other.hive.conf>    <value>
+spark.sql.catalog.hive_catalog.<other.hadoop.conf>  <value>
+```
+
+Besides the catalog-level configurations above, the Kyuubi Spark Hive connector provides the following configurations:
+
+|                              Key                               |      Default      |                                                                                                          Meaning                                                                                                           |  Type   | Since  |
+|----------------------------------------------------------------|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|--------|
+| `spark.sql.kyuubi.hive.connector.externalCatalog.share.policy` | `ONE_FOR_ALL`     | The share policy for the external catalog. `ONE_FOR_ONE` means an external catalog is used by only one `HiveTableCatalog`, while `ONE_FOR_ALL` shares an external catalog globally across the catalogs with the same name. | string  | 1.7.0  |
+| `spark.sql.catalog.<catalog>.delegation.token.renewal.enabled` | `true`            | Whether to enable delegation token renewal for the Kerberized Hive Metastore of this catalog.                                                                                                                              | boolean | 1.8.0  |
+| `spark.sql.kyuubi.hive.connector.read.convertMetastoreParquet` | `true`            | When enabled, the data source Parquet reader is used to process Parquet tables created by HiveQL syntax, instead of the Hive SerDe.                                                                                        | boolean | 1.11.0 |
+| `spark.sql.kyuubi.hive.connector.read.convertMetastoreOrc`     | `true`            | When enabled, the data source ORC reader is used to process ORC tables created by HiveQL syntax, instead of the Hive SerDe.                                                                                                | boolean | 1.11.0 |
+| `spark.sql.kyuubi.hive.connector.dropTableAsPurgeTable`        | `false`           | When enabled, `DROP TABLE` completely removes its data by skipping HDFS trash, equivalent to the `PURGE TABLE` command.                                                                                                    | boolean | 1.12.0 |
+| `spark.sql.catalog.<catalog>.hive.metastore.warehouse.dir`     | &lt;undefined&gt; | The default warehouse directory for the catalog, taking precedence over the global `spark.sql.warehouse.dir` when creating a database.                                                                                     | string  | 1.12.0 |
+
+```{note}
+Catalog-level configurations (`spark.sql.catalog.<catalog>.*`) are captured when the catalog is
+initialized, so they must be present at the Spark application bootstrap (in `spark-defaults.conf`
+or via `--conf`). Setting them through `SET` after the catalog has been created does not take
+effect, e.g. `SET spark.sql.catalog.<catalog>.<key>=<value>`.
+```
+
+## Hive Connector Operations
+
+Taking `CREATE NAMESPACE` as an example,
+
+```sql
+CREATE NAMESPACE ns;
+```
+
+Taking `CREATE TABLE` as an example,
+
+```sql
+CREATE TABLE hive_catalog.ns.foo (
+  id bigint COMMENT 'unique id',
+  data string)
+USING parquet;
+```
+
+Taking `SELECT` as an example,
+
+```sql
+SELECT * FROM hive_catalog.ns.foo;
+```
+
+Taking `INSERT` as an example,
+
+```sql
+INSERT INTO hive_catalog.ns.foo VALUES (1, 'a'), (2, 'b'), (3, 'c');
+```
+
+Taking `DROP TABLE` as an example,
+
+```sql
+DROP TABLE hive_catalog.ns.foo;
+```
+
+Taking `DROP NAMESPACE` as an example,
+
+```sql
+DROP NAMESPACE hive_catalog.ns;
+```
+
+## Features
+
+Since v1.11.0, KSHC uses the data source Parquet/ORC reader to process Parquet and ORC tables
+created by HiveQL syntax by default, instead of the Hive SerDe. This enables vectorized reading.
+Set `spark.sql.kyuubi.hive.connector.read.convertMetastoreParquet` and
+`spark.sql.kyuubi.hive.connector.read.convertMetastoreOrc` to `false` to fall back to the Hive
+SerDe.
+
+Since v1.12.0, KSHC supports the `PURGE TABLE` command. By default, `DROP TABLE` moves the table
+data to the HDFS trash. Set `spark.sql.kyuubi.hive.connector.dropTableAsPurgeTable` to `true` to
+make `DROP TABLE` skip the HDFS trash and completely remove its data, behaving like `PURGE TABLE`.
+
+Since v1.13.0, KSHC supports Dynamic Partition Pruning (DPP) for partitioned Hive tables, which
+significantly reduces the amount of data scanned when joining against large partitioned tables.
+DPP is implemented by wrapping Spark's built-in `ParquetScan` / `OrcScan`. As a result, native
+engines such as Gluten and Comet cannot recognize these scans by class name, so KSHC-converted
+Parquet/ORC tables silently fall back to the JVM read path and can no longer be offloaded.
+
+## Advanced Usages
+
+Though KSHC is a pure Spark DataSource V2 connector which isn't coupled with Kyuubi deployment, due to the
+implementation inside `spark-sql`, you should not expect KSHC works properly with `spark-sql`, and
+any issues caused by such a combination usage won't be considered at this time. Instead, it's recommended
+using BeeLine with Kyuubi as a drop-in replacement for `spark-sql`, or switching to `spark-shell`.
+
+KSHC supports accessing Kerberized Hive Metastore and HDFS, by using keytab, or TGT cache, or Delegation Token.
+It's not expected to work properly with multiple KDC instances, the limitation comes from JDK Krb5LoginModule,
+for such cases, consider setting up Cross-Realm Kerberos trusts, then you just need to talk with one KDC.
+
+For HMS Thrift API used by Spark, it's known that Hive 2.3.9 client is compatible with HMS from 2.1 to 4.0, and
+Hive 2.3.10 client is compatible with HMS from 1.1 to 4.0, such version combinations should cover the most cases.

Review Comment:
   the claim is no longer valid; HIVE-26537 (4.1.0, 4.0.1) actually broke the Thrift wire protocol (the `get_table` method) by removing the Thrift API used by Spark.



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


Re: [PR] [KYUUBI #7664][DOC] Reformat and improve docs for KSHC [kyuubi]

Posted by "maomaodev (via GitHub)" <gi...@apache.org>.
maomaodev commented on code in PR #7667:
URL: https://github.com/apache/kyuubi/pull/7667#discussion_r3877871083


##########
docs/connector/spark/hive.md:
##########
@@ -0,0 +1,166 @@
+<!--
+- 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
+
+You may know that the Apache Spark has built-in support for accessing Hive tables, it works well in most cases,
+but is limited to one Hive Metastore. The Kyuubi Spark Hive connector(KSHC) implemented a Hive connector based
+on Spark DataSource V2 API, supports accessing multiple Hive Metastore in a single Spark application.
+
+## Hive Integration
+
+To enable the integration of Kyuubi Spark SQL engine and Hive connector through
+Spark DataSource V2 API, you need to:
+
+- Referencing the Hive connector [dependencies](#kshc-dependencies)
+- Setting the Spark catalog [configurations](#kshc-configurations)
+
+(kshc-dependencies)=
+
+### Dependencies
+
+The **classpath** of Kyuubi Spark SQL engine with Hive connector supported consists of
+
+1. kyuubi-spark-sql-engine-{{ release }}_2.12.jar, the engine jar deployed with a Kyuubi distribution
+2. a copy of Spark distribution
+3. kyuubi-spark-connector-hive_2.12-{{ release }}, which can be found in the [Maven Central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-spark-connector-hive)
+
+In order to make the Hive connector packages visible for the runtime classpath of engines, we can use one of these methods:
+
+1. Put the Kyuubi Hive connector packages into `$SPARK_HOME/jars` directly
+2. Set `spark.jars=/path/to/kyuubi-hive-connector`
+
+```{note}
+Starting from v1.9.2 and v1.10.0, KSHC jars available in the [Maven Central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-spark-connector-hive) guarantee binary compatibility across
+multiple Spark versions, so a single jar works across them without rebuilding.
+```
+
+(kshc-configurations)=
+
+### Configurations
+
+To activate functionality of Kyuubi Spark Hive connector, we can set the following configurations:
+
+```properties
+spark.sql.catalog.hive_catalog                      org.apache.kyuubi.spark.connector.hive.HiveTableCatalog
+spark.sql.catalog.hive_catalog.hive.metastore.uris  thrift://metastore-host:port
+spark.sql.catalog.hive_catalog.<other.hive.conf>    <value>
+spark.sql.catalog.hive_catalog.<other.hadoop.conf>  <value>
+```
+
+Besides the catalog-level configurations above, the Kyuubi Spark Hive connector provides the following configurations:
+
+|                              Key                               |      Default      |                                                                                                          Meaning                                                                                                           |  Type   | Since  |
+|----------------------------------------------------------------|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|--------|
+| `spark.sql.kyuubi.hive.connector.externalCatalog.share.policy` | `ONE_FOR_ALL`     | The share policy for the external catalog. `ONE_FOR_ONE` means an external catalog is used by only one `HiveTableCatalog`, while `ONE_FOR_ALL` shares an external catalog globally across the catalogs with the same name. | string  | 1.7.0  |
+| `spark.sql.catalog.<catalog>.delegation.token.renewal.enabled` | `true`            | Whether to enable delegation token renewal for the Kerberized Hive Metastore of this catalog.                                                                                                                              | boolean | 1.8.0  |
+| `spark.sql.kyuubi.hive.connector.read.convertMetastoreParquet` | `true`            | When enabled, the data source Parquet reader is used to process Parquet tables created by HiveQL syntax, instead of the Hive SerDe.                                                                                        | boolean | 1.11.0 |
+| `spark.sql.kyuubi.hive.connector.read.convertMetastoreOrc`     | `true`            | When enabled, the data source ORC reader is used to process ORC tables created by HiveQL syntax, instead of the Hive SerDe.                                                                                                | boolean | 1.11.0 |
+| `spark.sql.kyuubi.hive.connector.dropTableAsPurgeTable`        | `false`           | When enabled, `DROP TABLE` completely removes its data by skipping HDFS trash, equivalent to the `PURGE TABLE` command.                                                                                                    | boolean | 1.12.0 |
+| `spark.sql.catalog.<catalog>.hive.metastore.warehouse.dir`     | &lt;undefined&gt; | The default warehouse directory for the catalog, taking precedence over the global `spark.sql.warehouse.dir` when creating a database.                                                                                     | string  | 1.12.0 |
+
+```{note}
+Catalog-level configurations (`spark.sql.catalog.<catalog>.*`) are captured when the catalog is
+initialized, so they must be present at the Spark application bootstrap (in `spark-defaults.conf`
+or via `--conf`). Setting them through `SET` after the catalog has been created does not take

Review Comment:
   Good catch, the V2 catalog is lazily initialized and session-isolated, so configs apply as long as they're set before first access. Only the Kerberized cluster mode (no keytab) genuinely needs `metastore.uris` declared at bootstrap.



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


Re: [PR] [KYUUBI #7664][DOC] Reformat and improve docs for KSHC [kyuubi]

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #7667:
URL: https://github.com/apache/kyuubi/pull/7667#discussion_r3873784363


##########
docs/connector/spark/hive.md:
##########
@@ -0,0 +1,166 @@
+<!--
+- 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
+
+You may know that the Apache Spark has built-in support for accessing Hive tables, it works well in most cases,
+but is limited to one Hive Metastore. The Kyuubi Spark Hive connector(KSHC) implemented a Hive connector based
+on Spark DataSource V2 API, supports accessing multiple Hive Metastore in a single Spark application.
+
+## Hive Integration
+
+To enable the integration of Kyuubi Spark SQL engine and Hive connector through
+Spark DataSource V2 API, you need to:
+
+- Referencing the Hive connector [dependencies](#kshc-dependencies)
+- Setting the Spark catalog [configurations](#kshc-configurations)
+
+(kshc-dependencies)=
+
+### Dependencies
+
+The **classpath** of Kyuubi Spark SQL engine with Hive connector supported consists of
+
+1. kyuubi-spark-sql-engine-{{ release }}_2.12.jar, the engine jar deployed with a Kyuubi distribution
+2. a copy of Spark distribution
+3. kyuubi-spark-connector-hive_2.12-{{ release }}, which can be found in the [Maven Central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-spark-connector-hive)
+
+In order to make the Hive connector packages visible for the runtime classpath of engines, we can use one of these methods:
+
+1. Put the Kyuubi Hive connector packages into `$SPARK_HOME/jars` directly
+2. Set `spark.jars=/path/to/kyuubi-hive-connector`
+
+```{note}
+Starting from v1.9.2 and v1.10.0, KSHC jars available in the [Maven Central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-spark-connector-hive) guarantee binary compatibility across
+multiple Spark versions, so a single jar works across them without rebuilding.
+```
+
+(kshc-configurations)=
+
+### Configurations
+
+To activate functionality of Kyuubi Spark Hive connector, we can set the following configurations:
+
+```properties
+spark.sql.catalog.hive_catalog                      org.apache.kyuubi.spark.connector.hive.HiveTableCatalog
+spark.sql.catalog.hive_catalog.hive.metastore.uris  thrift://metastore-host:port
+spark.sql.catalog.hive_catalog.<other.hive.conf>    <value>
+spark.sql.catalog.hive_catalog.<other.hadoop.conf>  <value>
+```
+
+Besides the catalog-level configurations above, the Kyuubi Spark Hive connector provides the following configurations:
+
+|                              Key                               |      Default      |                                                                                                          Meaning                                                                                                           |  Type   | Since  |
+|----------------------------------------------------------------|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|--------|
+| `spark.sql.kyuubi.hive.connector.externalCatalog.share.policy` | `ONE_FOR_ALL`     | The share policy for the external catalog. `ONE_FOR_ONE` means an external catalog is used by only one `HiveTableCatalog`, while `ONE_FOR_ALL` shares an external catalog globally across the catalogs with the same name. | string  | 1.7.0  |
+| `spark.sql.catalog.<catalog>.delegation.token.renewal.enabled` | `true`            | Whether to enable delegation token renewal for the Kerberized Hive Metastore of this catalog.                                                                                                                              | boolean | 1.8.0  |
+| `spark.sql.kyuubi.hive.connector.read.convertMetastoreParquet` | `true`            | When enabled, the data source Parquet reader is used to process Parquet tables created by HiveQL syntax, instead of the Hive SerDe.                                                                                        | boolean | 1.11.0 |
+| `spark.sql.kyuubi.hive.connector.read.convertMetastoreOrc`     | `true`            | When enabled, the data source ORC reader is used to process ORC tables created by HiveQL syntax, instead of the Hive SerDe.                                                                                                | boolean | 1.11.0 |
+| `spark.sql.kyuubi.hive.connector.dropTableAsPurgeTable`        | `false`           | When enabled, `DROP TABLE` completely removes its data by skipping HDFS trash, equivalent to the `PURGE TABLE` command.                                                                                                    | boolean | 1.12.0 |
+| `spark.sql.catalog.<catalog>.hive.metastore.warehouse.dir`     | &lt;undefined&gt; | The default warehouse directory for the catalog, taking precedence over the global `spark.sql.warehouse.dir` when creating a database.                                                                                     | string  | 1.12.0 |
+
+```{note}
+Catalog-level configurations (`spark.sql.catalog.<catalog>.*`) are captured when the catalog is
+initialized, so they must be present at the Spark application bootstrap (in `spark-defaults.conf`
+or via `--conf`). Setting them through `SET` after the catalog has been created does not take
+effect, e.g. `SET spark.sql.catalog.<catalog>.<key>=<value>`.
+```
+
+## Hive Connector Operations
+
+Taking `CREATE NAMESPACE` as an example,
+
+```sql
+CREATE NAMESPACE ns;
+```
+
+Taking `CREATE TABLE` as an example,
+
+```sql
+CREATE TABLE hive_catalog.ns.foo (
+  id bigint COMMENT 'unique id',
+  data string)
+USING parquet;
+```
+
+Taking `SELECT` as an example,
+
+```sql
+SELECT * FROM hive_catalog.ns.foo;
+```
+
+Taking `INSERT` as an example,
+
+```sql
+INSERT INTO hive_catalog.ns.foo VALUES (1, 'a'), (2, 'b'), (3, 'c');
+```
+
+Taking `DROP TABLE` as an example,
+
+```sql
+DROP TABLE hive_catalog.ns.foo;
+```
+
+Taking `DROP NAMESPACE` as an example,
+
+```sql
+DROP NAMESPACE hive_catalog.ns;
+```
+
+## Features
+
+Since v1.11.0, KSHC uses the data source Parquet/ORC reader to process Parquet and ORC tables
+created by HiveQL syntax by default, instead of the Hive SerDe. This enables vectorized reading.
+Set `spark.sql.kyuubi.hive.connector.read.convertMetastoreParquet` and
+`spark.sql.kyuubi.hive.connector.read.convertMetastoreOrc` to `false` to fall back to the Hive
+SerDe.
+
+Since v1.12.0, KSHC supports the `PURGE TABLE` command. By default, `DROP TABLE` moves the table
+data to the HDFS trash. Set `spark.sql.kyuubi.hive.connector.dropTableAsPurgeTable` to `true` to
+make `DROP TABLE` skip the HDFS trash and completely remove its data, behaving like `PURGE TABLE`.
+
+Since v1.13.0, KSHC supports Dynamic Partition Pruning (DPP) for partitioned Hive tables, which
+significantly reduces the amount of data scanned when joining against large partitioned tables.
+DPP is implemented by wrapping Spark's built-in `ParquetScan` / `OrcScan`. As a result, native
+engines such as Gluten and Comet cannot recognize these scans by class name, so KSHC-converted
+Parquet/ORC tables silently fall back to the JVM read path and can no longer be offloaded.
+
+## Advanced Usages
+
+Though KSHC is a pure Spark DataSource V2 connector which isn't coupled with Kyuubi deployment, due to the
+implementation inside `spark-sql`, you should not expect KSHC works properly with `spark-sql`, and
+any issues caused by such a combination usage won't be considered at this time. Instead, it's recommended
+using BeeLine with Kyuubi as a drop-in replacement for `spark-sql`, or switching to `spark-shell`.
+
+KSHC supports accessing Kerberized Hive Metastore and HDFS, by using keytab, or TGT cache, or Delegation Token.
+It's not expected to work properly with multiple KDC instances, the limitation comes from JDK Krb5LoginModule,
+for such cases, consider setting up Cross-Realm Kerberos trusts, then you just need to talk with one KDC.
+
+For HMS Thrift API used by Spark, it's known that Hive 2.3.9 client is compatible with HMS from 2.1 to 4.0, and
+Hive 2.3.10 client is compatible with HMS from 1.1 to 4.0, such version combinations should cover the most cases.
+For other corner cases, KSHC also supports `spark.sql.catalog.<catalog_name>.spark.sql.hive.metastore.jars` and
+`spark.sql.catalog.<catalog_name>.spark.sql.hive.metastore.version` as well as the Spark built-in Hive datasource
+does, you can refer to the Spark documentation for details.
+
+## Limitations
+
+Currently, KSHC has the following limitations:
+
+- KSHC does not support Hive functions / UDFs.

Review Comment:
   this might be confusing and scare users, since it can be interpreted as:
   
   "all my existing Hive UDFs, including those `ADD JAR ...` and `CREATE TEMPORARY FUNCTION ...`, will stop working if I want to use KSHC"



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


Re: [PR] [KYUUBI #7664][DOC] Reformat and improve docs for KSHC [kyuubi]

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on PR #7667:
URL: https://github.com/apache/kyuubi/pull/7667#issuecomment-5521720180

   **Merge Summary:**
   - merged into master https://github.com/apache/kyuubi/commit/8cafd873c11323310d306481368290780a37d5b7
   
   *Posted by `merge_kyuubi_pr.py`*


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


Re: [PR] [KYUUBI #7664][DOC] Reformat and improve docs for KSHC [kyuubi]

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #7667:
URL: https://github.com/apache/kyuubi/pull/7667#discussion_r3873736241


##########
docs/connector/spark/hive.md:
##########
@@ -0,0 +1,166 @@
+<!--
+- 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
+
+You may know that the Apache Spark has built-in support for accessing Hive tables, it works well in most cases,
+but is limited to one Hive Metastore. The Kyuubi Spark Hive connector(KSHC) implemented a Hive connector based
+on Spark DataSource V2 API, supports accessing multiple Hive Metastore in a single Spark application.
+
+## Hive Integration
+
+To enable the integration of Kyuubi Spark SQL engine and Hive connector through
+Spark DataSource V2 API, you need to:
+
+- Referencing the Hive connector [dependencies](#kshc-dependencies)
+- Setting the Spark catalog [configurations](#kshc-configurations)
+
+(kshc-dependencies)=
+
+### Dependencies
+
+The **classpath** of Kyuubi Spark SQL engine with Hive connector supported consists of
+
+1. kyuubi-spark-sql-engine-{{ release }}_2.12.jar, the engine jar deployed with a Kyuubi distribution
+2. a copy of Spark distribution
+3. kyuubi-spark-connector-hive_2.12-{{ release }}, which can be found in the [Maven Central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-spark-connector-hive)
+
+In order to make the Hive connector packages visible for the runtime classpath of engines, we can use one of these methods:
+
+1. Put the Kyuubi Hive connector packages into `$SPARK_HOME/jars` directly
+2. Set `spark.jars=/path/to/kyuubi-hive-connector`
+
+```{note}
+Starting from v1.9.2 and v1.10.0, KSHC jars available in the [Maven Central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-spark-connector-hive) guarantee binary compatibility across
+multiple Spark versions, so a single jar works across them without rebuilding.
+```
+
+(kshc-configurations)=
+
+### Configurations
+
+To activate functionality of Kyuubi Spark Hive connector, we can set the following configurations:
+
+```properties
+spark.sql.catalog.hive_catalog                      org.apache.kyuubi.spark.connector.hive.HiveTableCatalog
+spark.sql.catalog.hive_catalog.hive.metastore.uris  thrift://metastore-host:port
+spark.sql.catalog.hive_catalog.<other.hive.conf>    <value>
+spark.sql.catalog.hive_catalog.<other.hadoop.conf>  <value>
+```
+
+Besides the catalog-level configurations above, the Kyuubi Spark Hive connector provides the following configurations:
+
+|                              Key                               |      Default      |                                                                                                          Meaning                                                                                                           |  Type   | Since  |
+|----------------------------------------------------------------|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|--------|
+| `spark.sql.kyuubi.hive.connector.externalCatalog.share.policy` | `ONE_FOR_ALL`     | The share policy for the external catalog. `ONE_FOR_ONE` means an external catalog is used by only one `HiveTableCatalog`, while `ONE_FOR_ALL` shares an external catalog globally across the catalogs with the same name. | string  | 1.7.0  |
+| `spark.sql.catalog.<catalog>.delegation.token.renewal.enabled` | `true`            | Whether to enable delegation token renewal for the Kerberized Hive Metastore of this catalog.                                                                                                                              | boolean | 1.8.0  |
+| `spark.sql.kyuubi.hive.connector.read.convertMetastoreParquet` | `true`            | When enabled, the data source Parquet reader is used to process Parquet tables created by HiveQL syntax, instead of the Hive SerDe.                                                                                        | boolean | 1.11.0 |
+| `spark.sql.kyuubi.hive.connector.read.convertMetastoreOrc`     | `true`            | When enabled, the data source ORC reader is used to process ORC tables created by HiveQL syntax, instead of the Hive SerDe.                                                                                                | boolean | 1.11.0 |
+| `spark.sql.kyuubi.hive.connector.dropTableAsPurgeTable`        | `false`           | When enabled, `DROP TABLE` completely removes its data by skipping HDFS trash, equivalent to the `PURGE TABLE` command.                                                                                                    | boolean | 1.12.0 |
+| `spark.sql.catalog.<catalog>.hive.metastore.warehouse.dir`     | &lt;undefined&gt; | The default warehouse directory for the catalog, taking precedence over the global `spark.sql.warehouse.dir` when creating a database.                                                                                     | string  | 1.12.0 |
+
+```{note}
+Catalog-level configurations (`spark.sql.catalog.<catalog>.*`) are captured when the catalog is
+initialized, so they must be present at the Spark application bootstrap (in `spark-defaults.conf`
+or via `--conf`). Setting them through `SET` after the catalog has been created does not take
+effect, e.g. `SET spark.sql.catalog.<catalog>.<key>=<value>`.
+```
+
+## Hive Connector Operations
+
+Taking `CREATE NAMESPACE` as an example,
+
+```sql
+CREATE NAMESPACE ns;
+```
+
+Taking `CREATE TABLE` as an example,
+
+```sql
+CREATE TABLE hive_catalog.ns.foo (
+  id bigint COMMENT 'unique id',
+  data string)
+USING parquet;
+```
+
+Taking `SELECT` as an example,
+
+```sql
+SELECT * FROM hive_catalog.ns.foo;
+```
+
+Taking `INSERT` as an example,
+
+```sql
+INSERT INTO hive_catalog.ns.foo VALUES (1, 'a'), (2, 'b'), (3, 'c');
+```
+
+Taking `DROP TABLE` as an example,
+
+```sql
+DROP TABLE hive_catalog.ns.foo;
+```
+
+Taking `DROP NAMESPACE` as an example,
+
+```sql
+DROP NAMESPACE hive_catalog.ns;
+```
+
+## Features
+
+Since v1.11.0, KSHC uses the data source Parquet/ORC reader to process Parquet and ORC tables
+created by HiveQL syntax by default, instead of the Hive SerDe. This enables vectorized reading.
+Set `spark.sql.kyuubi.hive.connector.read.convertMetastoreParquet` and
+`spark.sql.kyuubi.hive.connector.read.convertMetastoreOrc` to `false` to fall back to the Hive
+SerDe.
+
+Since v1.12.0, KSHC supports the `PURGE TABLE` command. By default, `DROP TABLE` moves the table
+data to the HDFS trash. Set `spark.sql.kyuubi.hive.connector.dropTableAsPurgeTable` to `true` to
+make `DROP TABLE` skip the HDFS trash and completely remove its data, behaving like `PURGE TABLE`.
+
+Since v1.13.0, KSHC supports Dynamic Partition Pruning (DPP) for partitioned Hive tables, which
+significantly reduces the amount of data scanned when joining against large partitioned tables.
+DPP is implemented by wrapping Spark's built-in `ParquetScan` / `OrcScan`. As a result, native
+engines such as Gluten and Comet cannot recognize these scans by class name, so KSHC-converted

Review Comment:
   we can promise nothing for those ecosystem projects because they use the spark private api, I would drop this statement



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


Re: [PR] [KYUUBI #7664][DOC] Reformat and improve docs for KSHC [kyuubi]

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #7667:
URL: https://github.com/apache/kyuubi/pull/7667#discussion_r3893199877


##########
docs/connector/spark/hive.md:
##########
@@ -0,0 +1,172 @@
+<!--
+- 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
+
+You may know that the Apache Spark has built-in support for accessing Hive tables, it works well in most cases,
+but is limited to one Hive Metastore. The Kyuubi Spark Hive connector (KSHC) implements a Hive connector based
+on Spark DataSource V2 API, supports accessing multiple Hive Metastore in a single Spark application.
+
+## Hive Integration
+
+To enable the integration of Kyuubi Spark SQL engine and Hive connector through
+Spark DataSource V2 API, you need to:
+
+- Referencing the Hive connector [dependencies](#kshc-dependencies)
+- Setting the Spark catalog [configurations](#kshc-configurations)
+
+(kshc-dependencies)=
+
+### Dependencies
+
+The **classpath** of Kyuubi Spark SQL engine with Hive connector supported consists of
+
+1. kyuubi-spark-sql-engine-{{ release }}_2.12.jar, the engine jar deployed with a Kyuubi distribution
+2. a copy of Spark distribution
+3. kyuubi-spark-connector-hive_2.12-{{ release }}, which can be found in the [Maven Central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-spark-connector-hive)

Review Comment:
   ```suggestion
   1. kyuubi-spark-sql-engine_2.12-{{ release }}.jar, the engine jar deployed with a Kyuubi distribution
   2. a copy of Spark distribution
   3. kyuubi-spark-connector-hive_2.12-{{ release }}.jar, which can be found in the [Maven Central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-spark-connector-hive)
   ```



##########
docs/connector/spark/hive.md:
##########
@@ -0,0 +1,172 @@
+<!--
+- 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
+
+You may know that the Apache Spark has built-in support for accessing Hive tables, it works well in most cases,
+but is limited to one Hive Metastore. The Kyuubi Spark Hive connector (KSHC) implements a Hive connector based
+on Spark DataSource V2 API, supports accessing multiple Hive Metastore in a single Spark application.
+
+## Hive Integration
+
+To enable the integration of Kyuubi Spark SQL engine and Hive connector through
+Spark DataSource V2 API, you need to:
+
+- Referencing the Hive connector [dependencies](#kshc-dependencies)
+- Setting the Spark catalog [configurations](#kshc-configurations)
+
+(kshc-dependencies)=
+
+### Dependencies
+
+The **classpath** of Kyuubi Spark SQL engine with Hive connector supported consists of
+
+1. kyuubi-spark-sql-engine-{{ release }}_2.12.jar, the engine jar deployed with a Kyuubi distribution
+2. a copy of Spark distribution
+3. kyuubi-spark-connector-hive_2.12-{{ release }}, which can be found in the [Maven Central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-spark-connector-hive)
+
+In order to make the Hive connector packages visible for the runtime classpath of engines, we can use one of these methods:
+
+1. Put the Kyuubi Hive connector packages into `$SPARK_HOME/jars` directly
+2. Set `spark.jars=/path/to/kyuubi-hive-connector`

Review Comment:
   ```suggestion
   2. Set `spark.jars=/path/to/kyuubi-spark-connector-hive_2.12-<version>.jar`
   ```



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


Re: [PR] [KYUUBI #7664][DOC] Reformat and improve docs for KSHC [kyuubi]

Posted by "maomaodev (via GitHub)" <gi...@apache.org>.
maomaodev commented on code in PR #7667:
URL: https://github.com/apache/kyuubi/pull/7667#discussion_r3877825996


##########
docs/connector/spark/hive.md:
##########
@@ -0,0 +1,166 @@
+<!--
+- 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
+
+You may know that the Apache Spark has built-in support for accessing Hive tables, it works well in most cases,
+but is limited to one Hive Metastore. The Kyuubi Spark Hive connector(KSHC) implemented a Hive connector based
+on Spark DataSource V2 API, supports accessing multiple Hive Metastore in a single Spark application.
+
+## Hive Integration
+
+To enable the integration of Kyuubi Spark SQL engine and Hive connector through
+Spark DataSource V2 API, you need to:
+
+- Referencing the Hive connector [dependencies](#kshc-dependencies)
+- Setting the Spark catalog [configurations](#kshc-configurations)
+
+(kshc-dependencies)=
+
+### Dependencies
+
+The **classpath** of Kyuubi Spark SQL engine with Hive connector supported consists of
+
+1. kyuubi-spark-sql-engine-{{ release }}_2.12.jar, the engine jar deployed with a Kyuubi distribution
+2. a copy of Spark distribution
+3. kyuubi-spark-connector-hive_2.12-{{ release }}, which can be found in the [Maven Central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-spark-connector-hive)
+
+In order to make the Hive connector packages visible for the runtime classpath of engines, we can use one of these methods:
+
+1. Put the Kyuubi Hive connector packages into `$SPARK_HOME/jars` directly
+2. Set `spark.jars=/path/to/kyuubi-hive-connector`
+
+```{note}
+Starting from v1.9.2 and v1.10.0, KSHC jars available in the [Maven Central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-spark-connector-hive) guarantee binary compatibility across
+multiple Spark versions, so a single jar works across them without rebuilding.
+```
+
+(kshc-configurations)=
+
+### Configurations
+
+To activate functionality of Kyuubi Spark Hive connector, we can set the following configurations:
+
+```properties
+spark.sql.catalog.hive_catalog                      org.apache.kyuubi.spark.connector.hive.HiveTableCatalog
+spark.sql.catalog.hive_catalog.hive.metastore.uris  thrift://metastore-host:port
+spark.sql.catalog.hive_catalog.<other.hive.conf>    <value>
+spark.sql.catalog.hive_catalog.<other.hadoop.conf>  <value>
+```
+
+Besides the catalog-level configurations above, the Kyuubi Spark Hive connector provides the following configurations:
+
+|                              Key                               |      Default      |                                                                                                          Meaning                                                                                                           |  Type   | Since  |
+|----------------------------------------------------------------|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|--------|
+| `spark.sql.kyuubi.hive.connector.externalCatalog.share.policy` | `ONE_FOR_ALL`     | The share policy for the external catalog. `ONE_FOR_ONE` means an external catalog is used by only one `HiveTableCatalog`, while `ONE_FOR_ALL` shares an external catalog globally across the catalogs with the same name. | string  | 1.7.0  |
+| `spark.sql.catalog.<catalog>.delegation.token.renewal.enabled` | `true`            | Whether to enable delegation token renewal for the Kerberized Hive Metastore of this catalog.                                                                                                                              | boolean | 1.8.0  |
+| `spark.sql.kyuubi.hive.connector.read.convertMetastoreParquet` | `true`            | When enabled, the data source Parquet reader is used to process Parquet tables created by HiveQL syntax, instead of the Hive SerDe.                                                                                        | boolean | 1.11.0 |
+| `spark.sql.kyuubi.hive.connector.read.convertMetastoreOrc`     | `true`            | When enabled, the data source ORC reader is used to process ORC tables created by HiveQL syntax, instead of the Hive SerDe.                                                                                                | boolean | 1.11.0 |
+| `spark.sql.kyuubi.hive.connector.dropTableAsPurgeTable`        | `false`           | When enabled, `DROP TABLE` completely removes its data by skipping HDFS trash, equivalent to the `PURGE TABLE` command.                                                                                                    | boolean | 1.12.0 |
+| `spark.sql.catalog.<catalog>.hive.metastore.warehouse.dir`     | &lt;undefined&gt; | The default warehouse directory for the catalog, taking precedence over the global `spark.sql.warehouse.dir` when creating a database.                                                                                     | string  | 1.12.0 |
+
+```{note}
+Catalog-level configurations (`spark.sql.catalog.<catalog>.*`) are captured when the catalog is
+initialized, so they must be present at the Spark application bootstrap (in `spark-defaults.conf`
+or via `--conf`). Setting them through `SET` after the catalog has been created does not take
+effect, e.g. `SET spark.sql.catalog.<catalog>.<key>=<value>`.
+```
+
+## Hive Connector Operations
+
+Taking `CREATE NAMESPACE` as an example,
+
+```sql
+CREATE NAMESPACE ns;
+```
+
+Taking `CREATE TABLE` as an example,
+
+```sql
+CREATE TABLE hive_catalog.ns.foo (
+  id bigint COMMENT 'unique id',
+  data string)
+USING parquet;
+```
+
+Taking `SELECT` as an example,
+
+```sql
+SELECT * FROM hive_catalog.ns.foo;
+```
+
+Taking `INSERT` as an example,
+
+```sql
+INSERT INTO hive_catalog.ns.foo VALUES (1, 'a'), (2, 'b'), (3, 'c');
+```
+
+Taking `DROP TABLE` as an example,
+
+```sql
+DROP TABLE hive_catalog.ns.foo;
+```
+
+Taking `DROP NAMESPACE` as an example,
+
+```sql
+DROP NAMESPACE hive_catalog.ns;
+```
+
+## Features
+
+Since v1.11.0, KSHC uses the data source Parquet/ORC reader to process Parquet and ORC tables
+created by HiveQL syntax by default, instead of the Hive SerDe. This enables vectorized reading.
+Set `spark.sql.kyuubi.hive.connector.read.convertMetastoreParquet` and
+`spark.sql.kyuubi.hive.connector.read.convertMetastoreOrc` to `false` to fall back to the Hive
+SerDe.
+
+Since v1.12.0, KSHC supports the `PURGE TABLE` command. By default, `DROP TABLE` moves the table
+data to the HDFS trash. Set `spark.sql.kyuubi.hive.connector.dropTableAsPurgeTable` to `true` to
+make `DROP TABLE` skip the HDFS trash and completely remove its data, behaving like `PURGE TABLE`.
+
+Since v1.13.0, KSHC supports Dynamic Partition Pruning (DPP) for partitioned Hive tables, which
+significantly reduces the amount of data scanned when joining against large partitioned tables.
+DPP is implemented by wrapping Spark's built-in `ParquetScan` / `OrcScan`. As a result, native
+engines such as Gluten and Comet cannot recognize these scans by class name, so KSHC-converted
+Parquet/ORC tables silently fall back to the JVM read path and can no longer be offloaded.
+
+## Advanced Usages
+
+Though KSHC is a pure Spark DataSource V2 connector which isn't coupled with Kyuubi deployment, due to the
+implementation inside `spark-sql`, you should not expect KSHC works properly with `spark-sql`, and
+any issues caused by such a combination usage won't be considered at this time. Instead, it's recommended
+using BeeLine with Kyuubi as a drop-in replacement for `spark-sql`, or switching to `spark-shell`.
+
+KSHC supports accessing Kerberized Hive Metastore and HDFS, by using keytab, or TGT cache, or Delegation Token.
+It's not expected to work properly with multiple KDC instances, the limitation comes from JDK Krb5LoginModule,
+for such cases, consider setting up Cross-Realm Kerberos trusts, then you just need to talk with one KDC.
+
+For HMS Thrift API used by Spark, it's known that Hive 2.3.9 client is compatible with HMS from 2.1 to 4.0, and
+Hive 2.3.10 client is compatible with HMS from 1.1 to 4.0, such version combinations should cover the most cases.

Review Comment:
   Agreed, replaced 4.0 with 3.1 for both Hive client versions.



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


Re: [PR] [KYUUBI #7664][DOC] Reformat and improve docs for KSHC [kyuubi]

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #7667:
URL: https://github.com/apache/kyuubi/pull/7667#discussion_r3873748164


##########
docs/connector/spark/hive.md:
##########
@@ -0,0 +1,166 @@
+<!--
+- 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
+
+You may know that the Apache Spark has built-in support for accessing Hive tables, it works well in most cases,
+but is limited to one Hive Metastore. The Kyuubi Spark Hive connector(KSHC) implemented a Hive connector based
+on Spark DataSource V2 API, supports accessing multiple Hive Metastore in a single Spark application.
+
+## Hive Integration
+
+To enable the integration of Kyuubi Spark SQL engine and Hive connector through
+Spark DataSource V2 API, you need to:
+
+- Referencing the Hive connector [dependencies](#kshc-dependencies)
+- Setting the Spark catalog [configurations](#kshc-configurations)
+
+(kshc-dependencies)=
+
+### Dependencies
+
+The **classpath** of Kyuubi Spark SQL engine with Hive connector supported consists of
+
+1. kyuubi-spark-sql-engine-{{ release }}_2.12.jar, the engine jar deployed with a Kyuubi distribution
+2. a copy of Spark distribution
+3. kyuubi-spark-connector-hive_2.12-{{ release }}, which can be found in the [Maven Central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-spark-connector-hive)
+
+In order to make the Hive connector packages visible for the runtime classpath of engines, we can use one of these methods:
+
+1. Put the Kyuubi Hive connector packages into `$SPARK_HOME/jars` directly
+2. Set `spark.jars=/path/to/kyuubi-hive-connector`
+
+```{note}
+Starting from v1.9.2 and v1.10.0, KSHC jars available in the [Maven Central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-spark-connector-hive) guarantee binary compatibility across
+multiple Spark versions, so a single jar works across them without rebuilding.
+```
+
+(kshc-configurations)=
+
+### Configurations
+
+To activate functionality of Kyuubi Spark Hive connector, we can set the following configurations:
+
+```properties
+spark.sql.catalog.hive_catalog                      org.apache.kyuubi.spark.connector.hive.HiveTableCatalog
+spark.sql.catalog.hive_catalog.hive.metastore.uris  thrift://metastore-host:port
+spark.sql.catalog.hive_catalog.<other.hive.conf>    <value>
+spark.sql.catalog.hive_catalog.<other.hadoop.conf>  <value>
+```
+
+Besides the catalog-level configurations above, the Kyuubi Spark Hive connector provides the following configurations:
+
+|                              Key                               |      Default      |                                                                                                          Meaning                                                                                                           |  Type   | Since  |
+|----------------------------------------------------------------|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|--------|
+| `spark.sql.kyuubi.hive.connector.externalCatalog.share.policy` | `ONE_FOR_ALL`     | The share policy for the external catalog. `ONE_FOR_ONE` means an external catalog is used by only one `HiveTableCatalog`, while `ONE_FOR_ALL` shares an external catalog globally across the catalogs with the same name. | string  | 1.7.0  |
+| `spark.sql.catalog.<catalog>.delegation.token.renewal.enabled` | `true`            | Whether to enable delegation token renewal for the Kerberized Hive Metastore of this catalog.                                                                                                                              | boolean | 1.8.0  |
+| `spark.sql.kyuubi.hive.connector.read.convertMetastoreParquet` | `true`            | When enabled, the data source Parquet reader is used to process Parquet tables created by HiveQL syntax, instead of the Hive SerDe.                                                                                        | boolean | 1.11.0 |
+| `spark.sql.kyuubi.hive.connector.read.convertMetastoreOrc`     | `true`            | When enabled, the data source ORC reader is used to process ORC tables created by HiveQL syntax, instead of the Hive SerDe.                                                                                                | boolean | 1.11.0 |
+| `spark.sql.kyuubi.hive.connector.dropTableAsPurgeTable`        | `false`           | When enabled, `DROP TABLE` completely removes its data by skipping HDFS trash, equivalent to the `PURGE TABLE` command.                                                                                                    | boolean | 1.12.0 |
+| `spark.sql.catalog.<catalog>.hive.metastore.warehouse.dir`     | &lt;undefined&gt; | The default warehouse directory for the catalog, taking precedence over the global `spark.sql.warehouse.dir` when creating a database.                                                                                     | string  | 1.12.0 |
+
+```{note}
+Catalog-level configurations (`spark.sql.catalog.<catalog>.*`) are captured when the catalog is
+initialized, so they must be present at the Spark application bootstrap (in `spark-defaults.conf`
+or via `--conf`). Setting them through `SET` after the catalog has been created does not take
+effect, e.g. `SET spark.sql.catalog.<catalog>.<key>=<value>`.
+```
+
+## Hive Connector Operations
+
+Taking `CREATE NAMESPACE` as an example,
+
+```sql
+CREATE NAMESPACE ns;
+```
+
+Taking `CREATE TABLE` as an example,
+
+```sql
+CREATE TABLE hive_catalog.ns.foo (
+  id bigint COMMENT 'unique id',
+  data string)
+USING parquet;
+```
+
+Taking `SELECT` as an example,
+
+```sql
+SELECT * FROM hive_catalog.ns.foo;
+```
+
+Taking `INSERT` as an example,
+
+```sql
+INSERT INTO hive_catalog.ns.foo VALUES (1, 'a'), (2, 'b'), (3, 'c');
+```
+
+Taking `DROP TABLE` as an example,
+
+```sql
+DROP TABLE hive_catalog.ns.foo;
+```
+
+Taking `DROP NAMESPACE` as an example,
+
+```sql
+DROP NAMESPACE hive_catalog.ns;
+```
+
+## Features
+
+Since v1.11.0, KSHC uses the data source Parquet/ORC reader to process Parquet and ORC tables
+created by HiveQL syntax by default, instead of the Hive SerDe. This enables vectorized reading.
+Set `spark.sql.kyuubi.hive.connector.read.convertMetastoreParquet` and
+`spark.sql.kyuubi.hive.connector.read.convertMetastoreOrc` to `false` to fall back to the Hive
+SerDe.
+
+Since v1.12.0, KSHC supports the `PURGE TABLE` command. By default, `DROP TABLE` moves the table
+data to the HDFS trash. Set `spark.sql.kyuubi.hive.connector.dropTableAsPurgeTable` to `true` to
+make `DROP TABLE` skip the HDFS trash and completely remove its data, behaving like `PURGE TABLE`.
+
+Since v1.13.0, KSHC supports Dynamic Partition Pruning (DPP) for partitioned Hive tables, which
+significantly reduces the amount of data scanned when joining against large partitioned tables.
+DPP is implemented by wrapping Spark's built-in `ParquetScan` / `OrcScan`. As a result, native
+engines such as Gluten and Comet cannot recognize these scans by class name, so KSHC-converted
+Parquet/ORC tables silently fall back to the JVM read path and can no longer be offloaded.
+
+## Advanced Usages
+
+Though KSHC is a pure Spark DataSource V2 connector which isn't coupled with Kyuubi deployment, due to the
+implementation inside `spark-sql`, you should not expect KSHC works properly with `spark-sql`, and
+any issues caused by such a combination usage won't be considered at this time. Instead, it's recommended
+using BeeLine with Kyuubi as a drop-in replacement for `spark-sql`, or switching to `spark-shell`.
+
+KSHC supports accessing Kerberized Hive Metastore and HDFS, by using keytab, or TGT cache, or Delegation Token.
+It's not expected to work properly with multiple KDC instances, the limitation comes from JDK Krb5LoginModule,
+for such cases, consider setting up Cross-Realm Kerberos trusts, then you just need to talk with one KDC.
+
+For HMS Thrift API used by Spark, it's known that Hive 2.3.9 client is compatible with HMS from 2.1 to 4.0, and
+Hive 2.3.10 client is compatible with HMS from 1.1 to 4.0, such version combinations should cover the most cases.

Review Comment:
   so let's be conservative, replace the 4.0 with 3.1



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


Re: [PR] [KYUUBI #7664][DOC] Reformat and improve docs for KSHC [kyuubi]

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #7667:
URL: https://github.com/apache/kyuubi/pull/7667#discussion_r3873873871


##########
docs/connector/spark/hive.md:
##########
@@ -0,0 +1,166 @@
+<!--
+- 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
+
+You may know that the Apache Spark has built-in support for accessing Hive tables, it works well in most cases,
+but is limited to one Hive Metastore. The Kyuubi Spark Hive connector(KSHC) implemented a Hive connector based
+on Spark DataSource V2 API, supports accessing multiple Hive Metastore in a single Spark application.
+
+## Hive Integration
+
+To enable the integration of Kyuubi Spark SQL engine and Hive connector through
+Spark DataSource V2 API, you need to:
+
+- Referencing the Hive connector [dependencies](#kshc-dependencies)
+- Setting the Spark catalog [configurations](#kshc-configurations)
+
+(kshc-dependencies)=
+
+### Dependencies
+
+The **classpath** of Kyuubi Spark SQL engine with Hive connector supported consists of
+
+1. kyuubi-spark-sql-engine-{{ release }}_2.12.jar, the engine jar deployed with a Kyuubi distribution
+2. a copy of Spark distribution
+3. kyuubi-spark-connector-hive_2.12-{{ release }}, which can be found in the [Maven Central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-spark-connector-hive)
+
+In order to make the Hive connector packages visible for the runtime classpath of engines, we can use one of these methods:
+
+1. Put the Kyuubi Hive connector packages into `$SPARK_HOME/jars` directly
+2. Set `spark.jars=/path/to/kyuubi-hive-connector`
+
+```{note}
+Starting from v1.9.2 and v1.10.0, KSHC jars available in the [Maven Central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-spark-connector-hive) guarantee binary compatibility across
+multiple Spark versions, so a single jar works across them without rebuilding.
+```
+
+(kshc-configurations)=
+
+### Configurations
+
+To activate functionality of Kyuubi Spark Hive connector, we can set the following configurations:
+
+```properties
+spark.sql.catalog.hive_catalog                      org.apache.kyuubi.spark.connector.hive.HiveTableCatalog
+spark.sql.catalog.hive_catalog.hive.metastore.uris  thrift://metastore-host:port
+spark.sql.catalog.hive_catalog.<other.hive.conf>    <value>
+spark.sql.catalog.hive_catalog.<other.hadoop.conf>  <value>
+```
+
+Besides the catalog-level configurations above, the Kyuubi Spark Hive connector provides the following configurations:
+
+|                              Key                               |      Default      |                                                                                                          Meaning                                                                                                           |  Type   | Since  |
+|----------------------------------------------------------------|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|--------|
+| `spark.sql.kyuubi.hive.connector.externalCatalog.share.policy` | `ONE_FOR_ALL`     | The share policy for the external catalog. `ONE_FOR_ONE` means an external catalog is used by only one `HiveTableCatalog`, while `ONE_FOR_ALL` shares an external catalog globally across the catalogs with the same name. | string  | 1.7.0  |
+| `spark.sql.catalog.<catalog>.delegation.token.renewal.enabled` | `true`            | Whether to enable delegation token renewal for the Kerberized Hive Metastore of this catalog.                                                                                                                              | boolean | 1.8.0  |
+| `spark.sql.kyuubi.hive.connector.read.convertMetastoreParquet` | `true`            | When enabled, the data source Parquet reader is used to process Parquet tables created by HiveQL syntax, instead of the Hive SerDe.                                                                                        | boolean | 1.11.0 |
+| `spark.sql.kyuubi.hive.connector.read.convertMetastoreOrc`     | `true`            | When enabled, the data source ORC reader is used to process ORC tables created by HiveQL syntax, instead of the Hive SerDe.                                                                                                | boolean | 1.11.0 |
+| `spark.sql.kyuubi.hive.connector.dropTableAsPurgeTable`        | `false`           | When enabled, `DROP TABLE` completely removes its data by skipping HDFS trash, equivalent to the `PURGE TABLE` command.                                                                                                    | boolean | 1.12.0 |
+| `spark.sql.catalog.<catalog>.hive.metastore.warehouse.dir`     | &lt;undefined&gt; | The default warehouse directory for the catalog, taking precedence over the global `spark.sql.warehouse.dir` when creating a database.                                                                                     | string  | 1.12.0 |
+
+```{note}
+Catalog-level configurations (`spark.sql.catalog.<catalog>.*`) are captured when the catalog is
+initialized, so they must be present at the Spark application bootstrap (in `spark-defaults.conf`
+or via `--conf`). Setting them through `SET` after the catalog has been created does not take

Review Comment:
   > ... so they must be present at the Spark application bootstrap (in `spark-defaults.conf` or via `--conf`).
   
   I don't think the "must" is correct, the V2 session catalog is lazily initialized and session-isolated, so technically configs will take effect as long as it set before the catalog is initialized, of course, for `ONE_FOR_ALL`, configs only apply to the first initialized Hive client instance.
   
   What matters here is that, for the kerberized cluster mode, if you want to distribute HMS tokens (non-keytab mode), you must declare all catalogs with metastore.uris at bootstrap so that `spark-submit` can fetch the HMS tokens ahead.
   
   The above words are just an explanation, which do not fit the docs standard and need to be reorganized and polished



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


Re: [PR] [KYUUBI #7664][DOC] Reformat and improve docs for KSHC [kyuubi]

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #7667:
URL: https://github.com/apache/kyuubi/pull/7667#discussion_r3873726762


##########
docs/connector/spark/hive.md:
##########
@@ -0,0 +1,166 @@
+<!--
+- 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
+
+You may know that the Apache Spark has built-in support for accessing Hive tables, it works well in most cases,
+but is limited to one Hive Metastore. The Kyuubi Spark Hive connector(KSHC) implemented a Hive connector based
+on Spark DataSource V2 API, supports accessing multiple Hive Metastore in a single Spark application.
+
+## Hive Integration
+
+To enable the integration of Kyuubi Spark SQL engine and Hive connector through
+Spark DataSource V2 API, you need to:
+
+- Referencing the Hive connector [dependencies](#kshc-dependencies)
+- Setting the Spark catalog [configurations](#kshc-configurations)
+
+(kshc-dependencies)=
+
+### Dependencies
+
+The **classpath** of Kyuubi Spark SQL engine with Hive connector supported consists of
+
+1. kyuubi-spark-sql-engine-{{ release }}_2.12.jar, the engine jar deployed with a Kyuubi distribution
+2. a copy of Spark distribution
+3. kyuubi-spark-connector-hive_2.12-{{ release }}, which can be found in the [Maven Central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-spark-connector-hive)
+
+In order to make the Hive connector packages visible for the runtime classpath of engines, we can use one of these methods:
+
+1. Put the Kyuubi Hive connector packages into `$SPARK_HOME/jars` directly
+2. Set `spark.jars=/path/to/kyuubi-hive-connector`
+
+```{note}
+Starting from v1.9.2 and v1.10.0, KSHC jars available in the [Maven Central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-spark-connector-hive) guarantee binary compatibility across
+multiple Spark versions, so a single jar works across them without rebuilding.
+```
+
+(kshc-configurations)=
+
+### Configurations
+
+To activate functionality of Kyuubi Spark Hive connector, we can set the following configurations:
+
+```properties
+spark.sql.catalog.hive_catalog                      org.apache.kyuubi.spark.connector.hive.HiveTableCatalog
+spark.sql.catalog.hive_catalog.hive.metastore.uris  thrift://metastore-host:port
+spark.sql.catalog.hive_catalog.<other.hive.conf>    <value>
+spark.sql.catalog.hive_catalog.<other.hadoop.conf>  <value>
+```
+
+Besides the catalog-level configurations above, the Kyuubi Spark Hive connector provides the following configurations:
+
+|                              Key                               |      Default      |                                                                                                          Meaning                                                                                                           |  Type   | Since  |
+|----------------------------------------------------------------|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|--------|
+| `spark.sql.kyuubi.hive.connector.externalCatalog.share.policy` | `ONE_FOR_ALL`     | The share policy for the external catalog. `ONE_FOR_ONE` means an external catalog is used by only one `HiveTableCatalog`, while `ONE_FOR_ALL` shares an external catalog globally across the catalogs with the same name. | string  | 1.7.0  |
+| `spark.sql.catalog.<catalog>.delegation.token.renewal.enabled` | `true`            | Whether to enable delegation token renewal for the Kerberized Hive Metastore of this catalog.                                                                                                                              | boolean | 1.8.0  |
+| `spark.sql.kyuubi.hive.connector.read.convertMetastoreParquet` | `true`            | When enabled, the data source Parquet reader is used to process Parquet tables created by HiveQL syntax, instead of the Hive SerDe.                                                                                        | boolean | 1.11.0 |
+| `spark.sql.kyuubi.hive.connector.read.convertMetastoreOrc`     | `true`            | When enabled, the data source ORC reader is used to process ORC tables created by HiveQL syntax, instead of the Hive SerDe.                                                                                                | boolean | 1.11.0 |
+| `spark.sql.kyuubi.hive.connector.dropTableAsPurgeTable`        | `false`           | When enabled, `DROP TABLE` completely removes its data by skipping HDFS trash, equivalent to the `PURGE TABLE` command.                                                                                                    | boolean | 1.12.0 |
+| `spark.sql.catalog.<catalog>.hive.metastore.warehouse.dir`     | &lt;undefined&gt; | The default warehouse directory for the catalog, taking precedence over the global `spark.sql.warehouse.dir` when creating a database.                                                                                     | string  | 1.12.0 |
+
+```{note}
+Catalog-level configurations (`spark.sql.catalog.<catalog>.*`) are captured when the catalog is
+initialized, so they must be present at the Spark application bootstrap (in `spark-defaults.conf`
+or via `--conf`). Setting them through `SET` after the catalog has been created does not take
+effect, e.g. `SET spark.sql.catalog.<catalog>.<key>=<value>`.
+```
+
+## Hive Connector Operations
+
+Taking `CREATE NAMESPACE` as an example,
+
+```sql
+CREATE NAMESPACE ns;
+```
+
+Taking `CREATE TABLE` as an example,
+
+```sql
+CREATE TABLE hive_catalog.ns.foo (
+  id bigint COMMENT 'unique id',
+  data string)
+USING parquet;
+```
+
+Taking `SELECT` as an example,
+
+```sql
+SELECT * FROM hive_catalog.ns.foo;
+```
+
+Taking `INSERT` as an example,
+
+```sql
+INSERT INTO hive_catalog.ns.foo VALUES (1, 'a'), (2, 'b'), (3, 'c');
+```
+
+Taking `DROP TABLE` as an example,
+
+```sql
+DROP TABLE hive_catalog.ns.foo;
+```
+
+Taking `DROP NAMESPACE` as an example,
+
+```sql
+DROP NAMESPACE hive_catalog.ns;
+```
+
+## Features
+
+Since v1.11.0, KSHC uses the data source Parquet/ORC reader to process Parquet and ORC tables
+created by HiveQL syntax by default, instead of the Hive SerDe. This enables vectorized reading.
+Set `spark.sql.kyuubi.hive.connector.read.convertMetastoreParquet` and
+`spark.sql.kyuubi.hive.connector.read.convertMetastoreOrc` to `false` to fall back to the Hive
+SerDe.
+
+Since v1.12.0, KSHC supports the `PURGE TABLE` command. By default, `DROP TABLE` moves the table
+data to the HDFS trash. Set `spark.sql.kyuubi.hive.connector.dropTableAsPurgeTable` to `true` to
+make `DROP TABLE` skip the HDFS trash and completely remove its data, behaving like `PURGE TABLE`.
+
+Since v1.13.0, KSHC supports Dynamic Partition Pruning (DPP) for partitioned Hive tables, which
+significantly reduces the amount of data scanned when joining against large partitioned tables.
+DPP is implemented by wrapping Spark's built-in `ParquetScan` / `OrcScan`. As a result, native
+engines such as Gluten and Comet cannot recognize these scans by class name, so KSHC-converted
+Parquet/ORC tables silently fall back to the JVM read path and can no longer be offloaded.
+
+## Advanced Usages
+
+Though KSHC is a pure Spark DataSource V2 connector which isn't coupled with Kyuubi deployment, due to the
+implementation inside `spark-sql`, you should not expect KSHC works properly with `spark-sql`, and
+any issues caused by such a combination usage won't be considered at this time. Instead, it's recommended
+using BeeLine with Kyuubi as a drop-in replacement for `spark-sql`, or switching to `spark-shell`.
+
+KSHC supports accessing Kerberized Hive Metastore and HDFS, by using keytab, or TGT cache, or Delegation Token.
+It's not expected to work properly with multiple KDC instances, the limitation comes from JDK Krb5LoginModule,
+for such cases, consider setting up Cross-Realm Kerberos trusts, then you just need to talk with one KDC.
+
+For HMS Thrift API used by Spark, it's known that Hive 2.3.9 client is compatible with HMS from 2.1 to 4.0, and
+Hive 2.3.10 client is compatible with HMS from 1.1 to 4.0, such version combinations should cover the most cases.

Review Comment:
   the claim is no longer valid; HIVE-26537 (4.1.0, 4.0.1) actually broke the Thrift wire protocol by removing the Thrift API used by Spark (the `get_table` method).



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


Re: [PR] [KYUUBI #7664][DOC] Reformat and improve docs for KSHC [kyuubi]

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #7667:
URL: https://github.com/apache/kyuubi/pull/7667#discussion_r3873784363


##########
docs/connector/spark/hive.md:
##########
@@ -0,0 +1,166 @@
+<!--
+- 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
+
+You may know that the Apache Spark has built-in support for accessing Hive tables, it works well in most cases,
+but is limited to one Hive Metastore. The Kyuubi Spark Hive connector(KSHC) implemented a Hive connector based
+on Spark DataSource V2 API, supports accessing multiple Hive Metastore in a single Spark application.
+
+## Hive Integration
+
+To enable the integration of Kyuubi Spark SQL engine and Hive connector through
+Spark DataSource V2 API, you need to:
+
+- Referencing the Hive connector [dependencies](#kshc-dependencies)
+- Setting the Spark catalog [configurations](#kshc-configurations)
+
+(kshc-dependencies)=
+
+### Dependencies
+
+The **classpath** of Kyuubi Spark SQL engine with Hive connector supported consists of
+
+1. kyuubi-spark-sql-engine-{{ release }}_2.12.jar, the engine jar deployed with a Kyuubi distribution
+2. a copy of Spark distribution
+3. kyuubi-spark-connector-hive_2.12-{{ release }}, which can be found in the [Maven Central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-spark-connector-hive)
+
+In order to make the Hive connector packages visible for the runtime classpath of engines, we can use one of these methods:
+
+1. Put the Kyuubi Hive connector packages into `$SPARK_HOME/jars` directly
+2. Set `spark.jars=/path/to/kyuubi-hive-connector`
+
+```{note}
+Starting from v1.9.2 and v1.10.0, KSHC jars available in the [Maven Central](https://mvnrepository.com/artifact/org.apache.kyuubi/kyuubi-spark-connector-hive) guarantee binary compatibility across
+multiple Spark versions, so a single jar works across them without rebuilding.
+```
+
+(kshc-configurations)=
+
+### Configurations
+
+To activate functionality of Kyuubi Spark Hive connector, we can set the following configurations:
+
+```properties
+spark.sql.catalog.hive_catalog                      org.apache.kyuubi.spark.connector.hive.HiveTableCatalog
+spark.sql.catalog.hive_catalog.hive.metastore.uris  thrift://metastore-host:port
+spark.sql.catalog.hive_catalog.<other.hive.conf>    <value>
+spark.sql.catalog.hive_catalog.<other.hadoop.conf>  <value>
+```
+
+Besides the catalog-level configurations above, the Kyuubi Spark Hive connector provides the following configurations:
+
+|                              Key                               |      Default      |                                                                                                          Meaning                                                                                                           |  Type   | Since  |
+|----------------------------------------------------------------|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|--------|
+| `spark.sql.kyuubi.hive.connector.externalCatalog.share.policy` | `ONE_FOR_ALL`     | The share policy for the external catalog. `ONE_FOR_ONE` means an external catalog is used by only one `HiveTableCatalog`, while `ONE_FOR_ALL` shares an external catalog globally across the catalogs with the same name. | string  | 1.7.0  |
+| `spark.sql.catalog.<catalog>.delegation.token.renewal.enabled` | `true`            | Whether to enable delegation token renewal for the Kerberized Hive Metastore of this catalog.                                                                                                                              | boolean | 1.8.0  |
+| `spark.sql.kyuubi.hive.connector.read.convertMetastoreParquet` | `true`            | When enabled, the data source Parquet reader is used to process Parquet tables created by HiveQL syntax, instead of the Hive SerDe.                                                                                        | boolean | 1.11.0 |
+| `spark.sql.kyuubi.hive.connector.read.convertMetastoreOrc`     | `true`            | When enabled, the data source ORC reader is used to process ORC tables created by HiveQL syntax, instead of the Hive SerDe.                                                                                                | boolean | 1.11.0 |
+| `spark.sql.kyuubi.hive.connector.dropTableAsPurgeTable`        | `false`           | When enabled, `DROP TABLE` completely removes its data by skipping HDFS trash, equivalent to the `PURGE TABLE` command.                                                                                                    | boolean | 1.12.0 |
+| `spark.sql.catalog.<catalog>.hive.metastore.warehouse.dir`     | &lt;undefined&gt; | The default warehouse directory for the catalog, taking precedence over the global `spark.sql.warehouse.dir` when creating a database.                                                                                     | string  | 1.12.0 |
+
+```{note}
+Catalog-level configurations (`spark.sql.catalog.<catalog>.*`) are captured when the catalog is
+initialized, so they must be present at the Spark application bootstrap (in `spark-defaults.conf`
+or via `--conf`). Setting them through `SET` after the catalog has been created does not take
+effect, e.g. `SET spark.sql.catalog.<catalog>.<key>=<value>`.
+```
+
+## Hive Connector Operations
+
+Taking `CREATE NAMESPACE` as an example,
+
+```sql
+CREATE NAMESPACE ns;
+```
+
+Taking `CREATE TABLE` as an example,
+
+```sql
+CREATE TABLE hive_catalog.ns.foo (
+  id bigint COMMENT 'unique id',
+  data string)
+USING parquet;
+```
+
+Taking `SELECT` as an example,
+
+```sql
+SELECT * FROM hive_catalog.ns.foo;
+```
+
+Taking `INSERT` as an example,
+
+```sql
+INSERT INTO hive_catalog.ns.foo VALUES (1, 'a'), (2, 'b'), (3, 'c');
+```
+
+Taking `DROP TABLE` as an example,
+
+```sql
+DROP TABLE hive_catalog.ns.foo;
+```
+
+Taking `DROP NAMESPACE` as an example,
+
+```sql
+DROP NAMESPACE hive_catalog.ns;
+```
+
+## Features
+
+Since v1.11.0, KSHC uses the data source Parquet/ORC reader to process Parquet and ORC tables
+created by HiveQL syntax by default, instead of the Hive SerDe. This enables vectorized reading.
+Set `spark.sql.kyuubi.hive.connector.read.convertMetastoreParquet` and
+`spark.sql.kyuubi.hive.connector.read.convertMetastoreOrc` to `false` to fall back to the Hive
+SerDe.
+
+Since v1.12.0, KSHC supports the `PURGE TABLE` command. By default, `DROP TABLE` moves the table
+data to the HDFS trash. Set `spark.sql.kyuubi.hive.connector.dropTableAsPurgeTable` to `true` to
+make `DROP TABLE` skip the HDFS trash and completely remove its data, behaving like `PURGE TABLE`.
+
+Since v1.13.0, KSHC supports Dynamic Partition Pruning (DPP) for partitioned Hive tables, which
+significantly reduces the amount of data scanned when joining against large partitioned tables.
+DPP is implemented by wrapping Spark's built-in `ParquetScan` / `OrcScan`. As a result, native
+engines such as Gluten and Comet cannot recognize these scans by class name, so KSHC-converted
+Parquet/ORC tables silently fall back to the JVM read path and can no longer be offloaded.
+
+## Advanced Usages
+
+Though KSHC is a pure Spark DataSource V2 connector which isn't coupled with Kyuubi deployment, due to the
+implementation inside `spark-sql`, you should not expect KSHC works properly with `spark-sql`, and
+any issues caused by such a combination usage won't be considered at this time. Instead, it's recommended
+using BeeLine with Kyuubi as a drop-in replacement for `spark-sql`, or switching to `spark-shell`.
+
+KSHC supports accessing Kerberized Hive Metastore and HDFS, by using keytab, or TGT cache, or Delegation Token.
+It's not expected to work properly with multiple KDC instances, the limitation comes from JDK Krb5LoginModule,
+for such cases, consider setting up Cross-Realm Kerberos trusts, then you just need to talk with one KDC.
+
+For HMS Thrift API used by Spark, it's known that Hive 2.3.9 client is compatible with HMS from 2.1 to 4.0, and
+Hive 2.3.10 client is compatible with HMS from 1.1 to 4.0, such version combinations should cover the most cases.
+For other corner cases, KSHC also supports `spark.sql.catalog.<catalog_name>.spark.sql.hive.metastore.jars` and
+`spark.sql.catalog.<catalog_name>.spark.sql.hive.metastore.version` as well as the Spark built-in Hive datasource
+does, you can refer to the Spark documentation for details.
+
+## Limitations
+
+Currently, KSHC has the following limitations:
+
+- KSHC does not support Hive functions / UDFs.

Review Comment:
   this might confuse and scare users, since it can be interpreted as:
   
   "all my existing Hive UDFs, including those `ADD JAR ...` and `CREATE TEMPORARY FUNCTION ...`, will stop working if I want to use KSHC"



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


Re: [PR] [KYUUBI #7664][DOC] Reformat and improve docs for KSHC [kyuubi]

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 closed pull request #7667: [KYUUBI #7664][DOC] Reformat and improve docs for KSHC
URL: https://github.com/apache/kyuubi/pull/7667


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org