Skip to content

Commit 27c6138

Browse files
committed
fix: format
1 parent 8f6b05a commit 27c6138

File tree

8 files changed

+47
-49
lines changed

8 files changed

+47
-49
lines changed

docs/cn/developer/00-drivers/02-nodejs.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
```
21
---
32
title: Node.js
43
---
@@ -58,15 +57,15 @@ Node.js 驱动程序提供与 Rust Driver 绑定类似的功能,具有相同
5857

5958
下表总结了 Node.js Driver 的主要行为和函数及其用途:
6059

61-
| 函数名称 | 描述 |
62-
| -------------- | -------------------------------------------------------------------------------------------------------------------------- |
63-
| `info` | 返回客户端的连接信息。 |
64-
| `version` | 返回执行 `SELECT VERSION()` 语句的结果。 |
65-
| `exec` | 执行 SQL 语句并返回受影响的行数。 |
66-
| `query_iter` | 执行 SQL 查询并返回一个迭代器,用于逐行处理结果。 |
67-
| `query_iter_ext` | 执行 SQL 查询并返回一个迭代器,其中包含有关结果的统计信息。 |
68-
| `query_row` | 执行 SQL 查询并返回单个行结果。 |
69-
| `stream_load` | 将数据上传到内置的 Stage 并使用 [stage attachment](/developer/apis/http#stage-attachment) 执行插入/替换。 |
60+
| 函数名称 | 描述 |
61+
| ---------------- | --------------------------------------------------------------------------------------------------------- |
62+
| `info` | 返回客户端的连接信息。 |
63+
| `version` | 返回执行 `SELECT VERSION()` 语句的结果。 |
64+
| `exec` | 执行 SQL 语句并返回受影响的行数。 |
65+
| `query_iter` | 执行 SQL 查询并返回一个迭代器,用于逐行处理结果。 |
66+
| `query_iter_ext` | 执行 SQL 查询并返回一个迭代器,其中包含有关结果的统计信息。 |
67+
| `query_row` | 执行 SQL 查询并返回单个行结果。 |
68+
| `stream_load` | 将数据上传到内置的 Stage 并使用 [stage attachment](/developer/apis/http#stage-attachment) 执行插入/替换。 |
7069

7170
## 教程 1:使用 Node.js 与 Databend 集成
7271

@@ -96,7 +95,9 @@ const { Client } = require("databend-driver");
9695

9796
// Connecting to a local Databend with a SQL user named 'user1' and password 'abc123' as an example.
9897
// Feel free to use your own values while maintaining the same format.
99-
const dsn = process.env.DATABEND_DSN ? process.env.DATABEND_DSN : "databend://user1:abc123@localhost:8000/default?sslmode=disable";
98+
const dsn = process.env.DATABEND_DSN
99+
? process.env.DATABEND_DSN
100+
: "databend://user1:abc123@localhost:8000/default?sslmode=disable";
100101

101102
async function create_conn() {
102103
this.client = new Client(dsn);
@@ -113,11 +114,13 @@ async function select_books() {
113114
await this.conn.exec(sql);
114115
console.log("Database used");
115116

116-
var sql = "CREATE TABLE IF NOT EXISTS books(title VARCHAR, author VARCHAR, date VARCHAR)";
117+
var sql =
118+
"CREATE TABLE IF NOT EXISTS books(title VARCHAR, author VARCHAR, date VARCHAR)";
117119
await this.conn.exec(sql);
118120
console.log("Table created");
119121

120-
var sql = "INSERT INTO books VALUES('Readings in Database Systems', 'Michael Stonebraker', '2004')";
122+
var sql =
123+
"INSERT INTO books VALUES('Readings in Database Systems', 'Michael Stonebraker', '2004')";
121124
await this.conn.exec(sql);
122125
console.log("1 record inserted");
123126

@@ -132,7 +135,7 @@ async function select_books() {
132135
console.log(ret);
133136
}
134137

135-
create_conn().then(conn => {
138+
create_conn().then((conn) => {
136139
select_books();
137140
});
138141
```
@@ -192,7 +195,9 @@ $ npm install --save databend-driver
192195
```javascript
193196
const { Client } = require("databend-driver");
194197

195-
const dsn = process.env.DATABEND_DSN ? process.env.DATABEND_DSN : "databend://{USER}:{PASSWORD}@${HOST}:443/{DATABASE}?&warehouse={WAREHOUSE_NAME}";
198+
const dsn = process.env.DATABEND_DSN
199+
? process.env.DATABEND_DSN
200+
: "databend://{USER}:{PASSWORD}@${HOST}:443/{DATABASE}?&warehouse={WAREHOUSE_NAME}";
196201

197202
async function create_conn() {
198203
this.client = new Client(dsn);
@@ -212,7 +217,8 @@ async function select_data() {
212217

213218
await this.conn.exec(sql_table_create);
214219

215-
let sql_insert = "INSERT INTO data VALUES ('1234', '2345', '3.1415', 'test', 'test2', '2021-01-01', '2021-01-01 00:00:00');";
220+
let sql_insert =
221+
"INSERT INTO data VALUES ('1234', '2345', '3.1415', 'test', 'test2', '2021-01-01', '2021-01-01 00:00:00');";
216222
await this.conn.exec(sql_insert);
217223

218224
let sql_select = "SELECT * FROM data";
@@ -226,7 +232,7 @@ async function select_data() {
226232
console.log(ret);
227233
}
228234

229-
create_conn().then(conn => {
235+
create_conn().then((conn) => {
230236
select_data();
231237
});
232238
```
@@ -241,4 +247,4 @@ create_conn().then(conn => {
241247

242248
```shell
243249
$ npm run run-example
244-
```
250+
```

docs/cn/guides/10-deploy/01-deploy/02-production/10-metasrv-deploy.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
```
21
---
32
title: Deploying Databend Cluster
43
sidebar_label: Deploying Databend Cluster
@@ -217,7 +216,6 @@ cd .. && cd bin
217216

218217
使用 [BendSQL](/guides/sql-clients/bendsql/) 连接到其中一个 query 节点,并检索有关现有 query 节点的信息:
219218

220-
221219
```shell
222220
bendsql -h 172.16.125.131
223221
Welcome to BendSQL 0.16.0-homebrew.
@@ -245,4 +243,4 @@ FROM
245243
在部署 Databend 之后,您可能需要了解以下主题:
246244

247245
- [加载和卸载数据](/guides/load-data):管理 Databend 中的数据导入/导出。
248-
- [可视化](/guides/visualize):将 Databend 与可视化工具集成以获得深入见解。
246+
- [可视化](/guides/visualize):将 Databend 与可视化工具集成以获得深入见解。
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
title: '使用 Node.js 连接 Databend'
3-
sidebar_label: 'Node.js'
2+
title: "使用 Node.js 连接 Databend"
3+
sidebar_label: "Node.js"
44
---
55

66
import ComponentContent from '../../../developer/00-drivers/02-nodejs.md';
77

8-
<ComponentContent />
8+
<ComponentContent />

docs/cn/guides/90-community/00-contributor/02-how-to-write-scalar-functions.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
```
21
---
32
title: 如何编写标量函数
43
sidebar_label: 如何编写标量函数
@@ -96,12 +95,12 @@ pub struct FunctionRegistry {
9695
此外,根据所需的功能,有不同级别的注册 api。
9796

9897
| | 自动向量化 | 访问输出列构建器 | 自动 Null 传递 | 自动合并 Null | 自动向下转换 | 抛出运行时错误 | 变长参数 | 元组 |
99-
| ----------------------------------- | ------------------ | ---------------------------- | --------------------- | ----------------- | ------------- | ------------------- | -------- | ----- |
100-
| register_n_arg | ✔️ | | ✔️ | | ✔️ | ✔️ || |
101-
| register_passthrough_nullable_n_arg | | ✔️ | ✔️ | | ✔️ | ✔️ || |
102-
| register_combine_nullable_n_arg | | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ || |
103-
| register_n_arg_core | | ✔️ | | | ✔️ | ✔️ || |
104-
| register_function_factory | | ✔️ | | | | ✔️ | ✔️ | ✔️ |
98+
| ----------------------------------- | ---------- | ---------------- | -------------- | ------------- | ------------ | -------------- | -------- | ---- |
99+
| register_n_arg | ✔️ || ✔️ || ✔️ | ✔️ |||
100+
| register_passthrough_nullable_n_arg || ✔️ | ✔️ || ✔️ | ✔️ |||
101+
| register_combine_nullable_n_arg || ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |||
102+
| register_n_arg_core || ✔️ ||| ✔️ | ✔️ |||
103+
| register_function_factory || ✔️ |||| ✔️ | ✔️ | ✔️ |
105104

106105
## 函数组合
107106

@@ -246,4 +245,4 @@ registry.register_passthrough_nullable_2_arg::<StringType, StringType, BooleanTy
246245

247246
### 逻辑测试
248247

249-
函数的逻辑测试位于 [02_function](https://github.com/databendlabs/databend/tree/d5e06af03ba0f99afdd6bdc974bf2f5c1c022db8/tests/sqllogictests/suites/query/02_function) 中。
248+
函数的逻辑测试位于 [02_function](https://github.com/databendlabs/databend/tree/d5e06af03ba0f99afdd6bdc974bf2f5c1c022db8/tests/sqllogictests/suites/query/02_function) 中。

docs/cn/guides/90-community/02-rfcs/20210914-new-sql-planner-framework.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
```
21
---
32
title: 新的 SQL Planner 框架设计
43
description: 新的 SQL planner 框架设计 RFC
54
---
65

7-
- 开始日期: 2021/09/13
6+
- 开始日期2021/09/13
87
- 追踪 issue: https://github.com/databendlabs/databend/issues/1217
98

109
# 概要
@@ -334,7 +333,6 @@ trait Rule {
334333
# 里程碑
335334

336335
在此重构之后,我们希望:
337-
```
338336

339337
-`JOIN` 提供朴素实现(等值连接使用哈希连接,交叉连接使用嵌套循环连接),包括计划和执行
340338
- 支持使用 `databend` 运行 TPCH 基准测试中的大多数查询(包含不同类型的连接和相关子查询)

docs/cn/guides/90-community/02-rfcs/20220304-semi-structured-data-types.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
```
21
---
32
title: 半结构化数据类型
4-
description:
5-
半结构化数据类型设计 RFC
3+
description: 半结构化数据类型设计 RFC
64
---
75

86
## 概要
97

108
### 当前 `DataType` 的不足
119

12-
1310
- `DataType` 是一个枚举类型,我们必须在使用前进行类型匹配。例如,如果我们想通过 `DataType` 创建反序列化器/序列化器,我们总是需要进行匹配。这并不意味着匹配是不必要的。如果我们想向 `DataType` 添加越来越多的函数,匹配可能会非常繁琐。
1411

1512
- `DataType` 表示为枚举类型,我们不能将其用作泛型参数。
@@ -21,6 +18,7 @@ description:
2118
### 关于列的太多概念 (Series/Column/Array)
2219

2320
- DataColumn 是一个枚举,包括 `Constant(value)``Array(Series)`
21+
2422
```rust
2523
pub enum DataColumn {
2624
// Array of values.
@@ -31,6 +29,7 @@ pub enum DataColumn {
3129
```
3230

3331
- Series 是 `SeriesTrait` 的一个包装器
32+
3433
```rust
3534
pub struct Series(pub Arc<dyn SeriesTrait>);
3635
```
@@ -170,4 +169,3 @@ type JsonColumn = ObjectColumn<serde_json::Value>;
170169
## TODO
171170

172171
- 使用更好的存储格式来提高查询性能
173-
```

docs/cn/guides/90-community/02-rfcs/20220725-cache.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
```
21
---
32
title: 缓存
43
description: Databend Query 的缓存
@@ -144,4 +143,3 @@ pub fn get_cache_operator(&self) -> Operator {
144143
### OpenCache
145144

146145
[OpenCache](https://github.com/databendlabs/opencache) 是 databend 社区正在进行的一项工作,旨在构建分布式缓存服务。Apache OpenDAL 将在其 API 稳定后实现对 `OpenCache` 的原生支持。之后,用户可以部署和使用 OpenCache 作为 `cache` 存储。
147-
```

docs/cn/sql-reference/10-sql-commands/20-query-syntax/01-query-select.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
```
21
---
32
title: SELECT
43
---
4+
55
import FunctionDescription from '@site/src/components/FunctionDescription';
66

77
<FunctionDescription description="Introduced or updated: v1.2.690"/>
@@ -17,13 +17,13 @@ import DetailsWrap from '@site/src/components/DetailsWrap';
1717
SELECT
1818
[ALL | DISTINCT]
1919
[ TOP <n> ]
20-
<select_expr> | <col_name> [[AS] <alias>] | $<col_position> [, ...] | *
20+
<select_expr> | <col_name> [[AS] <alias>] | $<col_position> [, ...] | *
2121
COLUMNS <expr>
2222
[EXCLUDE (<col_name1> [, <col_name2>, <col_name3>, ...] ) ]
2323
[FROM table_references]
2424
[AT ...]
2525
[WHERE <expr>]
26-
[GROUP BY {{<col_name> | <expr> | <col_alias> | <col_position>},
26+
[GROUP BY {{<col_name> | <expr> | <col_alias> | <col_position>},
2727
... | <extended_grouping_expr>}]
2828
[HAVING <expr>]
2929
[ORDER BY {<col_name> | <expr> | <col_alias> | <col_position>} [ASC | DESC],
@@ -32,6 +32,7 @@ SELECT
3232
[OFFSET <row_count>]
3333
[IGNORE_RESULT]
3434
```
35+
3536
- SELECT 语句还允许您直接查询 Stage 文件。有关语法和示例,请参见 [使用 Databend 进行高效数据转换](/guides/load-data/transform/querying-stage)
3637

3738
- 在此页面上的示例中,表 `numbers(N)` 用于测试,它具有一个 UInt64 类型的单列(名为 `number`),其中包含从 0 到 N-1 的整数。
@@ -44,7 +45,7 @@ SELECT
4445

4546
- Databend 建议在创建列别名时尽可能避免特殊字符。但是,如果某些情况下必须使用特殊字符,则应将别名用反引号括起来,例如:SELECT price AS \`$CA\` FROM ...
4647

47-
- Databend 会自动将别名转换为小写。例如,如果您将列别名为 *Total*,它将在结果中显示为 *total*。如果大小写对您很重要,请将别名用反引号括起来:\`Total\`
48+
- Databend 会自动将别名转换为小写。例如,如果您将列别名为 _Total_,它将在结果中显示为 _total_。如果大小写对您很重要,请将别名用反引号括起来:\`Total\`
4849

4950
```sql
5051
SELECT number AS Total FROM numbers(3);
@@ -316,8 +317,8 @@ SELECT number%2 as c1, number%3 as c2, MAX(number) FROM numbers(10000) GROUP BY
316317

317318
```sql
318319
SELECT
319-
number % 2 as c1,
320-
number % 3 as c2,
320+
number % 2 as c1,
321+
number % 3 as c2,
321322
MAX(number) as max
322323
FROM
323324
numbers(10000)
@@ -533,4 +534,4 @@ SELECT MIN(number) FROM (SELECT number%3 AS number FROM numbers(10)) GROUP BY nu
533534
| 1 |
534535
| 0 |
535536
+-------------+
536-
```
537+
```

0 commit comments

Comments
 (0)