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

[Bug] ORDER BY on a Boolean-or-null grouping key throws ClassCastException

未关闭
#3,319 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

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

调研方向

Start by tracing the Cypher REST query path for the supplied OPTIONAL MATCH, aggregation, and ORDER BY, then locate how grouping keys with Boolean and null values are compared. Reproduce the failure with the three vertices described in the issue and check the query's ordering behavior. Done means the query returns three rows for null, true, and false in the expected descending order without a ClassCastException.

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

描述

bug
Bug Type (问题类型)

rest-api (结果不合预期)

Before submit
  • 我已经确认现有的 Issues 与 FAQ 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)
Environment (环境信息)
  • Server Version: 1.7.0
  • Docker Image: hugegraph/hugegraph:latest as tested on 2026-09-27
  • Backend: default Docker standalone backend
  • Interface: Cypher REST endpoint
Expected & Actual behavior (期望与实际表现)
CREATE (:L5 {b0: false, id: 0}),
       (:L4 {b0: true, id: 1}),
       (:L4 {id: 2});

MATCH (n)
OPTIONAL MATCH (n)-[r0:T1]->(n1 {s1: 'v4_4'})
WITH n.b0 AS g, count(n1.id) AS c
RETURN g, c ORDER BY g DESC;

Expected: three rows for null, true and false, each with count 0,
ordered according to Cypher's descending null/Boolean ordering.

Actual: execution fails and leaks a Java implementation exception:

class java.lang.String cannot be cast to class java.lang.Boolean
Vertex/Edge example (问题点 / 边数据举例)
Three vertices are sufficient; one has `b0=false`, one has `b0=true`, and one
omits `b0`. No `T1` edge is required.
Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
- Vertex labels: `L4`, `L5`
- Properties: `b0` Boolean and nullable/missing; `id` integer
- Edge label referenced by the optional pattern: `T1`
- No secondary index is required.
主要语言
Java
星标
3.2k
派生
641
平均合并
1 天 9 小时
30 天内合并 PR
74

环境准备

从这里开始

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

apache/hugegraph 的其他 Issue

查看 apache/hugegraph 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

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