# 聚焦 JSON 支持与 Geometry UDF 新增功能 | Greptime 双周精选

Source: https://greptime.cn/blogs/2024-10-25-biweekly-report

## 内容概述

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

最近的内容更新如下：

- **新增若干 Geometry UDF**

- **新增 JSON 函数: `json_path_exists` UDF**

- **引入 Window Sort 物理计划**

- **为 HTTP 接口添加 JSON 格式输出**

## 社区贡献者名单

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

- @[CookiePieWw](https://github.com/CookiePieWw) ([db#4807](https://github.com/GreptimeTeam/greptimedb/pull/4807)）
- @[Kev1n8](https://github.com/Kev1n8) （[db#4797](https://github.com/GreptimeTeam/greptimedb/pull/4797)）

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

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

## PR 亮点

### [db#4770](https://github.com/GreptimeTeam/greptimedb/pull/4770) [db#4823](https://github.com/GreptimeTeam/greptimedb/pull/4823) 新增更多 Geometry UDFs

我们引入了多项 S2 Geometry UDFs 以及 S3 Geometry UDFs，进一步扩展了几何数据的处理能力，增强了几何计算的灵活性。

### [db#4798](https://github.com/GreptimeTeam/greptimedb/pull/4798) 新增 `geojson_encode_path` UADF

该函数接受多行的纬度、经度和时间戳作为输入，输出兼容 Deck.gl 的路径数据，方便地理数据的可视化，尤其是在 Deck.gl 环境中。

### [db#4807](https://github.com/GreptimeTeam/greptimedb/pull/4807) 新增 JSON `json_path_exists` UDFs

该函数用于检查 JSON 数据中指定路径是否存在，提升了在处理复杂 JSON 数据结构时的查询能力。

### [db#4796](https://github.com/GreptimeTeam/greptimedb/pull/4796) 修复 `UNION ALL` 查询 Panic

我们修复了在执行 `UNION ALL` 查询时可能引发的系统崩溃问题，保证了查询的稳定性和可靠性。

### [db#4814](https://github.com/GreptimeTeam/greptimedb/pull/4814) 引入 Window sort physical plan

新增了 Window Sort 的物理执行计划，用于流式合并排序数据，进一步优化了数据库在大数据量排序场景中的性能。

### [db#4797](https://github.com/GreptimeTeam/greptimedb/pull/4797) 为 HTTP 接口添加 JSON 格式的输出

为 HTTP 查询接口提供了 JSON 格式的输出选项，简化了客户端直接消费数据的方式，提升了用户体验。

```json
{
  "data": [
    {
      "host": "127.0.0.1",
      "ts": 1667446797450,
      "cpu": 0.2,
      "memory": 0.3
    },
    ...
  ],
  "execution_time_ms": 23
}
```

## Good First Issue

### [db#3262 提供一个官方的 `Grafana` 配置](https://github.com/GreptimeTeam/greptimedb/issues/3262)

为 GreptimeDB 提供一个直观的开箱即用的 `Grafana` 仪表板。

关键词：Grafana

难度：中等

### [db#4805 添加更多 JSON 数据类型的 UDF](https://github.com/GreptimeTeam/greptimedb/issues/4805)

添加更多关于 JSON 数据类型的 UDFs，实现强大的查询功能。

关键词：JSON，UDF

难度：中等

---

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