# Greptime 双周精选 （6.19-7.2）｜GreptimeDB v0.3.2 正式发布！

Source: https://greptime.cn/blogs/2023-07-05-biweekly

## 内容概述

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

过去两周，我们所有项目中共有 **81** 个 PR 被合并，以下是这段时间较为重要的 PR 总结：

- 支持增量数据库备份

- 支持从 ORC 格式导入数据

- 支持 `blob` (binary) 类型

- 将所有可能的 filters 下推到 Parquet 执行计划

- 提高 Influxdb v2 API 的兼容性

## 社区贡献者名单

在过去的两周里，共有 **5 位贡献者**，累计 **7 个 PR 被成功合并**，还有很多待合并的 PR。

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

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

- @[etolbakov](https://github.com/etolbakov) ([db#1789](https://github.com/GreptimeTeam/greptimedb/pull/1789) [db#1826](https://github.com/GreptimeTeam/greptimedb/pull/1826) [dashboard#283](https://github.com/GreptimeTeam/dashboard/pull/283))

- @[NiwakaDev](https://github.com/NiwakaDev) ([docs#425](https://github.com/GreptimeTeam/docs/pull/425))

- @[sjcsjc123](https://github.com/sjcsjc123) ([gtctl#84](https://github.com/GreptimeTeam/gtctl/pull/84))

- @[sjmiller609](https://github.com/sjmiller609) ([parser#67](https://github.com/GreptimeTeam/promql-parser/pull/67))

👏 欢迎 @[sjcsjc123](https://github.com/sjcsjc123) 和 @[sjmiller609](https://github.com/sjmiller609) 作为新的贡献者加入到我们的社区，并都成功合并了首个 PR！

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

## PR 亮点

### [db#1240](https://github.com/GreptimeTeam/greptimedb/pull/1240) 支持增量数据库备份

我们现在支持了 `COPY DATABASE` 功能，允许增量数据库备份。你可以使用下面的 SQL 语句将整个数据库备份到一个目标目录：

```rust
COPY DATABASE greptime.public TO '<BACKUP_DIR>' WITH (FORMAT = 'parquet', start_time='2023-06-18 00:00:00', end_time='2023-06-19 00:00:00');
```

请注意：

- `<BACKUP_DIR>` 必须以 `/ `结尾。每个表都将被导出到一个带有表名的文件中。

- `start_time` 和 `end_time` 应该是一个有效的时间戳字符串，如 `2023-06-20 00:00:00/2023-06-20 00:00:00.000` 。

未来优化工作：

- 将最后一次备份时间持久化到 manifest，这样就不必每次都指定开始时间。

- 使用 Procedure 框架，允许在中断（关机或崩溃）后恢复工作。

### [db#1814](https://github.com/GreptimeTeam/greptimedb/pull/1814) 支持从 ORC 格式导入数据

我们现在支持从 ORC 格式复制。支持的类型包括布尔值、字符串、整数（i16、i32、i64）、浮点数（f32、f64）、时间戳（纳秒）和日期，且支持 [ZLIB, ZSTD](https://github.com/GreptimeTeam/greptimedb/pull/1847) 压缩格式。

注意：目前暂不支持 [ORC spec v0](https://orc.apache.org/specification/ORCv0/) 中定义的 Run Length Encoding，可以使用 Run Length Encoding V2 作为代替，详情可以参考 [orc-rust](https://github.com/wenyxu/orc-rs)。

我们原本计划在 orc-format crate 的基础上支持 ORC 格式数据的导入，但在补充单元测试的过程中发现了很多 bug，最后，我们重写了整个 RLEv2 算法，并支持时间戳、日期类型的解码，增加了一个异步流 Reader。

### [db#1818](https://github.com/GreptimeTeam/greptimedb/pull/1818) 支持 `blob` (binary) 类型

GreptimeDB 支持了 blob 类型的数据，目前通过 MySQL 协议和 sqlness 完成测试。修复了在实现过程中遇到的一些问题。

### [db#1839](https://github.com/GreptimeTeam/greptimedb/pull/1839) 将所有可能的 filters 下推到 Parquet 执行计划

我们将所有可能的 filters 下推到 Parquet 执行计划，以提高扫描效率。同时，将存储模式中的时间范围谓词数据类型强制为时间戳类型，以解决 [db#992](https://github.com/GreptimeTeam/greptimedb/issues/992) 出现的问题。

### [db#1831](https://github.com/GreptimeTeam/greptimedb/pull/1831) 提高 Influxdb v2 API 的兼容性

我们提高了 Influxdb v2 API 的兼容性。使用 curl 命令编写的例子如下所示：

```rust
curl -i -XPOST "http://localhost:4000/v1/influxdb/api/v2/write?bucket=public&precision=ms" \
--data-binary \
'monitor,host=127.0.0.1 cpu=0.1,memory=0.4 1667446797450 monitor,host=127.0.0.2 cpu=0.2,memory=0.3 1667446798450 monitor,host=127.0.0.1 cpu=0.5,memory=0.2 1667446798450'
```

使用 Go SDK 编写的例子可以[点击这里](https://github.com/Fengys123/influxdb_write_example/blob/main/main.go)。

## 新鲜事

前两天我们的 GreptimeCloud 已正式发布 Public Tech Preview 版！

在这次发布中，我们为之前依赖开源 Prometheus 进行应用监控和分析的用户，引入了一种托管式 Prometheus 解决方案。此外，我们也对 GreptimeCloud 服务的不同层级进行了增强，使其能够适应更多元的场景，从而满足更广大的用户需求。想要了解更多详情请点击这篇文章，同时也欢迎访问 https://console.greptime.cloud 试用 GreptimeCloud 公开邀请版，期待您为我们提出宝贵的意见与反馈！

我们已经发布了 GreptimeDB v0.3.2，在这个版本中，我们支持了由 Cassandra 启发的 TWCS 压缩策略，也支持对只有 glibc 2.17 的 CentoOS 7 机器进行编译，以及 row filter 下推的功能等等，欢迎大家持续关注我们的最新动态，并下载体验 [GreptimeDB v0.3.2](https://github.com/GreptimeTeam/greptimedb/releases/tag/v0.3.2)！

同时，我们非常高兴 GreptimeDB 的 Prometheus 兼容性测试结果已经达到了 66.61%，大大提升了 PromQL 的兼容性，感谢大家的支持与付出！


## 关于 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/
