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
ARROW-3470: [C++] Fix row-wise example #3078
ARROW-3470: [C++] Fix row-wise example #3078
Conversation
This might be conflicting with #2856. Can we include the C++ file in the generated docs without copying it manually? |
We should be able to include a whole file into the Sphinx docs via https://breathe.readthedocs.io/en/latest/directives.html#doxygenfile I'll merge #2856 as soon as the build passes, so that this PR can rebase on top. We should get rid of the |
// supported on Unix systems, not Windows. | ||
arrow::MemoryPool* pool = arrow::default_memory_pool(); | ||
|
||
auto id_builder = std::make_shared<Int64Builder>(pool); |
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.
These builders are only used in the local scope. We should make them simple stack variables without wrapping them into std::shared_ptr
.
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.
I wrapped them out of uniformity. The cost_components_builder
has to be in a shared_ptr to be passed to the components_builder
. The previous version was wrongly using a std::move then referencing again the (moved out) builder.
Our choice is between:
- 3 local and 1 shared_ptr builder
- 4 shared_ptr builders
I can revert this choice.
If you want to include the source for a file in a Sphinx document, you can use the |
Yeah, pre #2856 I was looking at Doxygen documentation to achieve this. |
I tend to prefer prose as a single file with prose comments as it allows to copy-paste in a single pass for users. Anyone objects that I go this route? It'll also give CI testing of C++ examples documentation. |
No objections here |
0f26ba2
to
602b417
Compare
@xhochy that would be ready to review |
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.
+1, this is looking good but sadly needs a rebase now.
Anyone: Feel free to merge once build passes.
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.
I left a few other comments
cpp/examples/arrow/CMakeLists.txt
Outdated
# under the License. | ||
|
||
#add_executable(row-wise-conversion-example row-wise-conversion.cc) | ||
#target_link_libraries(row-wise-conversion-example arrow) |
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.
Cruft
602b417
to
11e4336
Compare
I addressed the comments and replicated what was done to CI scripts with the new tests default to off. |
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.
+1, thanks @fsaintjacques! Will merge once the build runs
@@ -23,3 +23,4 @@ C++ Implementation | |||
|
|||
getting_started | |||
api | |||
examples |
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.
The examples should come before the API IMHO.
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.
I'll let the CI finish, and if it passes I'll push with this tiny change.
- Implement the `ADD_EXAMPLE` cmake function with new ctest label `example`, also covered by the `runexample` target. This can be toggled via the `ARROW_BUILD_EXAMPLES` option which is ON by default. - Implement fully working `row-wise-conversion-example.cc` and add it to the default build. - Update documentation to embed (manually) the newly created example.
When ARROW_EXTRA_ERROR_CONTEXT is enabled and the ARROW_RETURN_NOT_OK macro is used in a non-arrow namespace, the compiler would throw an error.
11e4336
to
fab63f6
Compare
I don't think the failures were related to this change (gandiva micro benchmark), the second one is odd (https://travis-ci.org/apache/arrow/jobs/467085379)
Concurrency issue? |
I've been seeing this pretty consistently https://travis-ci.org/apache/arrow/jobs/467092615#L2567. I opened https://issues.apache.org/jira/browse/ARROW-4008. It's not related to this patch |
I think this is now safe to merge. |
ADD_EXAMPLE
cmake function with new ctest labelexample
, also covered by therunexample
target. This can betoggled via the
ARROW_BUILD_EXAMPLES
option which is ON by default.row-wise-conversion-example.cc
and add it tothe default build.