apache / apache/parquet-java

Binary tests check conditions not part of the API contract

Offen
#1,919 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Component: Java Component: Parquet Priority: Major Type: bug
Vorherrschende Sprache
Java
Sterne
3.1k
Forks
1.6k
Ø Merge
3 T. 12 Std.
Gemergte PRs (30 T.)
33

Beschreibung

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

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne mit BinaryTest#testConstantCopy und untersuche das im Issue beschriebene API-Verhalten von Binary und ByteBufferBackedBinary. Führe die Binärtests aus und richte den Test dann am Vertrag für konstante Puffer aus, sodass nicht erwartet wird, dass sich zwischengespeicherte Werte ändern, wenn ein zugrunde liegender Puffer geändert wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
testing
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.