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
4 changes: 1 addition & 3 deletions .github/workflows/addDocsToS3BucketAWS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ on:
- "scripts/sync-skill.mjs"
- "sidebars.ts"
- "docusaurus.config.ts"
- ".npmrc"
- "package.json"
- "pnpm-lock.yaml"
- "versions.json"
Expand Down Expand Up @@ -44,9 +45,6 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- run: pnpm install
- run: pnpm sync-skill
env:
DOC_LANG: zh
- run: pnpm build
env:
BIEL_PROJECT_ID: ${{ secrets.BIEL_PROJECT_ID }}
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/node-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,27 @@ jobs:
- run: pnpm install
- run: pnpm test
- run: pnpm run build

check-links:
name: Check ${{ matrix.doc-lang }} links
runs-on: ubuntu-latest

strategy:
matrix:
doc-lang: [en, zh]

steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 8.6.0
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: 'pnpm'
- run: pnpm install
- run: pnpm check:links
env:
DOC_LANG: ${{ matrix.doc-lang }}
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enable-pre-post-scripts=true
2 changes: 1 addition & 1 deletion docs/getting-started/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ CREATE TABLE app_logs (
) WITH ('append_mode'='true');
```

- `log_msg` enables [full-text index](/user-guide/manage-data/data-index.md#fulltext-index) for keyword search.
- `log_msg` enables [full-text index](/user-guide/manage-data/data-index.md#full-text-index) for keyword search.
- [`append_mode`](/user-guide/deployments-administration/performance-tuning/design-table.md#when-to-use-append-only-tables) optimizes for log workloads (no deduplication overhead).

### Traces table
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/http-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Endpoints that is not versioned (under `/v1`). For admin usage like health check
- **Description**: Provides a health check endpoint to verify that the server is running.
- **Usage**: Access this endpoint to check the health status of the server.

Please refer to the [check GreptimeDB health documentation](/enterprise/deployments-administration/monitoring/check-db-status.md#check-if-greptimedb-is-running-normally) for an example.
Please refer to the [check GreptimeDB health documentation](/user-guide/deployments-administration/monitoring/check-db-status.md#check-if-greptimedb-is-running-normally) for an example.

### Status

Expand All @@ -27,7 +27,7 @@ Please refer to the [check GreptimeDB health documentation](/enterprise/deployme
- **Description**: Retrieves the current status of the server.
- **Usage**: Use this endpoint to obtain server status information.

Please refer to the [Check GreptimeDB status documentation](/enterprise/deployments-administration/monitoring/check-db-status.md#check-greptimedb-status) for an example.
Please refer to the [Check GreptimeDB status documentation](/user-guide/deployments-administration/monitoring/check-db-status.md#check-greptimedb-runtime-status) for an example.

### Metrics

Expand Down
4 changes: 2 additions & 2 deletions docs/reference/pipeline/write-log-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Describes how to write logs to GreptimeDB using a pipeline via the

# APIs for Writing Logs

Before writing logs, please read the [Pipeline Configuration](/user-guide/logs/use-custom-pipelines.md#upload-pipeline) to complete the configuration setup and upload.
Before writing logs, please read the [Pipeline Configuration](/user-guide/logs/use-custom-pipelines.md#upload-the-pipeline) to complete the configuration setup and upload.

## HTTP API

Expand Down Expand Up @@ -157,4 +157,4 @@ The table is also set with a ttl of 1 day.

## Examples

Please refer to the "Writing Logs" section in the [Quick Start](/user-guide/logs/quick-start.md#direct-http-ingestion) and [Using Custom Pipelines](/user-guide/logs/use-custom-pipelines.md#write-logs) guide for examples.
Please refer to the "Writing Logs" section in the [Quick Start](/user-guide/logs/quick-start.md#direct-http-ingestion) and [Using Custom Pipelines](/user-guide/logs/use-custom-pipelines.md#ingest-logs-using-the-pipeline) guide for examples.
2 changes: 1 addition & 1 deletion docs/reference/sql/alter.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ You can specify the following options using `FULLTEXT INDEX WITH` when enabling
- `granularity`: (For `bloom` backend) The size of data chunks covered by each filter. A smaller granularity improves filtering but increases index size. Default is `10240`.
- `false_positive_rate`: (For `bloom` backend) The probability of misidentifying a block. A lower rate improves accuracy (better filtering) but increases index size. Value is a float between `0` and `1`. Default is `0.01`.

For more information on full-text index configuration and performance comparison, refer to the [Full-Text Index Configuration Guide](/user-guide/manage-data/data-index.md#fulltext-index).
For more information on full-text index configuration and performance comparison, refer to the [Full-Text Index Configuration Guide](/user-guide/manage-data/data-index.md#full-text-index).

If `WITH <options>` is not specified, `FULLTEXT INDEX` will use the default values.

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/sql/case.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The `CASE` statement can be used in various clauses, such as `SELECT`, `WHERE`,
### Use `CASE` in `SELECT`

In the `SELECT` clause, you can use the `CASE` statement to create new columns based on conditions.
please see [the example](/user-guide/query-data/sql.md#case) in the query data guide.
please see [the example](/user-guide/query-data/sql.md#case-expression) in the query data guide.

You can also use `CASE` with functions like `SUM` to conditionally aggregate data.
for example, you can calculate the total number of logs with status 200 and 404:
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/sql/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ GreptimeDB supports a subset of ANSI SQL and has some unique extensions. Some ma
2. Insert data: Consistent with ANSI SQL syntax, but requires the `TIME INDEX` column value (or default value) to be provided.
3. Update data: Does not support `UPDATE` syntax, but if the primary key and `TIME INDEX` corresponding column values are the same during `INSERT`, subsequent inserted rows will overwrite previously written rows, effectively achieving an update.
* Since 0.8, GreptimeDB supports [append mode](/reference/sql/create.md#create-an-append-only-table) that creates an append-only table with `append_mode="true"` option which keeps duplicate rows.
* GreptimeDB supports [merge mode](/reference/sql/create.md#create-an-append-only-table) that creates a table with `merge_mode="last_non_null"` option which allow updating a field partially.
* GreptimeDB supports [merge mode](/reference/sql/create.md#create-a-table-with-merge-mode) that creates a table with `merge_mode="last_non_null"` option which allow updating a field partially.
4. Query data: Query syntax is compatible with ANSI SQL, with some functional differences and omissions.
* Since v0.9.0, begins to support [VIEW](/user-guide/query-data/view.md).
* TQL syntax extension: Supports executing PromQL in SQL via TQL subcommands. Please refer to the [TQL](./tql.md) section for details.
* [Range Query](/reference/sql/range.md#range-query) to query and aggregate data within a range of time.
* [Range Query](/reference/sql/range.md) to query and aggregate data within a range of time.
5. Delete data: Deletion syntax is basically consistent with ANSI SQL.
6. Others:
* Identifiers such as table names and column names have constraints similar to ANSI SQL, are case sensitive, and require double quotes when encountering special characters or uppercase letters.
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/sql/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ CREATE [OR REPLACE] VIEW [ IF NOT EXISTS ] <view-name>
AS select_statement
```

