apache / apache/datasketches-cpp

Theta sketch output doesn't match between Java and CPP

オープン
#460 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
C++
スター
273
フォーク
88
平均マージ
2日 2時間
マージ済み PR(30日)
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 を短くまとめたダイジェスト。