diff --git a/contrib/arrow-cmake/CMakeLists.txt b/contrib/arrow-cmake/CMakeLists.txt index ccf3021d143..335106cc7ca 100644 --- a/contrib/arrow-cmake/CMakeLists.txt +++ b/contrib/arrow-cmake/CMakeLists.txt @@ -102,10 +102,16 @@ add_subdirectory(${FLATBUFFERS_SRC_DIR} "${FLATBUFFERS_BINARY_DIR}") set(ARROW_IPC_SRC_DIR ${ARROW_SRC_DIR}/arrow/ipc) set(ARROW_FORMAT_SRC_DIR ${ARROW_SRC_DIR}/../../format) -set(FLATBUFFERS_COMPILED_OUT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/cpp/src/arrow/ipc) +set(ARROW_GENERATED_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/arrow_gen_headers) +set(FLATBUFFERS_COMPILED_OUT_DIR ${ARROW_GENERATED_INCLUDE_DIR}/arrow/ipc) -set(FBS_OUTPUT_FILES "${FLATBUFFERS_COMPILED_OUT_DIR}/File_generated.h" "${FLATBUFFERS_COMPILED_OUT_DIR}/Message_generated.h" - "${FLATBUFFERS_COMPILED_OUT_DIR}/feather_generated.h") +set(FBS_OUTPUT_FILES + "${FLATBUFFERS_COMPILED_OUT_DIR}/File_generated.h" + "${FLATBUFFERS_COMPILED_OUT_DIR}/Message_generated.h" + "${FLATBUFFERS_COMPILED_OUT_DIR}/feather_generated.h" + "${FLATBUFFERS_COMPILED_OUT_DIR}/Schema_generated.h" + "${FLATBUFFERS_COMPILED_OUT_DIR}/SparseTensor_generated.h" + "${FLATBUFFERS_COMPILED_OUT_DIR}/Tensor_generated.h") set(FBS_SRC ${ARROW_FORMAT_SRC_DIR}/Message.fbs @@ -137,7 +143,7 @@ add_custom_command(OUTPUT ${FBS_OUTPUT_FILES} add_custom_target(metadata_fbs DEPENDS ${FBS_OUTPUT_FILES}) add_dependencies(metadata_fbs flatc) -# arrow-cmake cmake file calling orc cmake subroutine which detects certain compiler features. +# arrow-cmake cmake file calling orc cmake subroutine which detects certain compiler features. # Apple Clang compiler failed to compile this code without specifying c++11 standard. # As result these compiler features detected as absent. In result it failed to compile orc itself. # In orc makefile there is code that sets flags, but arrow-cmake ignores these flags. @@ -231,12 +237,10 @@ set(ARROW_SRCS ${LIBRARY_DIR}/ipc/dictionary.cc ${LIBRARY_DIR}/ipc/feather.cc -# ${LIBRARY_DIR}/ipc/file_to_stream.cc ${LIBRARY_DIR}/ipc/message.cc ${LIBRARY_DIR}/ipc/metadata_internal.cc ${LIBRARY_DIR}/ipc/options.cc ${LIBRARY_DIR}/ipc/reader.cc -# ${LIBRARY_DIR}/ipc/stream_to_file.cc ${LIBRARY_DIR}/ipc/writer.cc ${LIBRARY_DIR}/io/buffered.cc @@ -249,8 +253,6 @@ set(ARROW_SRCS ${LIBRARY_DIR}/util/basic_decimal.cc ${LIBRARY_DIR}/util/bit_util.cc - # ${LIBRARY_DIR}/util/compression_brotli.cc -# ${LIBRARY_DIR}/util/compression_bz2.cc ${LIBRARY_DIR}/util/compression.cc ${LIBRARY_DIR}/util/compression_lz4.cc ${LIBRARY_DIR}/util/compression_snappy.cc @@ -268,7 +270,6 @@ set(ARROW_SRCS ${LIBRARY_DIR}/util/task_group.cc ${LIBRARY_DIR}/util/thread_pool.cc ${LIBRARY_DIR}/util/trie.cc - # ${LIBRARY_DIR}/util/uri.cc ${LIBRARY_DIR}/util/utf8.cc ${LIBRARY_DIR}/vendored/base64.cpp @@ -356,6 +357,8 @@ target_include_directories(${ARROW_LIBRARY} PRIVATE SYSTEM ${ORC_BUILD_INCLUDE_D target_include_directories(${ARROW_LIBRARY} PRIVATE SYSTEM ${ORC_ADDITION_SOURCE_DIR}) target_include_directories(${ARROW_LIBRARY} PRIVATE SYSTEM ${ARROW_SRC_DIR}) target_include_directories(${ARROW_LIBRARY} PRIVATE SYSTEM ${FLATBUFFERS_INCLUDE_DIR}) +target_include_directories(${ARROW_LIBRARY} PRIVATE SYSTEM ${ARROW_GENERATED_INCLUDE_DIR}) + # === parquet set(LIBRARY_DIR ${ClickHouse_SOURCE_DIR}/contrib/arrow/cpp/src/parquet) diff --git a/contrib/arrow-cmake/cpp/src/arrow/ipc/File_generated.h b/contrib/arrow-cmake/cpp/src/arrow/ipc/File_generated.h deleted file mode 100644 index 37e2f9c7ea4..00000000000 --- a/contrib/arrow-cmake/cpp/src/arrow/ipc/File_generated.h +++ /dev/null @@ -1,181 +0,0 @@ -// automatically generated by the FlatBuffers compiler, do not modify - - -#ifndef FLATBUFFERS_GENERATED_FILE_ORG_APACHE_ARROW_FLATBUF_H_ -#define FLATBUFFERS_GENERATED_FILE_ORG_APACHE_ARROW_FLATBUF_H_ - -#include "flatbuffers/flatbuffers.h" - -#include "Schema_generated.h" - -namespace org { -namespace apache { -namespace arrow { -namespace flatbuf { - -struct Footer; - -struct Block; - -FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Block FLATBUFFERS_FINAL_CLASS { - private: - int64_t offset_; - int32_t metaDataLength_; - int32_t padding0__; - int64_t bodyLength_; - - public: - Block() { - memset(static_cast(this), 0, sizeof(Block)); - } - Block(int64_t _offset, int32_t _metaDataLength, int64_t _bodyLength) - : offset_(flatbuffers::EndianScalar(_offset)), - metaDataLength_(flatbuffers::EndianScalar(_metaDataLength)), - padding0__(0), - bodyLength_(flatbuffers::EndianScalar(_bodyLength)) { - (void)padding0__; - } - /// Index to the start of the RecordBlock (note this is past the Message header) - int64_t offset() const { - return flatbuffers::EndianScalar(offset_); - } - /// Length of the metadata - int32_t metaDataLength() const { - return flatbuffers::EndianScalar(metaDataLength_); - } - /// Length of the data (this is aligned so there can be a gap between this and - /// the metatdata). - int64_t bodyLength() const { - return flatbuffers::EndianScalar(bodyLength_); - } -}; -FLATBUFFERS_STRUCT_END(Block, 24); - -/// ---------------------------------------------------------------------- -/// Arrow File metadata -/// -struct Footer FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { - enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { - VT_VERSION = 4, - VT_SCHEMA = 6, - VT_DICTIONARIES = 8, - VT_RECORDBATCHES = 10 - }; - MetadataVersion version() const { - return static_cast(GetField(VT_VERSION, 0)); - } - const Schema *schema() const { - return GetPointer(VT_SCHEMA); - } - const flatbuffers::Vector *dictionaries() const { - return GetPointer *>(VT_DICTIONARIES); - } - const flatbuffers::Vector *recordBatches() const { - return GetPointer *>(VT_RECORDBATCHES); - } - bool Verify(flatbuffers::Verifier &verifier) const { - return VerifyTableStart(verifier) && - VerifyField(verifier, VT_VERSION) && - VerifyOffset(verifier, VT_SCHEMA) && - verifier.VerifyTable(schema()) && - VerifyOffset(verifier, VT_DICTIONARIES) && - verifier.VerifyVector(dictionaries()) && - VerifyOffset(verifier, VT_RECORDBATCHES) && - verifier.VerifyVector(recordBatches()) && - verifier.EndTable(); - } -}; - -struct FooterBuilder { - flatbuffers::FlatBufferBuilder &fbb_; - flatbuffers::uoffset_t start_; - void add_version(MetadataVersion version) { - fbb_.AddElement(Footer::VT_VERSION, static_cast(version), 0); - } - void add_schema(flatbuffers::Offset schema) { - fbb_.AddOffset(Footer::VT_SCHEMA, schema); - } - void add_dictionaries(flatbuffers::Offset> dictionaries) { - fbb_.AddOffset(Footer::VT_DICTIONARIES, dictionaries); - } - void add_recordBatches(flatbuffers::Offset> recordBatches) { - fbb_.AddOffset(Footer::VT_RECORDBATCHES, recordBatches); - } - explicit FooterBuilder(flatbuffers::FlatBufferBuilder &_fbb) - : fbb_(_fbb) { - start_ = fbb_.StartTable(); - } - FooterBuilder &operator=(const FooterBuilder &); - flatbuffers::Offset