# 提升 Flow 易用性！任务和元数据管理更容易 | Greptime 双周精选

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

## 内容概述

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

最近的内容更新如下：
- 改善 Flow 的易用性：现在 Flow 的管理和元数据检查等操作变得更加容易；
- 增强数据备份功能：现在数据备份能力现在变得更加实用。

## 社区贡献者名单

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

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

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

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

- @[leaf-potato](https://github.com/leaf-potato) ([db#4427](https://github.com/GreptimeTeam/greptimedb/pull/4427) [db#4426](https://github.com/GreptimeTeam/greptimedb/pull/4426) [db#4412](https://github.com/GreptimeTeam/greptimedb/pull/4412)) 

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

👏 欢迎 @[besrabasant](https://github.com/besrabasant) @[leaf-potato](https://github.com/leaf-potato) 作为新的贡献者加入社区并成功合并了首个 PR，还有更多来自其他独立贡献者的 PR 正在等待合并。

<img src="/zh/blogs/2024-07-31-biweekly-report/contributorpost.png" alt="Contributor of GreptimeDB" style="width: 80%; margin: 0 auto"/>

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

## PR 亮点
### [db#4386](https://github.com/GreptimeTeam/greptimedb/pull/4386) [db#4416](https://github.com/GreptimeTeam/greptimedb/pull/4416) 改进 Flow 的可用性

在过去的两周里，我们专注于使 Flow 更易于使用。包括实现 SHOW FLOWS 子句：
```sql
public=> SHOW FLOWS;
     Flows      
----------------
 filter_numbers
(1 row)
```

Information schema 中还有一个新的表 `FLOWS` 来显示 Flow 的元数据：
```sql
public=> select * from INFORMATION_SCHEMA.FLOWS;
   flow_name    | flow_id | catalog_name |                      raw_sql                       | comment | expire_after | source_table_ids |       sink_table_name       | flownode_ids | options 
----------------+---------+--------------+----------------------------------------------------+---------+--------------+------------------+-----------------------------+--------------+---------
 filter_numbers |    1024 | greptime     | SELECT number FROM numbers_input WHERE number > 10 |         |              | [1024]           | greptime.public.out_num_cnt | {"0":0}      | {}
(1 row)
```

而在某些情况下我们需要手动触发更新，现在有了 `flush_flow 函数可以帮助实现：

```sql
select flush_flow('test_numbers_df_func');
```

### [db#4382](https://github.com/GreptimeTeam/greptimedb/pull/4382) [db#4405](https://github.com/GreptimeTeam/greptimedb/pull/4405) 数据备份能力增强

从最新版本开始，我们内置的 CLI 工具 `greptime cli` 为子命令 `export` 增加了一个新选项，用于导出数据库数据：

```plain text
greptime cli export --help
Usage: greptime cli export [OPTIONS] --addr <ADDR> --output-dir <OUTPUT_DIR> --target <TARGET>

Options:
  -t, --target <TARGET>
          Things to export

          Possible values:
          - create-table:  Corresponding to `SHOW CREATE TABLE`
          - table-data:    Corresponding to `EXPORT TABLE`
          - database-data: Corresponding to `EXPORT DATABASE`
```

同时，它也替代了旧的 `table-data` 目标选项。

对于 `COPY TABLE` 子句，我们现在可以指定时间范围进行导出。使用此功能可以实现增量备份：

```sql
copy table x from datasource with (start_time='2022-06-15 07:02:37', end_time='2022-06-15 07:02:38');
```

## Good First Issue

### [db#3072 合并小 IO 以优化云存储](https://github.com/GreptimeTeam/greptimedb/issues/3072)

过多的小请求可能会导致昂贵的账单；我们可以对像 s3 这样的对象存储进行优化来减少不必要的开销。如果范围几乎是连续的，我们可以将这些范围合并成一个大块，并同时按首选大小获取这个大块。

关键词：Cloud，Object Store

难度：中等

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