Commit de52048
authored
### Rationale for this change
The Flight Server DoExchange method currently does not support Dictionary replacement or Dictionary Deltas, similar to how the client currently behaves or how we do for DoGet we should use an `ipc::RecordBatchWriter` with a custom `IpcPayloadWriter` instead of reimplementing Dictionary Replacement / Deltas logic.
### What changes are included in this PR?
Removes manually generation of individual ipc Payloads and uses an `ipc::RecordBatchWriter` and a custom `TransportMessagePayloadWriter` to modify the `IpcPayloads` into `FlightPayloads`.
### Are these changes tested?
Yes, existing tests cover the DoExchange functionality and new test for Python has been added where Dictionary deltas are being send via DoExchange. The test was failing before this change because the dictionary wasn't updated:
```python
received_table = reader.read_all()
expected_table = simple_dicts_table()
> assert received_table.equals(expected_table)
E assert False
E + where False = equals(pyarrow.Table\nsome_dicts: dictionary<values=string, indices=int64, ordered=0>\n----\nsome_dicts: [ -- dictionary:\n["foo... -- dictionary:\n["foo","baz","quux"] -- indices:\n[2,1], -- dictionary:\n["foo","baz","quux","new"] -- indices:\n[0,3]])
E + where equals = pyarrow.Table\nsome_dicts: dictionary<values=string, indices=int64, ordered=0>\n----\nsome_dicts: [ -- dictionary:\n["foo...ull], -- dictionary:\n["foo","baz","quux"] -- indices:\n[2,1], -- dictionary:\n["foo","baz","quux"] -- indices:\n[0,3]].equals
pyarrow/tests/test_flight.py:2596: AssertionError
================================================================================== short test summary info ===================================================================================
FAILED pyarrow/tests/test_flight.py::test_flight_dictionary_deltas_do_exchange - assert False
```
### Are there any user-facing changes?
No, only that the expected dictionary replacement/deltas will work for DoExchange.
* GitHub Issue: #26727
Authored-by: Raúl Cumplido <[email protected]>
Signed-off-by: Raúl Cumplido <[email protected]>
1 parent 3469def commit de52048
File tree
2 files changed
+114
-54
lines changed- cpp/src/arrow/flight
- python/pyarrow/tests
2 files changed
+114
-54
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
160 | 161 | | |
161 | 162 | | |
162 | 163 | | |
163 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
164 | 201 | | |
165 | 202 | | |
166 | 203 | | |
167 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
168 | 207 | | |
169 | 208 | | |
170 | 209 | | |
171 | | - | |
| 210 | + | |
172 | 211 | | |
173 | 212 | | |
174 | | - | |
175 | 213 | | |
| 214 | + | |
| 215 | + | |
176 | 216 | | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
182 | 221 | | |
183 | 222 | | |
184 | 223 | | |
| |||
188 | 227 | | |
189 | 228 | | |
190 | 229 | | |
191 | | - | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
192 | 240 | | |
193 | 241 | | |
194 | 242 | | |
195 | 243 | | |
196 | 244 | | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
201 | 249 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
| 250 | + | |
206 | 251 | | |
207 | 252 | | |
208 | 253 | | |
209 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
210 | 257 | | |
211 | 258 | | |
212 | 259 | | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
224 | 265 | | |
225 | 266 | | |
| 267 | + | |
226 | 268 | | |
227 | | - | |
| 269 | + | |
228 | 270 | | |
229 | 271 | | |
230 | 272 | | |
231 | 273 | | |
232 | 274 | | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | 275 | | |
| 276 | + | |
| 277 | + | |
251 | 278 | | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
| 279 | + | |
256 | 280 | | |
257 | 281 | | |
258 | 282 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
2536 | 2536 | | |
2537 | 2537 | | |
2538 | 2538 | | |
| 2539 | + | |
| 2540 | + | |
| 2541 | + | |
| 2542 | + | |
| 2543 | + | |
| 2544 | + | |
| 2545 | + | |
| 2546 | + | |
| 2547 | + | |
| 2548 | + | |
| 2549 | + | |
| 2550 | + | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
| 2558 | + | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
| 2562 | + | |
| 2563 | + | |
| 2564 | + | |
| 2565 | + | |
| 2566 | + | |
| 2567 | + | |
| 2568 | + | |
| 2569 | + | |
| 2570 | + | |
| 2571 | + | |
| 2572 | + | |
| 2573 | + | |
| 2574 | + | |
0 commit comments