-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-6541: [Format][C++] Update Columnar.rst for two-part EOS, update C++ implementation #5361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -984,7 +984,8 @@ class RecordBatchPayloadWriter : public RecordBatchWriter { | |||||
|
|
||||||
| class StreamBookKeeper { | ||||||
| public: | ||||||
| explicit StreamBookKeeper(io::OutputStream* sink) : sink_(sink), position_(-1) {} | ||||||
| explicit StreamBookKeeper(const IpcOptions& options, io::OutputStream* sink) | ||||||
| : options_(options), sink_(sink), position_(-1) {} | ||||||
|
|
||||||
| Status UpdatePosition() { return sink_->Tell(&position_); } | ||||||
|
|
||||||
|
|
@@ -1013,11 +1014,15 @@ class StreamBookKeeper { | |||||
|
|
||||||
| Status WriteEOS() { | ||||||
| // End of stream marker | ||||||
| constexpr int64_t kEos = 0; | ||||||
| return Write(&kEos, sizeof(kEos)); | ||||||
| constexpr int32_t kZeroLength = 0; | ||||||
| if (!options_.write_legacy_ipc_format) { | ||||||
| RETURN_NOT_OK(Write(&internal::kIpcContinuationToken, sizeof(int32_t))); | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit:
Suggested change
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm going to let this one slide -- I kind of prefer |
||||||
| } | ||||||
| return Write(&kZeroLength, sizeof(int32_t)); | ||||||
| } | ||||||
|
|
||||||
| protected: | ||||||
| IpcOptions options_; | ||||||
| io::OutputStream* sink_; | ||||||
| int64_t position_; | ||||||
| }; | ||||||
|
|
@@ -1028,7 +1033,7 @@ class PayloadStreamWriter : public internal::IpcPayloadWriter, | |||||
| protected StreamBookKeeper { | ||||||
| public: | ||||||
| PayloadStreamWriter(const IpcOptions& options, io::OutputStream* sink) | ||||||
| : StreamBookKeeper(sink), options_(options) {} | ||||||
| : StreamBookKeeper(options, sink) {} | ||||||
|
|
||||||
| ~PayloadStreamWriter() override = default; | ||||||
|
|
||||||
|
|
@@ -1045,9 +1050,6 @@ class PayloadStreamWriter : public internal::IpcPayloadWriter, | |||||
| } | ||||||
|
|
||||||
| Status Close() override { return WriteEOS(); } | ||||||
|
|
||||||
| private: | ||||||
| IpcOptions options_; | ||||||
| }; | ||||||
|
|
||||||
| /// A IpcPayloadWriter implementation that writes to a IPC file | ||||||
|
|
@@ -1056,7 +1058,7 @@ class PayloadFileWriter : public internal::IpcPayloadWriter, protected StreamBoo | |||||
| public: | ||||||
| PayloadFileWriter(const IpcOptions& options, const std::shared_ptr<Schema>& schema, | ||||||
| io::OutputStream* sink) | ||||||
| : StreamBookKeeper(sink), options_(options), schema_(schema) {} | ||||||
| : StreamBookKeeper(options, sink), schema_(schema) {} | ||||||
|
|
||||||
| ~PayloadFileWriter() override = default; | ||||||
|
|
||||||
|
|
@@ -1122,7 +1124,6 @@ class PayloadFileWriter : public internal::IpcPayloadWriter, protected StreamBoo | |||||
| } | ||||||
|
|
||||||
| protected: | ||||||
| IpcOptions options_; | ||||||
| std::shared_ptr<Schema> schema_; | ||||||
| std::vector<FileBlock> dictionaries_; | ||||||
| std::vector<FileBlock> record_batches_; | ||||||
|
|
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for some reason i thought there were linkage issues in C++11 using constexpr in a header.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constexprimplies inline/static linkage. It's not an error (though I sort of expected it to be) in clang to declare... if you want to declare something constexpr within this translation unit but also export it as a symbol for other translation units, but the expectation is that you'll just include the header into whatever TU needs that constant.