You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2018/12/02 03:52:48 UTC

[arrow] branch master updated: ARROW-3898: [Example] parquet-arrow example has compilation errors

This is an automated email from the ASF dual-hosted git repository.

wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new e453f5c  ARROW-3898: [Example] parquet-arrow example has compilation errors
e453f5c is described below

commit e453f5c6e0636f6a3ad489db0fa09adc76bcf582
Author: Wes McKinney <we...@apache.org>
AuthorDate: Sat Dec 1 21:52:41 2018 -0600

    ARROW-3898: [Example] parquet-arrow example has compilation errors
    
    When compiling example, reader-writer.cc, it shows following compilation errors:
    
    no member named 'cout' in namespace 'std'
    
      PARQUET_THROW_NOT_OK(arrow::PrettyPrint(*array, 4, &std::cout));
    
    in multiple places.
    
    Fix:
    Add the #include<iostream>
    Test:
    make passed
    
    Author: Wes McKinney <we...@apache.org>
    Author: wangmiao1981 <wm...@hotmail.com>
    
    Closes #3049 from wangmiao1981/example and squashes the following commits:
    
    ecca664a2 <Wes McKinney> Build all examples in examples/parquet when PARQUET_BUILD_EXAMPLES=ON
    64d51b214 <wangmiao1981> add include file
---
 cpp/CMakeLists.txt                                 |  4 +++-
 .../parquet/{low-level-api => }/CMakeLists.txt     | 24 ++++++++++++----------
 cpp/examples/parquet/parquet-arrow/CMakeLists.txt  | 10 +++------
 .../parquet/parquet-arrow/src/reader-writer.cc     |  1 +
 4 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 8436e65..14621e4 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -803,7 +803,9 @@ endif()
 if(ARROW_PARQUET)
   add_subdirectory(src/parquet)
   add_subdirectory(tools/parquet)
-  add_subdirectory(examples/parquet/low-level-api)
+  if (PARQUET_BUILD_EXAMPLES)
+    add_subdirectory(examples/parquet)
+  endif()
 endif()
 
 if(ARROW_GANDIVA)
diff --git a/cpp/examples/parquet/low-level-api/CMakeLists.txt b/cpp/examples/parquet/CMakeLists.txt
similarity index 53%
rename from cpp/examples/parquet/low-level-api/CMakeLists.txt
rename to cpp/examples/parquet/CMakeLists.txt
index 26e8220..98c5cd9 100644
--- a/cpp/examples/parquet/low-level-api/CMakeLists.txt
+++ b/cpp/examples/parquet/CMakeLists.txt
@@ -15,15 +15,17 @@
 # specific language governing permissions and limitations
 # under the License.
 
-if (PARQUET_BUILD_EXAMPLES)
-  add_executable(parquet-reader-writer reader-writer.cc)
-  add_executable(parquet-reader-writer2 reader-writer2.cc)
-  target_include_directories(parquet-reader-writer PRIVATE .)
-  target_include_directories(parquet-reader-writer2 PRIVATE .)
-  target_link_libraries(parquet-reader-writer parquet_static)
-  target_link_libraries(parquet-reader-writer2 parquet_static)
+add_executable(parquet-low-level-example low-level-api/reader-writer.cc)
+add_executable(parquet-low-level-example2 low-level-api/reader-writer2.cc)
+target_include_directories(parquet-low-level-example PRIVATE low-level-api/)
+target_include_directories(parquet-low-level-example2 PRIVATE low-level-api/)
+target_link_libraries(parquet-low-level-example parquet_static)
+target_link_libraries(parquet-low-level-example2 parquet_static)
 
-  add_dependencies(parquet
-    parquet-reader-writer
-    parquet-reader-writer2)
-endif()
+add_executable(parquet-arrow-example parquet-arrow/src/reader-writer.cc)
+target_link_libraries(parquet-arrow-example parquet_shared)
+
+add_dependencies(parquet
+  parquet-low-level-example
+  parquet-low-level-example2
+  parquet-arrow-example)
diff --git a/cpp/examples/parquet/parquet-arrow/CMakeLists.txt b/cpp/examples/parquet/parquet-arrow/CMakeLists.txt
index 892ec92..d9e01ac 100644
--- a/cpp/examples/parquet/parquet-arrow/CMakeLists.txt
+++ b/cpp/examples/parquet/parquet-arrow/CMakeLists.txt
@@ -32,15 +32,11 @@ set(CMAKE_CXX_STANDARD 11)
 # We require a C++11 compliant compiler
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 
-# First search the packages in the system. If they are not found, use CMake's
-# ExternalProject mechanism to build them locally.
+# Look for installed packages the system
 find_package(Arrow)
 find_package(Parquet)
 
 include_directories(SYSTEM ${ARROW_INCLUDE_DIR} ${PARQUET_INCLUDE_DIR})
 
-add_executable(parquet-arrow-reader-writer src/reader-writer.cc)
-target_link_libraries(parquet-arrow-reader-writer ${PARQUET_SHARED_LIB} ${ARROW_SHARED_LIB})
-if (ARROW_VENDORED)
-  add_dependencies(parquet-arrow-reader-writer arrow_ep)
-endif()
+add_executable(parquet-arrow-example src/reader-writer.cc)
+target_link_libraries(parquet-arrow-example ${PARQUET_SHARED_LIB} ${ARROW_SHARED_LIB})
diff --git a/cpp/examples/parquet/parquet-arrow/src/reader-writer.cc b/cpp/examples/parquet/parquet-arrow/src/reader-writer.cc
index 8154d7a..8d47448 100644
--- a/cpp/examples/parquet/parquet-arrow/src/reader-writer.cc
+++ b/cpp/examples/parquet/parquet-arrow/src/reader-writer.cc
@@ -15,6 +15,7 @@
 // specific language governing permissions and limitations
 // under the License.
 
+#include <iostream>
 #include <arrow/api.h>
 #include <arrow/io/api.h>
 #include <parquet/arrow/reader.h>