apache / apache/parquet-java

Binary tests check conditions not part of the API contract

Ouverte
#1,919 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Component: Java Component: Parquet Priority: Major Type: bug
Langage dominant
Java
Étoiles
3.1k
Forks
1.6k
Merge moyen
3 j 12 h
PR mergées (30 j)
33

Description

`TestBinary#testConstantCopy` validates that when the backing buffer for a `Binary` is changed, the changes can be seen when calling either `Binary#getBytes` or `Binary#getBytesUnsafe`. This is not a part of the API contract for constant binary. The API guarantees the opposite: that if a reused buffer changes then those changes won't affect the value already returned by `getBytes`.

`ByteBufferBackedBinary` caches the value returned by `getBytes`, which is allowed in the API. This causes tests to fail when it is expected that a change to the underlying buffer changes the value of the binary, when the contract for constant buffers is that the underlying buffer will not be changed.

**Reporter**: [Ryan Blue](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=rdblue) / @rdblue

**Note**: *This issue was originally created as [PARQUET-414](https://issues.apache.org/jira/browse/PARQUET-414). Please see the [migration documentation](https://issues.apache.org/jira/browse/PARQUET-2502) for further details.*

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Commencez par BinaryTest#testConstantCopy et examinez le comportement de l’API de Binary et ByteBufferBackedBinary décrit dans l’issue. Exécutez les tests binaires, puis alignez le test sur le contrat du tampon constant afin qu’il ne soit pas attendu que les valeurs mises en cache changent lorsqu’un tampon sous-jacent est modifié.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
java
Domaine
testing
Type d'issue
Bug
Difficulté
2/5
Temps estimé
1-3 heures
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.