Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-17298

[C++][Docs] Add Acero project example in Getting Started Section

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • 11.0.0
    • Documentation
    • None

    Description

      From westonpace:

      A request I've seen a few times (and just received now) has been...
      Can you point me at a sample C++ starter project that links against Acero? For example, I tend to use a CMakeLists.txt that looks something like...
      cmake_minimum_required(VERSION 3.10)

      set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}")
      set(CMAKE_CXX_FLAGS "-Wall -Wextra")
      # set(CMAKE_CXX_FLAGS_DEBUG "-g")
      set(CMAKE_CXX_FLAGS_RELEASE "-O3")
      
      # set the project name
      project(Experiments VERSION 1.0)
      
      # specify the C++ standard
      set(CMAKE_CXX_STANDARD 17)
      set(CMAKE_CXX_STANDARD_REQUIRED True)
      
      set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
      
      if(NOT DEFINED CONDA_HOME)
        message(FATAL_ERROR "CONDA_HOME is a required variable")
      endif()
      
      include_directories(SYSTEM ${CONDA_HOME}/include)
      link_directories(${CONDA_HOME}/lib64)
      link_directories(${CONDA_HOME}/lib)
      
      function(experiment TARGET)
          add_executable(
                  ${TARGET}
                  ${TARGET}.cc
          )
          target_link_libraries(
                  ${TARGET}
                  arrow
                  arrow_dataset
                  parquet
                  aws-cpp-sdk-core
                  aws-cpp-sdk-s3
                  glog
                  pthread
                  re2
                  utf8proc
                  lz4
                  snappy
                  z
                  zstd
                  aws-cpp-sdk-identity-management
                  thrift
          )
          if (MSVC)
              target_compile_options(${TARGET} PRIVATE /W4 /WX)
          else ()
              target_compile_options(${TARGET} PRIVATE -Wall -Wextra -Wpedantic -Werror)
          endif ()
      endfunction()
      
      experiment(arrow_16642)
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              wjones127 Will Jones
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: