Commit 8926fee
committed
GH-3520: Cleanup binary write path
Two small cleanups on the binary write side:
1. DeltaByteArrayWriter: replace v.getBytes() with v.copy().getBytesUnsafe()
to avoid the unconditional Arrays.copyOf that getBytes() performs for
ByteArrayBackedBinary. copy() is a no-op for constant Binaries, and
getBytesUnsafe() returns the backing array directly. For reused-buffer
Binaries (e.g. ByteBufferBackedBinary over a slab being mutated), copy()
still snapshots them so correctness is preserved.
2. FixedLenByteArrayPlainValuesWriter: drop the unused LittleEndianDataOutputStream
wrapper (only used to call Binary.writeTo(), which works directly with
the underlying CapacityByteArrayOutputStream). The trailing out.flush()
in getBytes() is also dead. Same pattern as #3517 fixed in
DeltaLengthByteArrayValuesWriter.
No public API change. No file format change.
Validation: parquet-column 573 tests pass. Built with
-Dspotless.check.skip=true -Drat.skip=true -Djapicmp.skip=true.1 parent 53d7842 commit 8926fee
2 files changed
Lines changed: 5 additions & 10 deletions
File tree
- parquet-column/src/main/java/org/apache/parquet/column/values
- deltastrings
- plain
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
| |||
Lines changed: 1 addition & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
40 | | - | |
41 | 39 | | |
42 | 40 | | |
43 | 41 | | |
| |||
46 | 44 | | |
47 | 45 | | |
48 | 46 | | |
49 | | - | |
50 | 47 | | |
51 | 48 | | |
52 | 49 | | |
| |||
56 | 53 | | |
57 | 54 | | |
58 | 55 | | |
59 | | - | |
| 56 | + | |
60 | 57 | | |
61 | 58 | | |
62 | 59 | | |
| |||
69 | 66 | | |
70 | 67 | | |
71 | 68 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | 69 | | |
78 | 70 | | |
79 | 71 | | |
| |||
0 commit comments