--- title: Databend 开源周报第 130 期 description: slug: databend-weekly-130 date: 2024-01-29 tags: [weekly] cover_url: databend-weekly.svg image: databend-weekly.png contributors: - name: akoshchiy - name: andylokandy - name: ariesdevil - name: b41sh - name: BohuTang - name: Chasen-Zhang - name: dantengsky - name: Dousir9 - name: drmingdrmer - name: everpcpc - name: flaneur2020 - name: Freejww - name: guojidan - name: JackTan25 - name: leiysky - name: lichuang - name: PsiACE - name: SkyFan2002 - name: soyeric128 - name: sundy-li - name: TCeason - name: wubx - name: Xuanwo - name: xudong963 - name: xx01cyx - name: youngsofun - name: zhang2014 - name: ZhiHanZ - name: zhyass authors: - databendlabs ---  > [Databend](https://github.com/datafuselabs/databend) 是一款现代云数仓。专为弹性和高效设计,为您的大规模分析需求保驾护航。自由且开源。即刻体验云服务:[https://app.databend.cn](https://app.databend.cn) 。 ## What's On In Databend 探索 Databend 本周新进展,遇到更贴近你心意的 Databend 。 ### 支持 `CREATE OR REPLACE DATABASE` `CREATE OR REPLACE DATABASE` 是一个语法糖,用于简化下面的 SQL 语句: ```sql DROP DATABASE IF EXISTS ... CREATE DATABASE ... ``` 对 `CREATE OR REPLACE TABLE` 的支持也在积极推进中。 如果您想了解更多信息,欢迎联系 [Databend 团队](https://databend.cn/contact-us/),或查看下面列出的资源。 - [PR #14449 | feat: add create or replace database support](https://github.com/datafuselabs/databend/pull/14449) - [Issue #14229 | tracking: CREATE OR REPLACE](https://github.com/datafuselabs/databend/issues/14229) ## Code Corner 一起来探索 Databend 和周边生态中的代码片段或项目。 ### 使用 SQL 预测鸢尾花分类 结合 CASE WHEN 语句和简单的判据,可以利用 SQL 模拟简单的树模型,并且在鸢尾花分类中达到接近 97% 的精度。 ```SQL SELECT COUNT(*) AS total_count, SUM(CASE WHEN subquery.species = subquery.prediction THEN 1 ELSE 0 END) AS correct_count, SUM(CASE WHEN subquery.species <> subquery.prediction THEN 1 ELSE 0 END) AS incorrect_count, SUM(CASE WHEN subquery.species = subquery.prediction THEN 1 ELSE 0 END) / COUNT(*) AS accuracy FROM ( SELECT sepal_length, sepal_width, petal_length, petal_width, species, CASE WHEN petal_width < 0.75 THEN 1 WHEN petal_width >= 0.75 AND petal_width < 1.35 THEN 2 WHEN petal_width >= 0.75 AND petal_width < 1.75 AND petal_width >= 1.35 AND sepal_width < 2.65 THEN 3 WHEN petal_width >= 0.75 AND petal_width < 1.75 AND petal_width >= 1.35 AND sepal_width >= 2.65 THEN 2 WHEN petal_width >= 0.75 AND petal_width >= 1.75 THEN 3 END AS prediction FROM iris ) AS subquery; ``` 完整示例使用 Hugging Face 上的鸢尾花数据集进行,包含数据访问和数据清洗等关键步骤,欢迎阅读: - [Analyzing Hugging Face Datasets with Databend](https://www.databend.com/blog/2024-01-18-analyzing-hugging-face-datasets-with-databend/) ## Highlights 以下是一些值得注意的事件,也许您可以找到感兴趣的内容。 - 支持 `SHOW USER FUNCTIONS` 。 - 新增系统表 `user_functions` 。 - 新增条件函数 `nvl` 和 `nvl2` 。 - 新增 JSON 处理函数 `minus` 支持按索引或名称删除。 - 支持谓词移动(Predicate Move-Around)。 ## What's Up Next 我们始终对前沿技术和创新理念持开放态度,欢迎您加入社区,为 Databend 注入活力。 ### 支持倒排索引 倒排索引(Inverted Index)是全文检索系统中常用的一种单词文档映射结构。Databend 计划引入倒排索引,以满足全文检索场景的需要。 参考语法如下: ```sql -- 创建索引 CREATE [ASYNC] INVETED INDEX ivt_index ON <table>(<column>) ... -- 刷新索引 REFRESH INVETED INDEX <index_name> [LIMIT <limit>] ``` [Issue #14505 | feat: inverted index](https://github.com/datafuselabs/databend/issues/14505) 如果你对这个主题感兴趣,可以尝试解决其中的部分问题或者参与讨论和 PR review 。或者,你可以点击 https://link.databend.rs/i-m-feeling-lucky 来挑选一个随机问题,祝好运! ## New Contributors 一起认识社区中的新伙伴,Databend 因你们而变得更加美好。 * [@xx01cyx](https://github.com/xx01cyx) 修正了缓存相关的变量名,[#14430](https://github.com/datafuselabs/databend/pull/14430) 。 ## Changelog 前往查看 Databend 每日构建的变更日志,以了解开发的最新动态。 地址:https://github.com/datafuselabs/databend/releases ## Contributors 非常感谢贡献者们在本周的卓越工作。  ## Connect With Us Databend 是一款开源、弹性、低成本,基于对象存储也可以做实时分析的新式数仓。期待您的关注,一起探索云原生数仓解决方案,打造新一代开源 Data Cloud。 - [Databend Website](https://databend.rs) - [GitHub Discussions](https://github.com/datafuselabs/databend/discussions) - [Twitter](https://twitter.com/Datafuse_Labs) - [Slack Channel](https://link.databend.rs/join-slack)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up