For the statement to create or update a view, please read the [view user guide](/user-guide/query-data/view.md#view).
For the statement to create or update a view, please read the [view user guide](/user-guide/query-data/view.md).

## CREATE TRIGGER

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/sql/data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ Output:

### Query JSON data

You can query the JSON data directly or extract specific fields using [JSON functions](./functions/overview.md#json-functions) provided by GreptimeDB. Here's an example:
You can query the JSON data directly or extract specific fields using [JSON functions](./functions/json.md) provided by GreptimeDB. Here's an example:

```sql
SELECT json_get_string(my_json, '$.name') as name FROM json_data;
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/sql/group_by.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ FROM system_metrics
GROUP BY dt
```

Please refer to [date_trunc](./functions/overview.md#date_trunc) for more details.
Please refer to [date_trunc](./functions/df-functions.md#date_trunc) for more details.
2 changes: 1 addition & 1 deletion docs/user-guide/concepts/features-that-you-concern.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Yes. We offer [built-in functions](/reference/sql/functions/geo.md) for Geohash,

## Any JSON support?

See [JSON functions](/reference/sql/functions/overview.md#json-functions).
See [JSON functions](/reference/sql/functions/json.md).

## More Questions?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ SHOW INDEXES FROM monitor;
+---------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+-------------------------+---------+---------------+---------+------------+
```

For more info about `SHOW` statement, please read the [SHOW reference](/reference/sql/show.md#show).
For more info about `SHOW` statement, please read the [SHOW reference](/reference/sql/show.md).

## List Existing Tables

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ date: Sun, 26 Apr 2026 13:46:41 GMT

For more information about the health check endpoint, please refer to [the Health endpoint](/reference/http-endpoints.md#health-check).

## Check GreptimeDB status
## Check GreptimeDB status {#check-greptimedb-runtime-status}

You can use the `/status` endpoint to check the deployment status of GreptimeDB.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,10 @@ CREATE TABLE IF NOT EXISTS `raw_logs` (
```

The `message` field is full-text indexed using the `FULLTEXT INDEX` option.
See [fulltext column options](/reference/sql/create.md#fulltext-column-option) for more information.
See [fulltext column options](/reference/sql/create.md#index-column-option) for more information.

Storing and querying structured logs usually have better performance than unstructured logs with full-text index.
It's recommended to [use Pipeline](/user-guide/logs/quick-start.md#create-a-pipeline) to convert logs into structured logs.
It's recommended to [use Pipeline](/user-guide/logs/use-custom-pipelines.md#create-a-custom-pipeline) to convert logs into structured logs.


### When to use index
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/logs/use-custom-pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ SELECT * FROM custom_pipeline_logs WHERE status_code = 200 AND http_method = 'GE
### Full‑Text Search

For the text fields `request_line` and `user_agent`, you can use `matches_term` function to search logs.
Remember, we created the full-text index for these two columns when [creating a pipeline](#create-a-pipeline).
Remember, we created the full-text index for these two columns when [creating a pipeline](#create-a-custom-pipeline).
This allows for high-performance full-text searches.

For example, query the logs with `request_line` containing `/index.html` or `/api/login`.
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/manage-data/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Excessive updates may negatively impact query performance, even though the perfo
#### Update all fields in a table

By default, when updating data, all fields will be overwritten with the new values,
except for [InfluxDB line protocol](/user-guide/protocols/influxdb-line-protocol.md), which only [updates the specified fields](#overwrite-specific-fields-in-a-table).
except for [InfluxDB line protocol](/user-guide/protocols/influxdb-line-protocol.md), which only [updates the specified fields](#update-specific-fields-in-a-table).
The following example using SQL demonstrates the behavior of overwriting all fields in a table.

Assuming you have a table named `monitor` with the following schema.
Expand Down
10 changes: 8 additions & 2 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const greptimePrismDarkTheme = {

const locale = process.env.DOC_LANG || 'en';
const biel_project_id = process.env.BIEL_PROJECT_ID;
const isLinkCheck = process.env.DOCS_LINK_CHECK === 'true';

// Shared between docs preset and llms plugin to keep exclusions in sync
const docsExcludePatterns = [
Expand All @@ -53,6 +54,10 @@ const availableLocales = isVersioningCommand ? ['en', 'zh'] : [locale];
// Get the latest version (first item in versions array)
const latestVersion = versions[0];
const latestVersionNumber = parseFloat(latestVersion);
const linkCheckVersions = [
'current',
...versions.filter(version => Number.parseInt(version, 10) >= 1),
];

const metaMap = {
'en': [
Expand Down Expand Up @@ -210,8 +215,8 @@ const config: Config = {
projectName: 'docs', // Usually your repo name.

onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
onBrokenAnchors: "ignore",
onBrokenMarkdownLinks: isLinkCheck ? 'throw' : 'warn',
onBrokenAnchors: isLinkCheck ? 'throw' : 'ignore',
// Even if you don't use internationalization, you can use this field to set
// useful metadata like html lang. For example, if your site is Chinese, you
// may want to replace "en" with "zh-Hans".
Expand Down Expand Up @@ -240,6 +245,7 @@ const config: Config = {
routeBasePath: '/',
exclude: docsExcludePatterns,
showLastUpdateTime: true,
onlyIncludeVersions: isLinkCheck ? linkCheckVersions : undefined,
versions: {
current: {
label: 'Nightly',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ description: 介绍了 GreptimeDB 的预写日志(WAL)机制,包括其命

# 预写日志

<AnchorAlias id="introduction" />

## 介绍

我们的存储引擎受到了日志结构合并树(Log-structured Merge Tree,LSMT)的启发。对数据的变更操作直接应用于 MemTable 而不是持久化到磁盘上的数据页,这显著提高了性能,但也带来了持久化相关的问题,特别是在 Datanode 意外崩溃时。与所有类似 LSMT 的存储引擎一样,GreptimeDB 使用预写日志(Write-Ahead Log,WAL)来确保数据被可靠地持久化,并且保证崩溃时的数据完整性。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ description: 介绍 GreptimeDB 中表数据的分片方法,包括分区和 Reg

对于任何分布式数据库来说,数据的分片都是必不可少的。本文将描述 GreptimeDB 中的表数据如何进行分片。

<AnchorAlias id="partition" />

## 分区

有关创建分区表的语法,请参阅用户指南中的[表分片](/user-guide/deployments-administration/manage-data/table-sharding.md)部分。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ description: 介绍 Metasrv 中的 Selector,包括其类型和配置方法。

在 `Metasrv` 中存在一个特定的场景。当 `Frontend` 向 `Metasrv` 发送建表请求时,`Metasrv` 会创建一个路由表(表的创建细节不在这里赘述)。在创建路由表时,`Metasrv` 需要选择适当的 `Datanode`s,这时候就需要用到 `Selector`。

<AnchorAlias id="selector-type" />

## Selector 类型

`Metasrv` 目前提供以下几种类型的 `Selectors`:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ SHOW CREATE TABLE measurement_name;

<InjectContent id="get-database-connection-information" content={props.children}/>

<AnchorAlias id="write-data" />

## 写入数据

GreptimeDB 兼容 InfluxDB 的行协议格式,包括 v1 和 v2。
Expand All @@ -54,6 +56,8 @@ GreptimeDB 支持 InfluxDB 行协议也意味着 GreptimeDB 与 Telegraf 兼容

<InjectContent id="write-data-telegraf" content={props.children}/>

<AnchorAlias id="client-libraries" />

### 客户端库

使用 InfluxDB 客户端库写入数据到 GreptimeDB 非常直接且简单。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ greptime cli meta put table route [OPTIONS]
| `--catalog-name <CATALOG_NAME>` | 所属 catalog 的名称 | greptime |
| `--value-stdin` | 从标准输入读取 JSON 编码的 `TableRouteValue`(必填) | - |

<AnchorAlias id="delete-key-value-pair" />

## 删除键值对

### 命令语法
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ description: 介绍 GreptimeDB 中各种 HTTP 路径及其用法的完整列表
- **描述**: 提供一个健康检查端点以验证服务器是否正在运行。
- **用法**: 访问此端点以检查服务器的健康状态。

请参考[检查 GreptimeDB 健康状态文档](/enterprise/deployments-administration/monitoring/check-db-status.md#查看-greptimedb-是否正常运行)获取示例。
请参考[检查 GreptimeDB 健康状态文档](/user-guide/deployments-administration/monitoring/check-db-status.md#check-if-greptimedb-is-running-normally)获取示例。

### 状态

Expand All @@ -27,7 +27,7 @@ description: 介绍 GreptimeDB 中各种 HTTP 路径及其用法的完整列表
- **描述**: 检索服务器的当前状态。
- **用法**: 使用此端点获取服务器状态信息。

请参考[检查 GreptimeDB 状态文档](/enterprise/deployments-administration/monitoring/check-db-status.md#查看-greptimedb-的部署状态)获取示例。
请参考[检查 GreptimeDB 状态文档](/user-guide/deployments-administration/monitoring/check-db-status.md#check-greptimedb-runtime-status)获取示例。

### 指标

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,8 @@ Transform 由一个或多个配置组成,每个配置包含以下字段:
- `on_failure`(可选): 转换失败时的处理方式
- `default`(可选): 默认值

<AnchorAlias id="transform-in-version-2" />

### 版本 2 中的 Transform

在最初的 pipeline 版本中,你需要在 transform 中手动指定所有的字段,来将它们持久化到数据库中。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ GreptimeDB 使用 SQL 作为主要查询语言,并支持许多流行的 SQL
}
```

如果你正在使用 [高层级 API](/user-guide/ingest-data/for-iot/grpc-sdks/go.md#高层级-api) 来插入数据,你可以在模型中同时声明 GORM 和 GreptimeDB Tag。
如果你正在使用 [高层级 API](/user-guide/ingest-data/for-iot/grpc-sdks/go.md#high-level-api) 来插入数据,你可以在模型中同时声明 GORM 和 GreptimeDB Tag。

```go
type CpuMetric struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ ALTER TABLE monitor MODIFY COLUMN load_15 DROP DEFAULT;

删除默认值后,该列将使用 `NULL` 作为默认值。数据库只允许对可为空的列删除默认值。

<AnchorAlias id="alter-table-options" />

### 修改表的参数

`ALTER TABLE` 语句也可以用来更改表的选项。
Expand Down Expand Up @@ -311,6 +313,8 @@ ALTER TABLE sensor_readings SPLIT PARTITION (
必须开启共享对象存储和 GC,并确保所有 datanode 都能访问同一对象存储后再执行这些语句。
:::

<AnchorAlias id="create-an-index-for-a-column" />

### 创建列的索引

在列上启用倒排索引:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ END
### 在 `SELECT` 中使用 `CASE`

在 `SELECT` 子句中,你可以使用 `CASE` 语句根据条件创建新列。
请参阅查询数据指南中的[示例](/user-guide/query-data/sql.md#case)。
请参阅查询数据指南中的[示例](/user-guide/query-data/sql.md#case-expression)。

你还可以将 `CASE` 与 `SUM` 等函数一起使用,以有条件地聚合数据。
例如,你可以计算状态码为 200 和 404 的日志总数:
Expand Down
Loading
Loading