apache / apache/datasketches-cpp
Theta sketch output doesn't match between Java and CPP
- Langage dominant
- C++
- Étoiles
- 273
- Forks
- 88
- Merge moyen
- 2 j 2 h
- PR mergées (30 j)
- 8
Description
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?
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par reproduire les exemples Java Union et C++ updateThetaSketch présentés dans l’issue, puis comparez leurs agencements d’octets sérialisés autour des octets mis en évidence. Suivez les points d’entrée de sérialisation et de désérialisation utilisés par les deux implémentations ; le travail est terminé lorsque les octets différents sont expliqués et qu’une sortie compatible ou un comportement de format documenté est établi.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- cpp, java
- Domaine
- data
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- Active
- Clarté
- À clarifier
- Accessibilité débutants
- 45/100