`array_concat` with an untyped `NULL` argument fails with "does not support type Int64"
维护者通常 1 天内回复
评估
调研方向
首先阅读 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
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/datafusion 的其他 Issue
-
[Bug] atan2 does not normalize -0.0 the way Spark does可能已有人在做 @spicysharkco 于 1 天前认领。 未关闭bug spark
难度 2/5 1-3 小时 新手友好度 72/100
apache/datafusion#26333 ·
维护者通常 1 天内回复
-
bug help wanted unparser
难度 2/5 1-3 小时 新手友好度 72/100
apache/datafusion#26316 · 1 条评论 ·
维护者通常 1 天内回复
-
Deduplicate bucket computation in width_bucket_interval_mdn_exact可能已有人在做 @nightcityblade 于 2 天前认领。 未关闭enhancement good first issue help wanted spark tech debt
难度 2/5 1-3 小时 新手友好度 85/100
apache/datafusion#26307 · 3 条评论 ·
维护者通常 1 天内回复
-
Use the shared aggr_test_schema in CSV scan tests instead of a local copy可能已有人在做 @med9110 于 2 天前认领。 未关闭core enhancement good first issue help wanted tech debt
难度 2/5 1-3 小时 新手友好度 85/100
apache/datafusion#26306 · 2 条评论 ·
维护者通常 1 天内回复
-
gcd benchmarks pass number_rows: 0 for 100k-row inputs可能已有人在做 @med9110 于 3 天前认领。 未关闭bug functions good first issue help wanted tech debt
难度 1/5 1 小时以内 新手友好度 92/100
apache/datafusion#26297 · 1 条评论 ·
维护者通常 1 天内回复
查看 apache/datafusion 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 88/100
pop-os/cosmic-comp#2956 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
area:release criticality:p3 documentation
难度 2/5 1-3 小时 新手友好度 68/100
registrystack/registry-stack#2085 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
libp2p/rust-libp2p#6694 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
EmbarkStudios/cargo-deny#910 ·