Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

`array_concat` with an untyped `NULL` argument fails with "does not support type Int64"

未关闭 适合新手
#26,243 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@RishavTiwari25 已经在做这个了。

开始于 2026年10月13日。

  • #26254 来自 @RishavTiwari25 —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
80/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust
领域
backend, databases

调研方向

首先阅读 ArrayConcat::coerce_types 和 ArrayConcat::return_type,尤其是 issue 中描述的回退方案 coerced_type_with_base_type_only。在 datafusion-cli 中使用 SELECT array_concat([1, 2], NULL) 重现故障,然后检查现有的数组拼接测试以及 #16349 中带类型的 NULL 情况。无类型 NULL 查询返回 [1, 2],且报告中的 array_cat 形式得到覆盖,即为完成。

由索引模型根据 Issue 内容生成。

描述

Describe the bug

array_concat / array_cat fails to plan when one of the arguments is a plain NULL literal, and the error message names the element type of the other argument:

> SELECT array_concat([1, 2], NULL);
Error during planning: array_concat does not support type Int64

> SELECT array_cat(NULL, [1, 2]);
Error during planning: array_concat does not support type Int64

The same calls work when the NULL is typed (NULL::int[]) or when a NULL appears inside a list, so this is only the untyped literal:

> SELECT array_concat([1, 2], NULL::int[]);
[1, 2]

> SELECT array_concat([1, 2], [NULL]);
[1, 2, NULL]

ArrayConcat::return_type accepts DataType::Null arguments, but ArrayConcat::coerce_types runs every argument through coerced_type_with_base_type_only, whose fallback arm replaces a non-list type with the base type. The Null argument therefore becomes Int64, and the second return_type call rejects it.

To Reproduce

In datafusion-cli:

SELECT array_concat([1, 2], NULL);
SELECT array_cat(NULL, [1, 2]);
SELECT array_concat(['a'], NULL);
Expected behavior

The untyped NULL is treated like a NULL list of the result type and the other arguments are returned, matching PostgreSQL (array_cat(ARRAY[1, 2], NULL) is {1,2}) and the typed-NULL behavior above:

> SELECT array_concat([1, 2], NULL);
[1, 2]
Additional context

Reproduced on main at 6663e4348 (debug build of datafusion-cli).

#16349 covered NULL::int[] arguments; this is the remaining untyped case. I would like to work on this.

主要语言
Rust
星标
9.5k
派生
2.5k
平均合并
4 天 19 小时
30 天内合并 PR
342

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/datafusion 的其他 Issue

查看 apache/datafusion 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。