---
title: Databend 开源周报第 74 期
description: 本期引入 databend-local 受到 clickhouse-local 的启发，允许用户在不启动 Databend 集群的情况下对本地文件执行高效查询。
slug: category-weekly/databend-weekly-74
date: 2022-12-28
tags: [weekly]
category: Weekly

image: databend-weekly.png
authors:
  - DatabendLabs
---

> 英文版移步：https://www.databend.com/blog/2022-12-28-databend-weekly
>
> [Databend](https://github.com/databendlabs/databend) 是一款强大的云数仓。专为弹性和高效设计。自由且开源。即刻体验云服务：[https://app.databend.cn](https://app.databend.cn) 。

{/* truncate */}

## What's New

探索 Databend 本周新进展，遇到更贴近你心意的 Databend。

### Features & Improvements ✨

**Meta**

- watch client 被弃用时，也移除 stream ([#9334](https://github.com/databendlabs/databend/pull/9334))

**Planner**

- 为 range 谓词实现选择率估计 ([#9398](https://github.com/databendlabs/databend/pull/9398))

**Query**

- 支持 copy on error ([#9312](https://github.com/databendlabs/databend/pull/9312))

- 实现 databend-local ([#9282](https://github.com/databendlabs/databend/pull/9282))

- external storage 支持 `location_prefix` ([#9381](https://github.com/databendlabs/databend/pull/9381))

**Storage**

- rangefilter 支持 in ([#9330](https://github.com/databendlabs/databend/pull/9330))

- 尝试改进对象存储的读性能 ([#9335](https://github.com/databendlabs/databend/pull/9335))

- 支持 table 压缩 ([#9370](https://github.com/databendlabs/databend/pull/9370))

**Metrics**

- 为 fuse compact 和 block write 增加更多观测指标 ([#9399](https://github.com/databendlabs/databend/pull/9399))

**Sqllogictest**

- 增加对 no-fail-fast 的支持 ([#9391](https://github.com/databendlabs/databend/pull/9391))

### Code Refactoring 🎉

**\***

- 完全适配 rustls，移除所有指向 native-tls 的依赖 ([#9358](https://github.com/databendlabs/databend/pull/9358))

**Format**

- 移除 format_xxx 设置 ([#9360](https://github.com/databendlabs/databend/pull/9360))

- 调整 `FileFormatOptionsExt` 接口 ([#9395](https://github.com/databendlabs/databend/pull/9395))

**Planner**

- 移除 `SyncTypeChecker` ([#9352](https://github.com/databendlabs/databend/pull/9352))

**Query**

- 将 fuse source 拆分为 read data 和 deserialize ([#9353](https://github.com/databendlabs/databend/pull/9353))

- 在读取 parquet 文件时避免 io copy ([#9365](https://github.com/databendlabs/databend/pull/9365))

- 为 parquet reader 实现非压缩缓冲区 ([#9379](https://github.com/databendlabs/databend/pull/9379))

**Storage**

- 添加读写相关设置 ([#9359](https://github.com/databendlabs/databend/pull/9359))

### Bug Fixes 🔧

**Format**

- 修复 `align_flush` 的行为，以适应 CSV 文件中仅存在表头的情况 ([#9327](https://github.com/databendlabs/databend/pull/9327))

**Settings**

- 使用逻辑 CPU 数量作为 `num_cpus` 默认值 ([#9396](https://github.com/databendlabs/databend/pull/9396))

**Processors**

- 修复 union 两侧数据类型不匹配的问题 ([#9361](https://github.com/databendlabs/databend/pull/9361))

**HTTP Handler**

- 修复关于查询不存在的错误警告 ([#9380](https://github.com/databendlabs/databend/pull/9380))

**Sqllogictest**

- 重构 sqllogictest 的 http client ([#9363](https://github.com/databendlabs/databend/pull/9363))

## What's On In Databend

请持续关注 Databend 的最新动态。

#### 实现 databend-local

databend-local 受到 [clickhouse-local](https://clickhouse.com/docs/en/operations/utilities/clickhouse-local/) 的启发，允许用户在不启动 Databend 集群的情况下对本地文件执行高效查询。

```bash
> export CONFIG_FILE=tests/local/config/databend-local.toml
> cargo run --bin=databend-local -- --sql="SELECT * FROM tbl1" \
--table=tbl1=/path/to/databend/docs/public/data/books.parquet
exec local query: SELECT * FROM tbl1
+------------------------------+---------------------+------+
| title                        | author              | date |
+------------------------------+---------------------+------+
| Transaction Processing       | Jim Gray            | 1992 |
| Readings in Database Systems | Michael Stonebraker | 2004 |
| Transaction Processing       | Jim Gray            | 1992 |
| Readings in Database Systems | Michael Stonebraker | 2004 |
+------------------------------+---------------------+------+
4 rows in set. Query took 0.015 seconds.
```

**阅读以下材料以了解更多讯息：**

- [PR | support databend-local](https://github.com/databendlabs/databend/pull/9282)

## What's Up Next

我们始终对前沿技术和创新理念持开放态度，欢迎您加入社区，为 Databend 注入活力。

#### 压缩短字符串

当处理涉及到短字符串的查询时，Databend 可能会比 Snowflake 读取更多的数据。

```SQL
SELECT SearchPhrase, MIN(URL), COUNT(*) AS c FROM hits \
WHERE URL LIKE '%google%' AND SearchPhrase <> '' \
GROUP BY SearchPhrase ORDER BY c DESC LIMIT 10;
```

如果能够对短字符串进行压缩，上面的查询可能会变得更加高效。

[Issue 9001: performance: compressing for short strings](https://github.com/databendlabs/databend/issues/9001)

如果你对这个主题感兴趣，可以尝试解决其中的部分问题或者参与讨论和 PR review。或者，你可以点击 https://link.databend.com/i-m-feeling-lucky 来挑选一个随机问题，祝好运！

## Changelogs

前往查看 Databend 每日构建的变更日志，以了解开发的最新动态。

地址：https://github.com/databendlabs/databend/releases

## Contributors

非常感谢贡献者们在本周的卓越工作。

![](../static/img/blog/weekly-74-1.png)
![](../static/img/blog/weekly-74-2.png)
![](../static/img/blog/weekly-74-3.png)

## Connect With Us

Databend 是一款开源、弹性、低成本，基于对象存储也可以做实时分析的新式数仓。期待您的关注，一起探索云原生数仓解决方案，打造新一代开源 Data Cloud。

- [Databend Website](https://docs.databend.cn)

- [GitHub Discussions](https://github.com/databendlabs/databend/discussions)

- [Twitter](https://twitter.com/Datafuse_Labs)

- [Slack Channel](https://link.databend.com/join-slack)
