apache / apache/parquet-java

Binary tests check conditions not part of the API contract

Aperta
#1,919 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Component: Java Component: Parquet Priority: Major Type: bug
Lingua principale
Java
Stelle
3.1k
Fork
1.6k
Merge medio
3g 12h
PR unite (30g)
33

Descrizione

`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.*

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia da BinaryTest#testConstantCopy e analizza il comportamento dell’API di Binary e ByteBufferBackedBinary descritto nell’issue. Esegui i test binari, quindi allinea il test al contratto del buffer costante, in modo che non ci si aspetti che i valori memorizzati nella cache cambino quando viene modificato un buffer sottostante.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
testing
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.