Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions docs/lakehouse/catalogs/hive-catalog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ CREATE CATALOG [IF NOT EXISTS] catalog_name PROPERTIES (

* `hive.ignore_absent_partitions`: Whether to ignore non-existent partitions. Defaults to `true`. If set to `false`, the query will report an error when encountering non-existent partitions. This parameter has been supported since version 3.0.2.

* `hive.staging_dir`: Used to set the temporary staging root directory for Hive write operations. During the write process, data is first written to this directory and then moved to the final Hive table directory after completion. This path can be either a relative path relative to the Hive table root directory or an absolute path. The default value is `/tmp/.doris_staging`. In some cases, when writing to Hive tables, you may encounter issues where the `/tmp` directory and the table directory belong to different namespaces, causing write failures. In such cases, you can modify this parameter to use a relative path to resolve the issue. This parameter is supported since version 4.0.3.

* `{CommonProperties}`

The CommonProperties section is for entering common attributes. Please see the "Common Properties" section in the [Catalog Overview](../catalog-overview.md).
Expand Down Expand Up @@ -669,6 +671,15 @@ You can query Hive Views, but there are some limitations:

* Some functions supported by HiveQL may have the same name as those in Doris but behave differently. This could lead to discrepancies between the results obtained from Hive and Doris. If you encounter such issues, please report them to the community.

### Related Parameters

* Session variables

| Parameter name | Default value | Desciption | Since version |
| ----------| ---- | ---- | --- |
| `hive_parquet_use_column_names` | `true` | When Doris reads the Parquet data type of the Hive table, it will find the column with the same name from the Parquet file to read the data according to the column name of the Hive table by default. When this variable is `false`, Doris will read data from the Parquet file according to the column order in the Hive table, regardless of the column name. Similar to the `parquet.column.index.access` variable in Hive. This parameter only applies to the top-level column name and is invalid inside the Struct. | 2.1.6+, 3.0.3+ |
| `hive_orc_use_column_names` | `true` | Similar to `hive_parquet_use_column_names`, it is for the Hive table ORC data type. Similar to the `orc.force.positional.evolution` variable in Hive. | 2.1.6+, 3.0.3+ |

## Write Operations

Data can be written to Hive tables using the INSERT statement. This is supported for Hive tables created by Doris or existing Hive tables with compatible formats.
Expand Down Expand Up @@ -730,14 +741,7 @@ AS SELECT col1, pt1 AS col2, pt2 AS pt1 FROM test_ctas.part_ctas_src WHERE col1

### Related Parameters

* Session variables

| Parameter name | Default value | Desciption | Since version |
| ----------| ---- | ---- | --- |
| `hive_parquet_use_column_names` | `true` | When Doris reads the Parquet data type of the Hive table, it will find the column with the same name from the Parquet file to read the data according to the column name of the Hive table by default. When this variable is `false`, Doris will read data from the Parquet file according to the column order in the Hive table, regardless of the column name. Similar to the `parquet.column.index.access` variable in Hive. This parameter only applies to the top-level column name and is invalid inside the Struct. | 2.1.6+, 3.0.3+ |
| `hive_orc_use_column_names` | `true` | Similar to `hive_parquet_use_column_names`, it is for the Hive table ORC data type. Similar to the `orc.force.positional.evolution` variable in Hive. | 2.1.6+, 3.0.3+ |

* BE
* BE Configuration

| Parameter Name | Default Value | Description |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------- |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ CREATE CATALOG [IF NOT EXISTS] catalog_name PROPERTIES (

* `hive.ignore_absent_partitions`:是否忽略不存在的分区。默认为 `true`。如果设为 `false`,当遇到不存在的分区时,查询会报错。该参数自 3.0.2 版本支持。

* `hive.staging_dir`:用于设置 Hive 写操作的临时 staging 根目录。写入过程中数据会先写入该目录,写入完成后再移动到最终的 Hive 表目录。该路径可以是相对于 Hive 表根目录的相对路径,也可以是绝对路径。默认值为 `/tmp/.doris_staging`。某些情况下,写入 Hive 表时会遇到 `/tmp` 目录和表目录分属不同 namespace,导致无法写入的问题,此时可以通过修改此参数,使用相对路径解决该问题。该参数自 4.0.3 版本开始支持。

* `{CommonProperties}`

CommonProperties 部分用于填写通用属性。请参阅[ 数据目录概述 ](../catalog-overview.md)中【通用属性】部分。
Expand Down Expand Up @@ -676,6 +678,15 @@ Hive Transactional 表是 Hive 中支持 ACID 语义的表。详情可见 [Hive

* 部分 HiveQL 支持的函数可能和 Doris 支持的函数同名,但行为不一致,这可能导致最终结果和使用 Hive 查询的结果不一致。如果用户遇到此类问题,可以向社区反馈。

### 相关参数

* Session 变量

| 参数名称 | 描述 | 默认值 | 版本 |
| ----------| ---- | ---- | --- |
| `hive_parquet_use_column_names` | `true` | Doris 在读取 Hive 表 Parquet 数据类型时,默认会根据 Hive 表的列名从 Parquet 文件中找同名的列来读取数据。当该变量为 `false` 时,Doris 会根据 Hive 表中的列顺序从 Parquet 文件中读取数据,与列名无关。类似于 Hive 中的 `parquet.column.index.access` 变量。该参数只适用于顶层列名,对 Struct 内部无效。 | 2.1.6+, 3.0.3+ |
| `hive_orc_use_column_names` | `true` | 与 `hive_parquet_use_column_names` 类似,针对的是 Hive 表 ORC 数据类型。类似于 Hive 中的 `orc.force.positional.evolution` 变量。 | 2.1.6+, 3.0.3+ |

## 写入操作

可以通过 INSERT 语句将数据写入到 Hive 表中。支持写入到由 Doris 创建的 Hive 表,或者 Hive 中已存在的且格式支持的表。
Expand Down Expand Up @@ -737,13 +748,6 @@ AS SELECT col1,pt1 as col2,pt2 as pt1 FROM test_ctas.part_ctas_src WHERE col1>0;

### 相关参数

* Session 变量

| 参数名称 | 描述 | 默认值 | 版本 |
| ----------| ---- | ---- | --- |
| `hive_parquet_use_column_names` | `true` | Doris 在读取 Hive 表 Parquet 数据类型时,默认会根据 Hive 表的列名从 Parquet 文件中找同名的列来读取数据。当该变量为 `false` 时,Doris 会根据 Hive 表中的列顺序从 Parquet 文件中读取数据,与列名无关。类似于 Hive 中的 `parquet.column.index.access` 变量。该参数只适用于顶层列名,对 Struct 内部无效。 | 2.1.6+, 3.0.3+ |
| `hive_orc_use_column_names` | `true` | 与 `hive_parquet_use_column_names` 类似,针对的是 Hive 表 ORC 数据类型。类似于 Hive 中的 `orc.force.positional.evolution` 变量。 | 2.1.6+, 3.0.3+ |

* BE 配置

| 参数名称 | 描述 | 默认值 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ CREATE CATALOG [IF NOT EXISTS] catalog_name PROPERTIES (

* `hive.ignore_absent_partitions`:是否忽略不存在的分区。默认为 `true`。如果设为 `false`,当遇到不存在的分区时,查询会报错。该参数自 3.0.2 版本支持。

* `hive.staging_dir`:用于设置 Hive 写操作的临时 staging 根目录。写入过程中数据会先写入该目录,写入完成后再移动到最终的 Hive 表目录。该路径可以是相对于 Hive 表根目录的相对路径,也可以是绝对路径。默认值为 `/tmp/.doris_staging`。某些情况下,写入 Hive 表时会遇到 `/tmp` 目录和表目录分属不同 namespace,导致无法写入的问题,此时可以通过修改此参数,使用相对路径解决该问题。该参数自 4.0.3 版本开始支持。

* `{CommonProperties}`

CommonProperties 部分用于填写通用属性。请参阅[ 数据目录概述 ](../catalog-overview.md)中【通用属性】部分。
Expand Down Expand Up @@ -154,6 +156,7 @@ CREATE CATALOG [IF NOT EXISTS] catalog_name PROPERTIES (
| varchar(N) | varchar(N) | |
| string | string | |
| binary | string/varbinary| 由 properties 中 `enable.mapping.varbinary` (4.0.2 后开始支持) 属性控制。默认为 `false`, 则映射到 `string`; 为 `true` 时,则映射到 `varbinary` 类型。|
| timestamp with local time zone| datetime/timestamptz | 由 properties 中 `enable.mapping.timestamp_tz` (4.0.3 后开始支持) 属性控制,默认为 `false`, 则映射到 `datetime`; 为 `true` 时,则映射到 `timestamptz` 类型 |
| array | array | |
| map | map | |
| struct | struct | |
Expand Down Expand Up @@ -675,6 +678,15 @@ Hive Transactional 表是 Hive 中支持 ACID 语义的表。详情可见 [Hive

* 部分 HiveQL 支持的函数可能和 Doris 支持的函数同名,但行为不一致,这可能导致最终结果和使用 Hive 查询的结果不一致。如果用户遇到此类问题,可以向社区反馈。

### 相关参数

* Session 变量

| 参数名称 | 描述 | 默认值 | 版本 |
| ----------| ---- | ---- | --- |
| `hive_parquet_use_column_names` | `true` | Doris 在读取 Hive 表 Parquet 数据类型时,默认会根据 Hive 表的列名从 Parquet 文件中找同名的列来读取数据。当该变量为 `false` 时,Doris 会根据 Hive 表中的列顺序从 Parquet 文件中读取数据,与列名无关。类似于 Hive 中的 `parquet.column.index.access` 变量。该参数只适用于顶层列名,对 Struct 内部无效。 | 2.1.6+, 3.0.3+ |
| `hive_orc_use_column_names` | `true` | 与 `hive_parquet_use_column_names` 类似,针对的是 Hive 表 ORC 数据类型。类似于 Hive 中的 `orc.force.positional.evolution` 变量。 | 2.1.6+, 3.0.3+ |

## 写入操作

可以通过 INSERT 语句将数据写入到 Hive 表中。支持写入到由 Doris 创建的 Hive 表,或者 Hive 中已存在的且格式支持的表。
Expand Down Expand Up @@ -736,13 +748,6 @@ AS SELECT col1,pt1 as col2,pt2 as pt1 FROM test_ctas.part_ctas_src WHERE col1>0;

### 相关参数

* Session 变量

| 参数名称 | 描述 | 默认值 | 版本 |
| ----------| ---- | ---- | --- |
| `hive_parquet_use_column_names` | `true` | Doris 在读取 Hive 表 Parquet 数据类型时,默认会根据 Hive 表的列名从 Parquet 文件中找同名的列来读取数据。当该变量为 `false` 时,Doris 会根据 Hive 表中的列顺序从 Parquet 文件中读取数据,与列名无关。类似于 Hive 中的 `parquet.column.index.access` 变量。该参数只适用于顶层列名,对 Struct 内部无效。 | 2.1.6+, 3.0.3+ |
| `hive_orc_use_column_names` | `true` | 与 `hive_parquet_use_column_names` 类似,针对的是 Hive 表 ORC 数据类型。类似于 Hive 中的 `orc.force.positional.evolution` 变量。 | 2.1.6+, 3.0.3+ |

* BE 配置

| 参数名称 | 描述 | 默认值 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ CREATE CATALOG [IF NOT EXISTS] catalog_name PROPERTIES (

* `hive.ignore_absent_partitions`:是否忽略不存在的分区。默认为 `true`。如果设为 `false`,当遇到不存在的分区时,查询会报错。该参数自 3.0.2 版本支持。

* `hive.staging_dir`:用于设置 Hive 写操作的临时 staging 根目录。写入过程中数据会先写入该目录,写入完成后再移动到最终的 Hive 表目录。该路径可以是相对于 Hive 表根目录的相对路径,也可以是绝对路径。默认值为 `/tmp/.doris_staging`。某些情况下,写入 Hive 表时会遇到 `/tmp` 目录和表目录分属不同 namespace,导致无法写入的问题,此时可以通过修改此参数,使用相对路径解决该问题。该参数自 4.0.3 版本开始支持。

* `{CommonProperties}`

CommonProperties 部分用于填写通用属性。请参阅[ 数据目录概述 ](../catalog-overview.md)中【通用属性】部分。
Expand Down Expand Up @@ -676,6 +678,15 @@ Hive Transactional 表是 Hive 中支持 ACID 语义的表。详情可见 [Hive

* 部分 HiveQL 支持的函数可能和 Doris 支持的函数同名,但行为不一致,这可能导致最终结果和使用 Hive 查询的结果不一致。如果用户遇到此类问题,可以向社区反馈。

### 相关参数

* Session 变量

| 参数名称 | 描述 | 默认值 | 版本 |
| ----------| ---- | ---- | --- |
| `hive_parquet_use_column_names` | `true` | Doris 在读取 Hive 表 Parquet 数据类型时,默认会根据 Hive 表的列名从 Parquet 文件中找同名的列来读取数据。当该变量为 `false` 时,Doris 会根据 Hive 表中的列顺序从 Parquet 文件中读取数据,与列名无关。类似于 Hive 中的 `parquet.column.index.access` 变量。该参数只适用于顶层列名,对 Struct 内部无效。 | 2.1.6+, 3.0.3+ |
| `hive_orc_use_column_names` | `true` | 与 `hive_parquet_use_column_names` 类似,针对的是 Hive 表 ORC 数据类型。类似于 Hive 中的 `orc.force.positional.evolution` 变量。 | 2.1.6+, 3.0.3+ |

## 写入操作

可以通过 INSERT 语句将数据写入到 Hive 表中。支持写入到由 Doris 创建的 Hive 表,或者 Hive 中已存在的且格式支持的表。
Expand Down Expand Up @@ -737,13 +748,6 @@ AS SELECT col1,pt1 as col2,pt2 as pt1 FROM test_ctas.part_ctas_src WHERE col1>0;

### 相关参数

* Session 变量

| 参数名称 | 描述 | 默认值 | 版本 |
| ----------| ---- | ---- | --- |
| `hive_parquet_use_column_names` | `true` | Doris 在读取 Hive 表 Parquet 数据类型时,默认会根据 Hive 表的列名从 Parquet 文件中找同名的列来读取数据。当该变量为 `false` 时,Doris 会根据 Hive 表中的列顺序从 Parquet 文件中读取数据,与列名无关。类似于 Hive 中的 `parquet.column.index.access` 变量。该参数只适用于顶层列名,对 Struct 内部无效。 | 2.1.6+, 3.0.3+ |
| `hive_orc_use_column_names` | `true` | 与 `hive_parquet_use_column_names` 类似,针对的是 Hive 表 ORC 数据类型。类似于 Hive 中的 `orc.force.positional.evolution` 变量。 | 2.1.6+, 3.0.3+ |

* BE 配置

| 参数名称 | 描述 | 默认值 |
Expand Down
Loading