apache / apache/datasketches-cpp

Theta sketch output doesn't match between Java and CPP

未关闭
#460 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C++
星标
273
派生
88
平均合并
2 天 2 小时
30 天内合并 PR
8

描述

I have run a simple theta sketch computation as below in Java and CPP

```
Union union = Union.builder().buildUnion();
union.update(1);
union.update(2);
CompactSketch compactSketch = union.getResult();
byte[] bytes = union.getResult().toByteArray()
```

Java output:

02 03 03 00 00 1a cc 93 02 00 00 00 00 00 **80 3f**
15 f9 7d cb bd 86 a1 05 c3 97 fc 12 81 70 9d 1e

CPP :

```
updateThetaSketch update_sketch = updateThetaSketch::builder().build();

update_sketch.update(1);
update_sketch.update(2);
auto bytes = update_sketch.compact().serialize();

```

CPP output:

02 03 03 00 00 1a cc 93 02 00 00 00 00 00 **00 00**
15 f9 7d cb bd 86 a1 05 c3 97 fc 12 81 70 9d 1e

The output seems to not match, as we see in bold at the end of first line, 4 bytes "80 3f" is missing in CPP.

Can anyone share why this is so?

贡献指南

打开贡献指南

调研方向

首先重现 issue 中展示的 Java Union 和 C++ updateThetaSketch 示例,然后比较它们在突出显示字节附近的序列化字节布局。跟踪两个实现所使用的序列化和反序列化入口点;当不同的字节得到解释,并且建立了兼容的输出或有文档记录的格式行为时,即表示完成。

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

评估

技术栈
cpp, java
领域
data
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
活跃
描述清晰度
需要澄清
新手友好度
45/100

把新 issue 发到你的邮箱

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