将映射表转换为原始浮点位: -0.0 未找到 0 的条目
作者: clickgapai创建于 2026年9月17日更新于 2026年9月17日
标签comp-regular-function
分析细节(证据,受影响的位置,影响) **为什么我们认为这是一个 bug:** `caseWithExpression::executeImpl` 将所有常量 `CASE expr WHEN ...` 通过 `transform` 进行路由([`src/Functions/caseWithExpression.cpp:241`](https://ZZTERM5ZZ.com/ClickHouse/ClickHouse/blob/2d19d1b6e073/src/Functions/caseWithExpression.cpp#L241) `function_base->execute(transform_args, ...)`) -> `initializeTransformCache` 创建查找表,通过转换值的原始字节对每个被接受的条目进行键值映射([`src/Functions/transform.cpp:817-818`](https://ZZTERM6ZZ.com/ClickHouse/ClickHouse/blob/2d19d1b6e073/src/Functions/transform.cpp#L817-L818)) -> `executeNum`/`executeNumToStringHelper`/`executeNumToNumHelper` 通过 `bit_cast(pod[i])` 查找输入(transform.cpp:328, :393, :462)。`+0.0` 为 `0x0000000000000000`,而 `-0.0` 为 `0x8000000000000000`,因此查找失败。 `Nullable(Float)` 变体采用哈希表,并以同样的方式失败:键来自 `cache->from_column->updateHashWithValue` (:844) 而查找来自 `in->updateHashWithValue` (:267),这两个都对原始浮点位进行哈希。
内容来源: ClickHouse/ClickHouse