Repository navigation
Commit f8ec4be
authored
## What's Changed
Follow-up to #1231. `ClobConsumer` reads a CLOB in chunks of 256
characters and encodes each chunk to UTF-8 on its own, so a character
outside the BMP split between two chunks was encoded as `??`.
- A chunk that ends with a high surrogate, while characters remain, now
leaves it for the next chunk, so the pair is encoded together.
- The read position advances by the length of the chunk instead of the
requested size. The shorter chunk needs this, and it also stops skipping
characters when a driver returns fewer than requested.
- An empty chunk before the end of the CLOB throws an `SQLException`
instead of looping forever.
`ClobConsumerTest` covers emojis across chunk boundaries for both
consumers. The test fails without the fix: 255 `a` followed by 😀 read
back as 257 bytes instead of 259.
This changes other lines of `ClobConsumer` than #1479, and the two
branches merge cleanly.
Closes #1478.
1 parent baee368 commit f8ec4be
2 files changed
Lines changed: 32 additions & 4 deletions
File tree
- adapter/jdbc/src
- main/java/org/apache/arrow/adapter/jdbc/consumer
- test/java/org/apache/arrow/adapter/jdbc/consumer
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
60 | 77 | | |
61 | 78 | | |
62 | 79 | | |
| |||
80 | 97 | | |
81 | 98 | | |
82 | 99 | | |
83 | | - | |
| 100 | + | |
84 | 101 | | |
85 | 102 | | |
86 | 103 | | |
| |||
91 | 108 | | |
92 | 109 | | |
93 | 110 | | |
94 | | - | |
| 111 | + | |
95 | 112 | | |
96 | 113 | | |
97 | 114 | | |
| |||
124 | 141 | | |
125 | 142 | | |
126 | 143 | | |
127 | | - | |
| 144 | + | |
128 | 145 | | |
129 | 146 | | |
130 | 147 | | |
| |||
135 | 152 | | |
136 | 153 | | |
137 | 154 | | |
138 | | - | |
| 155 | + | |
139 | 156 | | |
140 | 157 | | |
141 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
59 | 70 | | |
60 | 71 | | |
61 | 72 | | |
| |||
0 commit comments