Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc] Fix plugin related documentation #1911

Merged
merged 6 commits into from
Feb 6, 2025
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
52 changes: 30 additions & 22 deletions docs/sql-manual/sql-statements/plugin/INSTALL-PLUGIN.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,55 +25,63 @@ under the License.
-->



## Description

This statement is used to install a plugin.
This statement is used to install a plug-in

grammar:
## Syntax

```sql
INSTALL PLUGIN FROM [source] [PROPERTIES ("key"="value", ...)]
INSTALL PLUGIN FROM <source> [PROPERTIES ("<key>"="<value>", ...)]
```

source supports three types:
## Required parameters

** 1. `<source>`**
> The plugin path to be installed, supports three types:
> 1. An absolute path to a zip file
> 2. An absolute path to a plugin directory
> 3. Points to a zip file download path with http or https protocol

## Optional parameters

** 1. `[PROPERTIES ("<key>"="<value>", ...)]`**
> Used to specify properties or parameters when installing a plug-in

## Permission Control

The user executing this SQL command must have at least the following permissions:

| Permissions | Object | Notes |
|:-----------|:-----|:--------------|
| ADMIN_PRIV | The entire cluster | Requires administrative privileges for the entire cluster |

1. An absolute path to a zip file.
2. An absolute path to a plugin directory.
3. Point to a zip file download path with http or https protocol
## Precautions

Note that you need to place an md5 file with the same name as the .zip file, such as http://mywebsite.com/plugin.zip.md5 . The content is the MD5 value of the .zip file.

## Example

1. Install a local zip file plugin:
- Install a local zip file plugin:

```sql
INSTALL PLUGIN FROM "/home/users/doris/auditdemo.zip";
```

2. Install the plugin in a local directory:
- Install the plugin in a local directory:

```sql
INSTALL PLUGIN FROM "/home/users/doris/auditdemo/";
```

3. Download and install a plugin:
- Download and install a plugin:

```sql
INSTALL PLUGIN FROM "http://mywebsite.com/plugin.zip";
```

Note than an md5 file with the same name as the `.zip` file needs to be placed, such as `http://mywebsite.com/plugin.zip.md5` .
The content is the MD5 value of the .zip file.

4. Download and install a plugin, and set the md5sum value of the zip file at the same time:
- Download and install a plugin, and set the md5sum value of the zip file:

```sql
INSTALL PLUGIN FROM "http://mywebsite.com/plugin.zip" PROPERTIES("md5sum" = "73877f6029216f4314d712086a146570");
```

## Keywords

INSTALL, PLUGIN

## Best Practice

44 changes: 33 additions & 11 deletions docs/sql-manual/sql-statements/plugin/SHOW-PLUGINS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,49 @@ under the License.

## Description

This statement is used to display installed plugins
This statement is used to display installed plug-ins

grammar:
## Syntax

