diff --git a/flex/CMakeLists.txt b/flex/CMakeLists.txt index 32e811c2baed..b4a63a3bdd8b 100644 --- a/flex/CMakeLists.txt +++ b/flex/CMakeLists.txt @@ -121,6 +121,27 @@ find_package(Boost REQUIRED COMPONENTS system filesystem context program_options regex thread date_time) add_definitions("-DBOOST_BIND_GLOBAL_PLACEHOLDERS") +include("cmake/FindBrotliAlt.cmake") +if (NOT BrotliAlt_FOUND) + message(FATAL_ERROR "brotli not found, please install the brotli library") +else () + include_directories(SYSTEM ${BrotliAlt_INCLUDE_DIRS}) +endif() + +include("cmake/Findutf8proc.cmake") +if (NOT utf8proc_FOUND) + message(FATAL_ERROR "utf8proc not found, please install the utf8proc library") +else () + include_directories(SYSTEM ${utf8proc_INCLUDE_DIRS}) +endif () + +include("cmake/FindzstdAlt.cmake") +if (NOT zstdAlt_FOUND) + message(FATAL_ERROR "zstd not found, please install the zstd library") +else () + include_directories(SYSTEM ${zstdAlt_INCLUDE_DIRS}) +endif () + #find arrow---------------------------------------------------------------------- include("cmake/FindArrow.cmake") if (NOT ARROW_FOUND) diff --git a/flex/cmake/FindBrotliAlt.cmake b/flex/cmake/FindBrotliAlt.cmake new file mode 100644 index 000000000000..b6b14fc6d071 --- /dev/null +++ b/flex/cmake/FindBrotliAlt.cmake @@ -0,0 +1,165 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Tries to find Brotli headers and libraries. +# +# Usage of this module as follows: +# +# find_package(BrotliAlt) + +if(BrotliAlt_FOUND) + return() +endif() + +if(ARROW_PACKAGE_KIND STREQUAL "vcpkg" OR ARROW_PACKAGE_KIND STREQUAL "conan") + set(find_package_args "") + if(BrotliAlt_FIND_VERSION) + list(APPEND find_package_args ${BrotliAlt_FIND_VERSION}) + endif() + if(BrotliAlt_FIND_QUIETLY) + list(APPEND find_package_args QUIET) + endif() + if(BrotliAlt_FIND_REQUIRED) + list(APPEND find_package_args REQUIRED) + endif() + if(ARROW_PACKAGE_KIND STREQUAL "vcpkg") + find_package(BrotliAlt NAMES unofficial-brotli ${find_package_args}) + else() + find_package(BrotliAlt NAMES brotli ${find_package_args}) + endif() + set(Brotli_FOUND ${BrotliAlt_FOUND}) + if(BrotliAlt_FOUND) + if(ARROW_PACKAGE_KIND STREQUAL "vcpkg") + add_library(Brotli::brotlicommon ALIAS unofficial::brotli::brotlicommon) + add_library(Brotli::brotlienc ALIAS unofficial::brotli::brotlienc) + add_library(Brotli::brotlidec ALIAS unofficial::brotli::brotlidec) + else() + add_library(Brotli::brotlicommon ALIAS brotli::brotlicommon) + add_library(Brotli::brotlienc ALIAS brotli::brotlienc) + add_library(Brotli::brotlidec ALIAS brotli::brotlidec) + endif() + return() + endif() +endif() + +if(ARROW_BROTLI_USE_SHARED) + set(BROTLI_COMMON_LIB_NAMES + brotlicommon + ${CMAKE_SHARED_LIBRARY_PREFIX}brotlicommon${CMAKE_SHARED_LIBRARY_SUFFIX}) + + set(BROTLI_ENC_LIB_NAMES + brotlienc ${CMAKE_SHARED_LIBRARY_PREFIX}brotlienc${CMAKE_SHARED_LIBRARY_SUFFIX}) + + set(BROTLI_DEC_LIB_NAMES + brotlidec ${CMAKE_SHARED_LIBRARY_PREFIX}brotlidec${CMAKE_SHARED_LIBRARY_SUFFIX}) +else() + set(BROTLI_COMMON_LIB_NAMES + brotlicommon-static + ${CMAKE_STATIC_LIBRARY_PREFIX}brotlicommon-static${CMAKE_STATIC_LIBRARY_SUFFIX} + ${CMAKE_STATIC_LIBRARY_PREFIX}brotlicommon_static${CMAKE_STATIC_LIBRARY_SUFFIX} + ${CMAKE_STATIC_LIBRARY_PREFIX}brotlicommon${CMAKE_STATIC_LIBRARY_SUFFIX}) + + set(BROTLI_ENC_LIB_NAMES + brotlienc-static + ${CMAKE_STATIC_LIBRARY_PREFIX}brotlienc-static${CMAKE_STATIC_LIBRARY_SUFFIX} + ${CMAKE_STATIC_LIBRARY_PREFIX}brotlienc_static${CMAKE_STATIC_LIBRARY_SUFFIX} + ${CMAKE_STATIC_LIBRARY_PREFIX}brotlienc${CMAKE_STATIC_LIBRARY_SUFFIX}) + + set(BROTLI_DEC_LIB_NAMES + brotlidec-static + ${CMAKE_STATIC_LIBRARY_PREFIX}brotlidec-static${CMAKE_STATIC_LIBRARY_SUFFIX} + ${CMAKE_STATIC_LIBRARY_PREFIX}brotlidec_static${CMAKE_STATIC_LIBRARY_SUFFIX} + ${CMAKE_STATIC_LIBRARY_PREFIX}brotlidec${CMAKE_STATIC_LIBRARY_SUFFIX}) +endif() + +if(BROTLI_ROOT) + find_library(BROTLI_COMMON_LIBRARY + NAMES ${BROTLI_COMMON_LIB_NAMES} + PATHS ${BROTLI_ROOT} + PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES} + NO_DEFAULT_PATH) + find_library(BROTLI_ENC_LIBRARY + NAMES ${BROTLI_ENC_LIB_NAMES} + PATHS ${BROTLI_ROOT} + PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES} + NO_DEFAULT_PATH) + find_library(BROTLI_DEC_LIBRARY + NAMES ${BROTLI_DEC_LIB_NAMES} + PATHS ${BROTLI_ROOT} + PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES} + NO_DEFAULT_PATH) + find_path(BROTLI_INCLUDE_DIR + NAMES brotli/decode.h + PATHS ${BROTLI_ROOT} + PATH_SUFFIXES ${ARROW_INCLUDE_PATH_SUFFIXES} + NO_DEFAULT_PATH) +else() + find_package(PkgConfig QUIET) + pkg_check_modules(BROTLI_PC libbrotlicommon libbrotlienc libbrotlidec) + if(BROTLI_PC_FOUND) + set(BROTLI_INCLUDE_DIR "${BROTLI_PC_libbrotlicommon_INCLUDEDIR}") + + # Some systems (e.g. Fedora) don't fill Brotli_LIBRARY_DIRS, so add the other dirs here. + list(APPEND BROTLI_PC_LIBRARY_DIRS "${BROTLI_PC_libbrotlicommon_LIBDIR}") + list(APPEND BROTLI_PC_LIBRARY_DIRS "${BROTLI_PC_libbrotlienc_LIBDIR}") + list(APPEND BROTLI_PC_LIBRARY_DIRS "${BROTLI_PC_libbrotlidec_LIBDIR}") + + find_library(BROTLI_COMMON_LIBRARY + NAMES ${BROTLI_COMMON_LIB_NAMES} + PATHS ${BROTLI_PC_LIBRARY_DIRS} + PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES} + NO_DEFAULT_PATH) + find_library(BROTLI_ENC_LIBRARY + NAMES ${BROTLI_ENC_LIB_NAMES} + PATHS ${BROTLI_PC_LIBRARY_DIRS} + PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES} + NO_DEFAULT_PATH) + find_library(BROTLI_DEC_LIBRARY + NAMES ${BROTLI_DEC_LIB_NAMES} + PATHS ${BROTLI_PC_LIBRARY_DIRS} + PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES} + NO_DEFAULT_PATH) + else() + find_library(BROTLI_COMMON_LIBRARY + NAMES ${BROTLI_COMMON_LIB_NAMES} + PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES}) + find_library(BROTLI_ENC_LIBRARY + NAMES ${BROTLI_ENC_LIB_NAMES} + PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES}) + find_library(BROTLI_DEC_LIBRARY + NAMES ${BROTLI_DEC_LIB_NAMES} + PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES}) + find_path(BROTLI_INCLUDE_DIR + NAMES brotli/decode.h + PATH_SUFFIXES ${ARROW_INCLUDE_PATH_SUFFIXES}) + endif() +endif() + +find_package_handle_standard_args( + BrotliAlt REQUIRED_VARS BROTLI_COMMON_LIBRARY BROTLI_ENC_LIBRARY BROTLI_DEC_LIBRARY + BROTLI_INCLUDE_DIR) +set(Brotli_FOUND ${BrotliAlt_FOUND}) +if(BrotliAlt_FOUND) + add_library(Brotli::brotlicommon UNKNOWN IMPORTED) + set_target_properties(Brotli::brotlicommon + PROPERTIES IMPORTED_LOCATION "${BROTLI_COMMON_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${BROTLI_INCLUDE_DIR}") + add_library(Brotli::brotlienc UNKNOWN IMPORTED) + set_target_properties(Brotli::brotlienc + PROPERTIES IMPORTED_LOCATION "${BROTLI_ENC_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${BROTLI_INCLUDE_DIR}") + add_library(Brotli::brotlidec UNKNOWN IMPORTED) + set_target_properties(Brotli::brotlidec + PROPERTIES IMPORTED_LOCATION "${BROTLI_DEC_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${BROTLI_INCLUDE_DIR}") +endif() \ No newline at end of file diff --git a/flex/cmake/Findutf8proc.cmake b/flex/cmake/Findutf8proc.cmake new file mode 100644 index 000000000000..e34741409054 --- /dev/null +++ b/flex/cmake/Findutf8proc.cmake @@ -0,0 +1,123 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +if(utf8proc_FOUND) + return() +endif() + +if(ARROW_PACKAGE_KIND STREQUAL "vcpkg") + set(find_package_args "") + if(utf8proc_FIND_VERSION) + list(APPEND find_package_args ${utf8proc_FIND_VERSION}) + endif() + if(utf8proc_FIND_QUIETLY) + list(APPEND find_package_args QUIET) + endif() + if(utf8proc_FIND_REQUIRED) + list(APPEND find_package_args REQUIRED) + endif() + find_package(utf8proc NAMES unofficial-utf8proc ${find_package_args}) + if(utf8proc_FOUND) + add_library(utf8proc::utf8proc ALIAS utf8proc) + return() + endif() +endif() + +function(extract_utf8proc_version) + if(utf8proc_INCLUDE_DIR) + file(READ "${utf8proc_INCLUDE_DIR}/utf8proc.h" UTF8PROC_H_CONTENT) + + string(REGEX MATCH "#define UTF8PROC_VERSION_MAJOR [0-9]+" + UTF8PROC_MAJOR_VERSION_DEFINITION "${UTF8PROC_H_CONTENT}") + string(REGEX MATCH "#define UTF8PROC_VERSION_MINOR [0-9]+" + UTF8PROC_MINOR_VERSION_DEFINITION "${UTF8PROC_H_CONTENT}") + string(REGEX MATCH "#define UTF8PROC_VERSION_PATCH [0-9]+" + UTF8PROC_PATCH_VERSION_DEFINITION "${UTF8PROC_H_CONTENT}") + + string(REGEX MATCH "[0-9]+$" UTF8PROC_MAJOR_VERSION + "${UTF8PROC_MAJOR_VERSION_DEFINITION}") + string(REGEX MATCH "[0-9]+$" UTF8PROC_MINOR_VERSION + "${UTF8PROC_MINOR_VERSION_DEFINITION}") + string(REGEX MATCH "[0-9]+$" UTF8PROC_PATCH_VERSION + "${UTF8PROC_PATCH_VERSION_DEFINITION}") + set(utf8proc_VERSION + "${UTF8PROC_MAJOR_VERSION}.${UTF8PROC_MINOR_VERSION}.${UTF8PROC_PATCH_VERSION}" + PARENT_SCOPE) + else() + set(utf8proc_VERSION + "" + PARENT_SCOPE) + endif() +endfunction(extract_utf8proc_version) + +if(ARROW_UTF8PROC_USE_SHARED) + set(utf8proc_LIB_NAMES) + if(CMAKE_IMPORT_LIBRARY_SUFFIX) + list(APPEND utf8proc_LIB_NAMES + "${CMAKE_IMPORT_LIBRARY_PREFIX}utf8proc${CMAKE_IMPORT_LIBRARY_SUFFIX}") + endif() + list(APPEND utf8proc_LIB_NAMES + "${CMAKE_SHARED_LIBRARY_PREFIX}utf8proc${CMAKE_SHARED_LIBRARY_SUFFIX}") +else() + if(MSVC AND NOT DEFINED utf8proc_MSVC_STATIC_LIB_SUFFIX) + set(utf8proc_MSVC_STATIC_LIB_SUFFIX "_static") + endif() + set(utf8proc_STATIC_LIB_SUFFIX + "${utf8proc_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") + set(utf8proc_LIB_NAMES + "${CMAKE_STATIC_LIBRARY_PREFIX}utf8proc${utf8proc_STATIC_LIB_SUFFIX}") +endif() + +if(utf8proc_ROOT) + find_library(utf8proc_LIB + NAMES ${utf8proc_LIB_NAMES} + PATHS ${utf8proc_ROOT} + PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES} + NO_DEFAULT_PATH) + find_path(utf8proc_INCLUDE_DIR + NAMES utf8proc.h + PATHS ${utf8proc_ROOT} + NO_DEFAULT_PATH + PATH_SUFFIXES ${ARROW_INCLUDE_PATH_SUFFIXES}) + extract_utf8proc_version() +else() + find_library(utf8proc_LIB + NAMES ${utf8proc_LIB_NAMES} + PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES}) + find_path(utf8proc_INCLUDE_DIR + NAMES utf8proc.h + PATH_SUFFIXES ${ARROW_INCLUDE_PATH_SUFFIXES}) + extract_utf8proc_version() +endif() + +find_package_handle_standard_args( + utf8proc + REQUIRED_VARS utf8proc_LIB utf8proc_INCLUDE_DIR + VERSION_VAR utf8proc_VERSION) + +if(utf8proc_FOUND) + set(utf8proc_FOUND TRUE) + add_library(utf8proc::utf8proc UNKNOWN IMPORTED) + set_target_properties(utf8proc::utf8proc + PROPERTIES IMPORTED_LOCATION "${utf8proc_LIB}" + INTERFACE_INCLUDE_DIRECTORIES + "${utf8proc_INCLUDE_DIR}") + if(NOT ARROW_UTF8PROC_USE_SHARED) + set_target_properties(utf8proc::utf8proc PROPERTIES INTERFACE_COMPILE_DEFINITIONS + "UTF8PROC_STATIC") + endif() +endif() diff --git a/flex/cmake/FindzstdAlt.cmake b/flex/cmake/FindzstdAlt.cmake new file mode 100644 index 000000000000..980cf265521d --- /dev/null +++ b/flex/cmake/FindzstdAlt.cmake @@ -0,0 +1,142 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +if(zstdAlt_FOUND) + return() +endif() + +set(find_package_args) +if(zstdAlt_FIND_VERSION) + list(APPEND find_package_args ${zstdAlt_FIND_VERSION}) +endif() +if(zstdAlt_FIND_QUIETLY) + list(APPEND find_package_args QUIET) +endif() +find_package(zstd ${find_package_args}) +if(zstd_FOUND) + set(zstdAlt_FOUND TRUE) + return() +endif() + +if(MSVC AND NOT DEFINED ZSTD_MSVC_LIB_PREFIX) + set(ZSTD_MSVC_LIB_PREFIX "lib") +endif() +set(ZSTD_LIB_NAME_BASE "${ZSTD_MSVC_LIB_PREFIX}zstd") + +if(ARROW_ZSTD_USE_SHARED) + set(ZSTD_LIB_NAMES) + if(CMAKE_IMPORT_LIBRARY_SUFFIX) + list(APPEND + ZSTD_LIB_NAMES + "${CMAKE_IMPORT_LIBRARY_PREFIX}${ZSTD_LIB_NAME_BASE}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + ) + endif() + list(APPEND ZSTD_LIB_NAMES + "${CMAKE_SHARED_LIBRARY_PREFIX}${ZSTD_LIB_NAME_BASE}${CMAKE_SHARED_LIBRARY_SUFFIX}" + ) +else() + if(MSVC AND NOT DEFINED ZSTD_MSVC_STATIC_LIB_SUFFIX) + set(ZSTD_MSVC_STATIC_LIB_SUFFIX "_static") + endif() + set(ZSTD_STATIC_LIB_SUFFIX + "${ZSTD_MSVC_STATIC_LIB_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}") + set(ZSTD_LIB_NAMES + "${CMAKE_STATIC_LIBRARY_PREFIX}${ZSTD_LIB_NAME_BASE}${ZSTD_STATIC_LIB_SUFFIX}") +endif() + +# First, find via if specified ZSTD_ROOT +if(ZSTD_ROOT) + message(STATUS "Using ZSTD_ROOT: ${ZSTD_ROOT}") + find_library(ZSTD_LIB + NAMES ${ZSTD_LIB_NAMES} + PATHS ${ZSTD_ROOT} + PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES} + NO_DEFAULT_PATH) + find_path(ZSTD_INCLUDE_DIR + NAMES zstd.h + PATHS ${ZSTD_ROOT} + NO_DEFAULT_PATH + PATH_SUFFIXES ${ARROW_INCLUDE_PATH_SUFFIXES}) + +else() + # Second, find via pkg_check_modules + find_package(PkgConfig QUIET) + pkg_check_modules(ZSTD_PC libzstd) + if(ZSTD_PC_FOUND) + set(zstdAlt_VERSION "${ZSTD_PC_VERSION}") + set(ZSTD_INCLUDE_DIR "${ZSTD_PC_INCLUDEDIR}") + + list(APPEND ZSTD_PC_LIBRARY_DIRS "${ZSTD_PC_LIBDIR}") + find_library(ZSTD_LIB + NAMES ${ZSTD_LIB_NAMES} + PATHS ${ZSTD_PC_LIBRARY_DIRS} + NO_DEFAULT_PATH + PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES}) + else() + # Third, check all other CMake paths + find_library(ZSTD_LIB + NAMES ${ZSTD_LIB_NAMES} + PATH_SUFFIXES ${ARROW_LIBRARY_PATH_SUFFIXES}) + find_path(ZSTD_INCLUDE_DIR + NAMES zstd.h + PATH_SUFFIXES ${ARROW_INCLUDE_PATH_SUFFIXES}) + endif() +endif() + +if("${zstdAlt_VERSION}" STREQUAL "" AND ZSTD_INCLUDE_DIR) + file(READ "${ZSTD_INCLUDE_DIR}/zstd.h" ZSTD_H_CONTENT) + string(REGEX MATCH "#define ZSTD_VERSION_MAJOR +([0-9]+)" ZSTD_VERSION_MAJOR_DEFINITION + "${ZSTD_H_CONTENT}") + string(REGEX REPLACE "^.+ ([0-9]+)$" "\\1" ZSTD_VERSION_MAJOR + "${ZSTD_VERSION_MAJOR_DEFINITION}") + string(REGEX MATCH "#define ZSTD_VERSION_MINOR +([0-9]+)" ZSTD_VERSION_MINOR_DEFINITION + "${ZSTD_H_CONTENT}") + string(REGEX REPLACE "^.+ ([0-9]+)$" "\\1" ZSTD_VERSION_MINOR + "${ZSTD_VERSION_MINOR_DEFINITION}") + string(REGEX MATCH "#define ZSTD_VERSION_RELEASE +([0-9]+)" + ZSTD_VERSION_RELEASE_DEFINITION "${ZSTD_H_CONTENT}") + string(REGEX REPLACE "^.+ ([0-9]+)$" "\\1" ZSTD_VERSION_RELEASE + "${ZSTD_VERSION_RELEASE_DEFINITION}") + if("${ZSTD_VERSION_MAJOR}" STREQUAL "" + OR "${ZSTD_VERSION_MINOR}" STREQUAL "" + OR "${ZSTD_VERSION_RELEASE}" STREQUAL "") + set(zstdAlt_VERSION "0.0.0") + else() + set(zstdAlt_VERSION + "${ZSTD_VERSION_MAJOR}.${ZSTD_VERSION_MINOR}.${ZSTD_VERSION_RELEASE}") + endif() +endif() + +find_package_handle_standard_args( + zstdAlt + REQUIRED_VARS ZSTD_LIB ZSTD_INCLUDE_DIR + VERSION_VAR zstdAlt_VERSION) + +if(zstdAlt_FOUND) + if(ARROW_ZSTD_USE_SHARED) + set(zstd_TARGET zstd::libzstd_shared) + add_library(${zstd_TARGET} SHARED IMPORTED) + else() + set(zstd_TARGET zstd::libzstd_static) + add_library(${zstd_TARGET} STATIC IMPORTED) + endif() + set_target_properties(${zstd_TARGET} + PROPERTIES IMPORTED_LOCATION "${ZSTD_LIB}" + INTERFACE_INCLUDE_DIRECTORIES "${ZSTD_INCLUDE_DIR}") + message(STATUS "Zstandard library: ${ZSTD_LIB}") + message(STATUS "Zstandard include directory: ${ZSTD_INCLUDE_DIR}") +endif() diff --git a/flex/utils/arrow_utils.h b/flex/utils/arrow_utils.h index d17c00629136..e6436e7cad06 100644 --- a/flex/utils/arrow_utils.h +++ b/flex/utils/arrow_utils.h @@ -58,8 +58,13 @@ class LDBCTimeStampParser : public arrow::TimestampParser { return false; seconds_type seconds_since_epoch; +#if defined(ARROW_VERSION) && ARROW_VERSION < 15000000 if (ARROW_PREDICT_FALSE(!arrow::internal::detail::ParseYYYY_MM_DD( s, &seconds_since_epoch))) { +#else + if (ARROW_PREDICT_FALSE( + !arrow::internal::ParseYYYY_MM_DD(s, &seconds_since_epoch))) { +#endif return false; }