# GreptimeDB 社区喜迎 3 位独立 Committer | Greptime 双周精选

Source: https://greptime.cn/blogs/2024-07-03-biweekly

## 内容概述

作为一个成长中的开源项目，GreptimeDB 的进展离不开来自全球的社区贡献者们，感谢各位！

最近的内容更新如下：
- **显示 database 的配置项**：增加了一些 SQL 语句来显示每个 database 的配置项（例如 "TTL"）

- **支持缩写的 interval 表达式**：interval 表达式现在添加了缩写的版本（例如 "year" 可以缩写为 "y"）

- **DBeaver 能够连接 GreptimeDB**：DBeaver 是一个常用的数据库工具，现在可以连接 GreptimeDB 使用

## 社区贡献者名单

在过去的两周里，GreptimeDB 共合并了 78 个 PR，其中有 3 位独立贡献者，累计 5 个 PR 被成功合并，还有很多待合并的 PR。

祝贺以下各位在过去 2 周内成为我们活跃的贡献者：

- @[CookiePieWw](https://github.com/CookiePieWw) ([db#4125](https://github.com/GreptimeTeam/greptimedb/pull/4125))

- @[etolbakov](https://github.com/etolbakov) ([db#4220](https://github.com/GreptimeTeam/greptimedb/pull/4220) [#4200](https://github.com/GreptimeTeam/greptimedb/pull/4200) [db#4182](https://github.com/GreptimeTeam/greptimedb/pull/4182))

- @[realtaobo](https://github.com/realtaobo) ([db#4190](https://github.com/GreptimeTeam/greptimedb/pull/4190))

👏 感谢各位独立贡献者持续提交并合并了多个 PR，还有更多来自其他独立贡献者的 PR 正在等待合并。

🎉 热烈欢迎 @[CookiePieWw](https://github.com/CookiePieWw)，@[irenjj](https://github.com/irenjj) 和 @[KKould](https://github.com/KKould) 三位独立贡献者正式作为新的 Committer 入驻社区，感谢你们付出的努力。

<img src="/zh/blogs/2024-07-03-biweekly/committerpost.webp" alt="Committer of GreptimeDB" style="width: 80%; margin: 0 auto"/>

@[CookiePieWw](https://github.com/CookiePieWw) 从 2024 年 4 月以来源源不断地给我们提交并合并了 11 个有效的 PR，还有更多的 PR 正在等待合并，符合我们的 Committer 晋升标准；@[irenjj](https://github.com/irenjj) 为社区贡献了 8 个 PR，为表管理和 FLOW 任务管理方面做出了重要贡献；@[KKould](https://github.com/KKould) 为社区贡献了 5 个 PR，实现了富有挑战的表创建和列类型变更等功能。

鉴于三位独立贡献者的 PR 质量和有效付出，社区内部投票通过晋升为新的 Committer，期待你们在社区的更多贡献！

截止目前 GreptimeDB 社区的 Committer 名单如下（按首字母顺序排序）：

- @[CookiePieWw](https://github.com/CookiePieWw)

- @[etolbakov](https://github.com/etolbakov)

- @[irenjj](https://github.com/irenjj)

- @[KKould](https://github.com/KKould)

- @[NiwakaDev](https://github.com/NiwakaDev)

同时衷心感谢我们所有的成员和贡献者，是你们的付出让我们的项目得以成功，也是你们让 GreptimeDB 成为一个更优质的产品。让我们一起努力，建立一个更棒的社区！

## PR 亮点
### [db#4172](https://github.com/GreptimeTeam/greptimedb/pull/4172) 基于 Region Migration 重新实现 Region Failover

GreptimeDB 之前实现的Region Failover 有一些问题。比如 Failover 并没有和 Remote WAL 联系起来，导致可能的数据丢失。所以我们决定基于Region Migration 来重新实现 Failover 以解决这些问题。你可以在 [db#4161](https://github.com/GreptimeTeam/greptimedb/pull/4161) 这个 issue 跟踪实现进度。

### [db#4174](https://github.com/GreptimeTeam/greptimedb/pull/4174) 显示 database 的配置项

GreptimeDB 的 database 可以有一些比如"TTL"的配置项。在这个 PR 里，我们支持使用 SQL "SHOW FULL DATABASES"来显示每个 database 的配置项，例如：

```sql
mysql> show full databases;
+--------------------+--------------+
| Database           | Options      |
+--------------------+--------------+
| greptime_private   |              |
| hertzbeat          | ttl='30days' |
| information_schema |              |
| public             |              |
+--------------------+--------------+
```

通过查询 `information_schemas` 也可以显示每个 database 的配置项：

```sql
mysql> select schema_name, options from information_schema.schemata;
+--------------------+--------------+
| schema_name        | options      |
+--------------------+--------------+
| greptime_private   |              |
| hertzbeat          | ttl='30days' |
| information_schema |              |
| public             |              |
+--------------------+--------------+
```

### [db#4178](https://github.com/GreptimeTeam/greptimedb/pull/4178) 优化 http 输出性能，节省最多 70% 的 CPU

该 PR 通过优化 `RecordBatch` 转换 `HttpRecordsOutput` 的过程，比如改为列优先遍历和消除一些不必要的 clone 等，将 CPU 的耗时最多节省了 70%。

### [db#4182](https://github.com/GreptimeTeam/greptimedb/pull/4182) [db#4220](https://github.com/GreptimeTeam/greptimedb/pull/4220) 支持 interval 表达式的缩写

该 PR 支持缩写的 interval 表达式，比如用"y"代表"year"。其他的缩写有：

- `m` for minutes
- `s` for seconds
- `w` for weeks
- `d` for days

在 interval 表达式中可以进行混用，例如：

```sql
SELECT INTERVAL '7 days' - INTERVAL '1d';

+----------------------------------------------------------------------------------------------+
| IntervalMonthDayNano("129127208515966861312") - IntervalMonthDayNano("18446744073709551616") |
+----------------------------------------------------------------------------------------------+
| 0 years 0 mons 6 days 0 hours 0 mins 0.000000000 secs                                        |
+----------------------------------------------------------------------------------------------+
```

转换缩写为 interval 表达式也是支持的：

```sql
SELECT '3y2mon'::INTERVAL;

+---------------------------------------------------------+
| IntervalMonthDayNano("3010670175542044828554670112768") |
+---------------------------------------------------------+
| 0 years 38 mons 0 days 0 hours 0 mins 0.000000000 secs  |
+---------------------------------------------------------+
```

### [db#4218](https://github.com/GreptimeTeam/greptimedb/pull/4218) 使 DBeaver 能够连接 GreptimeDB

DBeaver 在连接数据库时可能发送一些特殊的语句。之前 GreptimeDB 并没有完全支持这些特殊语句，导致 DBeaver 在连接 GreptimeDB 时可能报出一些问题。这个 PR 尝试解决这些问题，让 DBeaver 用户可以正常连接 GreptimeDB。

## Good First Issue

### [db#3884 从 query crate 中删除不必要的 traits 和 wrapper types](https://github.com/GreptimeTeam/greptimedb/issues/3884)

在 GreptimeDB 中，查询的大部分实现通过直接使用 Datafusion。在 GreptimeDB 没有支持其他查询引擎计划的前提下，一些额外的 traits 和 wrapper types 可以被删除。

关键词：查询，DataFusion

难度：简单

## 关于 Greptime

[Greptime 格睿科技](https://greptime.cn/)专注于为可观测、物联网及车联网等领域提供实时、高效的数据存储和分析服务，帮助客户挖掘数据的深层价值。目前基于云原生的时序数据库 [GreptimeDB](https://github.com/GreptimeTeam/greptimedb) 已经衍生出多款适合不同用户的解决方案，更多信息或 demo 展示请联系下方小助手（微信号：greptime）。

欢迎对开源感兴趣的朋友们参与贡献和讨论，从带有 good first issue 标签的 issue 开始你的开源之旅吧～期待在开源社群里遇见你！添加小助手微信即可加入“技术交流群”与志同道合的朋友们面对面交流哦~

Star us on GitHub Now: https://github.com/GreptimeTeam/greptimedb

官网：https://greptime.cn/

文档：https://docs.greptime.cn/

Twitter: https://twitter.com/Greptime

Slack: https://greptime.com/slack

LinkedIn: https://www.linkedin.com/company/greptime/