```SQL
```sql
SHOW PLUGINS
```

This command will display all user-installed and system built-in plugins
## Return Value

| Column | Description |
| ------ | ----------- |
| Description | Corresponding plug-in description |
| Version | Plug-in corresponding version number |
| JavaVersion | Corresponding Java version number |
| ClassName | Program class name |
| SoName | Program shared object name |
| Sources | Plugin Source |
| Status | Installation Status |
| Properties | Plugin Properties |

## Permission Control

The user executing this SQL command must have at least the following permissions:

| Permissions | Object | Notes |
|:-----------|:-----|:--------------|
| ADMIN_PRIV | The entire cluster | Requires administrative privileges for the entire cluster |

## Example

1. Show installed plugins:
- Show installed plugins:

```SQL
SHOW PLUGINS;
```

## Keywords

SHOW, PLUGINS

## Best Practice

```text
+-------------------------------+---------+-----------------------------------------------------------+---------+-------------+------------------------------------------------------------+--------+---------+-----------+------------+
| Name | Type | Description | Version | JavaVersion | ClassName | SoName | Sources | Status | Properties |
+-------------------------------+---------+-----------------------------------------------------------+---------+-------------+------------------------------------------------------------+--------+---------+-----------+------------+
| __builtin_AuditLoader | AUDIT | builtin audit loader, to load audit log to internal table | 2.1.0 | 1.8.31 | org.apache.doris.plugin.audit.AuditLoader | NULL | Builtin | INSTALLED | {} |
| __builtin_AuditLogBuilder | AUDIT | builtin audit logger | 0.12.0 | 1.8.31 | org.apache.doris.plugin.audit.AuditLogBuilder | NULL | Builtin | INSTALLED | {} |
| __builtin_SqlDialectConverter | DIALECT | builtin sql dialect converter | 2.1.0 | 1.8.31 | org.apache.doris.plugin.dialect.HttpDialectConverterPlugin | NULL | Builtin | INSTALLED | {} |
+-------------------------------+---------+-----------------------------------------------------------+---------+-------------+------------------------------------------------------------+--------+---------+-----------+------------+
```
30 changes: 18 additions & 12 deletions docs/sql-manual/sql-statements/plugin/UNINSTALL-PLUGIN.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,33 @@ under the License.

This statement is used to uninstall a plugin.

grammar:
## Syntax:

```sql
UNINSTALL PLUGIN plugin_name;
UNINSTALL PLUGIN <plugin_name>;
```

plugin_name can be viewed with the `SHOW PLUGINS;` command.
## Required parameters

Only non-builtin plugins can be uninstalled.
** 1. `<plugin_name>`**
> The name of the uninstalled plugin

## Example
## Permission Control

1. Uninstall a plugin:
The user executing this SQL command must have at least the following permissions:

```sql
UNINSTALL PLUGIN auditdemo;
```
| Permissions | Object | Notes |
|:-----------|:-----|:--------------|
| ADMIN_PRIV | The entire cluster | Requires administrative privileges for the entire cluster |

## Keywords
## Precautions

UNINSTALL, PLUGIN
Only non-builtin plugins can be uninstalled

## Best Practice
## Example

- To uninstall a plugin:

```sql
UNINSTALL PLUGIN auditdemo;
```
Original file line number Diff line number Diff line change
Expand Up @@ -25,55 +25,63 @@ under the License.
-->




## 描述

该语句用于安装一个插件
该语句用于安装一个插件

语法:
## 语法

```sql
INSTALL PLUGIN FROM [source] [PROPERTIES ("key"="value", ...)]
INSTALL PLUGIN FROM <source> [PROPERTIES ("<key>"="<value>", ...)]
```

source 支持三种类型:
## 必选参数

** 1. `<source>`**
> 待安装插件路径,支持三种类型:
> 1. 指向一个 zip 文件的绝对路径。
> 2. 指向一个插件目录的绝对路径。
> 3. 指向一个 http 或 https 协议的 zip 文件下载路径

## 可选参数

** 1. `[PROPERTIES ("<key>"="<value>", ...)]`**
> 用于指定安装插件时的属性或参数

## 权限控制

执行此 SQL 命令的用户必须至少具有以下权限:

| 权限 | 对象 | 说明 |
|:-----------|:-----|:--------------|
| ADMIN_PRIV | 整个集群 | 需要对整个集群具有管理权限 |

1. 指向一个 zip 文件的绝对路径。
2. 指向一个插件目录的绝对路径。
3. 指向一个 http 或 https 协议的 zip 文件下载路径
## 注意事项

注意需要放置一个和 .zip 文件同名的 md5 文件,如 http://mywebsite.com/plugin.zip.md5 。其中内容为 .zip 文件的 MD5 值。

## 示例

1. 安装一个本地 zip 文件插件:
- 安装一个本地 zip 文件插件:

```sql
INSTALL PLUGIN FROM "/home/users/doris/auditdemo.zip";
```

2. 安装一个本地目录中的插件:
- 安装一个本地目录中的插件:

```sql
INSTALL PLUGIN FROM "/home/users/doris/auditdemo/";
```

3. 下载并安装一个插件:
- 下载并安装一个插件:

```sql
INSTALL PLUGIN FROM "http://mywebsite.com/plugin.zip";
```

注意需要放置一个和 `.zip` 文件同名的 md5 文件,如 `http://mywebsite.com/plugin.zip.md5` 。其中内容为 .zip 文件的 MD5 值。

