Will Jones created ARROW-17298:
----------------------------------

             Summary: [C++][Docs] Add Acero project example in Getting Started 
Section
                 Key: ARROW-17298
                 URL: https://issues.apache.org/jira/browse/ARROW-17298
             Project: Apache Arrow
          Issue Type: Improvement
          Components: Documentation
            Reporter: Will Jones
             Fix For: 10.0.0


>From [~westonpace]:

{quote}
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)

{code}
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)
{code}
{quote}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to