Commit 7ebc88c
### Rationale for this change
Because they (pull-based and push-based) must have the same behavior.
### What changes are included in this PR?
This PR extracts reusable codes to StreamDecoderInternal from StreamDecoderImpl. External API isn't changed for
RecordBatchStreamReader and StreamDecoder.
This PR adds some external API to implement this:
* arrow::Status::ToStringWithoutContextLines(): This is only for testing. We can get stable result of ASSERT_RAISES_WITH_MESSAGE() with/without -DARROW_EXTRA_ERROR_CONTEXT=ON by this.
We can extract this and related changes to separated PR if we want.
* arrow::ipc::Listener::OnRecordBatchWithMetadataDecoded(): Because RecordBatchStreamReader wants not only RecordBatch but also custom metadata. OnRecordBatchWithMetadataDecoded() receives RecordBatchWithMetadata. OnRecordBatchDecoded() still exists and it's used by default for backward compatibility.
* arrow::ipc::CollectListener::metadatas(), arrow::ipc::CollectListener::num_record_batches(), arrow::ipc::CollectListener::PopRecordBatch(), arrow::ipc::CollectListener::PopRecordBatchWithMetadat(): If we add these APIs, we can use CollectListner in RecordBatchStreamReader. We can create an internal listener only for RecordBatchStreamReader if don't want to extend CollectListener.
### Are these changes tested?
Yes.
### Are there any user-facing changes?
Yes.
**This PR includes breaking changes to public APIs.**
`arrow::ipc::CollectListener::record_batches()` returns `const std::vector<std::shared_ptr<RecordBatch>>&` instead of `std::vector<std::shared_ptr<RecordBatch>>`.
* Closes: #26153
Lead-authored-by: Sutou Kouhei <[email protected]>
Co-authored-by: Sutou Kouhei <[email protected]>
Co-authored-by: Antoine Pitrou <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
1 parent a2ccd46 commit 7ebc88c
File tree
6 files changed
+262
-247
lines changed- cpp/src/arrow
- ipc
- testing
6 files changed
+262
-247
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2082 | 2082 | | |
2083 | 2083 | | |
2084 | 2084 | | |
2085 | | - | |
| 2085 | + | |
2086 | 2086 | | |
2087 | | - | |
| 2087 | + | |
2088 | 2088 | | |
2089 | | - | |
2090 | | - | |
2091 | | - | |
| 2089 | + | |
2092 | 2090 | | |
2093 | 2091 | | |
2094 | 2092 | | |
2095 | 2093 | | |
2096 | 2094 | | |
2097 | | - | |
2098 | | - | |
2099 | | - | |
2100 | | - | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
2101 | 2099 | | |
2102 | 2100 | | |
2103 | 2101 | | |
2104 | | - | |
2105 | | - | |
2106 | | - | |
2107 | | - | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
2108 | 2107 | | |
2109 | 2108 | | |
2110 | 2109 | | |
| |||
0 commit comments