4. 下载并安装一个插件,同时设置了 zip 文件的 md5sum 的值:
- 下载并安装一个插件,同时设置了 zip 文件的 md5sum 的值:

```sql
INSTALL PLUGIN FROM "http://mywebsite.com/plugin.zip" PROPERTIES("md5sum" = "73877f6029216f4314d712086a146570");
```

## 关键词

INSTALL, PLUGIN

### 最佳实践

Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,51 @@ under the License.
-->





## 描述

该语句用于展示已安装的插件

语法:
## 语法

```SQL
```sql
SHOW PLUGINS
```

该命令会展示所有用户安装的和系统内置的插件
## 返回值

| 列 | 描述 |
| ------ |----|
| Description | 对应插件描述 |
| Version | 插件对应版本号 |
| JavaVersion | 对应 Java 版本号 |
| ClassName | 程序类名 |
| SoName | 程序共享对象名称 |
| Sources | 插件来源 |
| Status | 安装状态 |
| Properties | 插件属性 |

## 权限控制

执行此 SQL 命令的用户必须至少具有以下权限:

| 权限 | 对象 | 说明 |
|:-----------|:-----|:--------------|
| ADMIN_PRIV | 整个集群 | 需要对整个集群具有管理权限 |

## 示例

1. 展示已安装的插件:
- 展示已安装的插件:

```SQL
SHOW PLUGINS;
```

## 关键词

SHOW, PLUGINS

### 最佳实践

```text
+-------------------------------+---------+-----------------------------------------------------------+---------+-------------+------------------------------------------------------------+--------+---------+-----------+------------+
| Name | Type | Description | Version | JavaVersion | ClassName | SoName | Sources | Status | Properties |
+-------------------------------+---------+-----------------------------------------------------------+---------+-------------+------------------------------------------------------------+--------+---------+-----------+------------+
| __builtin_AuditLoader | AUDIT | builtin audit loader, to load audit log to internal table | 2.1.0 | 1.8.31 | org.apache.doris.plugin.audit.AuditLoader | NULL | Builtin | INSTALLED | {} |
| __builtin_AuditLogBuilder | AUDIT | builtin audit logger | 0.12.0 | 1.8.31 | org.apache.doris.plugin.audit.AuditLogBuilder | NULL | Builtin | INSTALLED | {} |
| __builtin_SqlDialectConverter | DIALECT | builtin sql dialect converter | 2.1.0 | 1.8.31 | org.apache.doris.plugin.dialect.HttpDialectConverterPlugin | NULL | Builtin | INSTALLED | {} |
+-------------------------------+---------+-----------------------------------------------------------+---------+-------------+------------------------------------------------------------+--------+---------+-----------+------------+
```
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,37 @@ under the License.
-->




## 描述

该语句用于卸载一个插件
该语句用于卸载一个插件

语法:
## 语法:

```sql
UNINSTALL PLUGIN plugin_name;
UNINSTALL PLUGIN <plugin_name>;
```

plugin_name 可以通过 `SHOW PLUGINS;` 命令查看。
## 必选参数

** 1. `<plugin_name>`**
> 卸载插件的名称

## 权限控制

执行此 SQL 命令的用户必须至少具有以下权限:

| 权限 | 对象 | 说明 |
|:-----------|:-----|:--------------|
| ADMIN_PRIV | 整个集群 | 需要对整个集群具有管理权限 |

## 注意事项

只能卸载非 builtin 的插件。

## 示例

1. 卸载一个插件:
- 卸载一个插件:

```sql
UNINSTALL PLUGIN auditdemo;
```

## 关键词

UNINSTALL, PLUGIN

### 最佳实践

Loading
Loading