Copilot commented on code in PR #50881:
URL: https://github.com/apache/arrow/pull/50881#discussion_r4125896615
##########
docs/source/cpp/build_system.rst:
##########
@@ -55,6 +55,38 @@ file into an executable linked with the Arrow C++ shared
library:
add_executable(my_example my_example.cc)
target_link_libraries(my_example PRIVATE Arrow::arrow_shared)
+.. _cpp-build-system-linking-parquet:
+
+Linking Parquet
+---------------
+
+The Parquet reader and writer used in the :doc:`tutorials/io_tutorial` and the
+:doc:`tutorials/datasets_tutorial` (the ``parquet::arrow`` namespace, declared
in
+``parquet/arrow/reader.h`` and ``parquet/arrow/writer.h``) live in a separate
+library, so linking ``Arrow::arrow_shared`` alone is not enough. Look up the
+Parquet package as well and link its target:
+
+.. code-block:: cmake
+
+ cmake_minimum_required(VERSION 3.25)
+
+ project(MyExample)
+
+ find_package(Arrow REQUIRED)
+ find_package(Parquet REQUIRED)
+
+ add_executable(my_example my_example.cc)
+ target_link_libraries(my_example PRIVATE Arrow::arrow_shared
+ Parquet::parquet_shared)
+
+Use ``Parquet::parquet_static`` instead if you are linking the static
libraries.
Review Comment:
This instruction only switches the Parquet target to static while the
example above still links `Arrow::arrow_shared`. `Parquet::parquet_static`
advertises `Arrow::arrow_static` as its install-interface dependency
(`cpp/src/parquet/CMakeLists.txt:120-122`), so following this literally mixes
static Parquet with shared Arrow and can produce an invalid or inconsistent
link. Please state that both targets must use their static variants (or show a
separate static example).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]