Integrating Paimon C++#
This section assumes that you have already built and installed the Paimon C++ libraries on your system after building them yourself. Additionally, you will need Apache Arrow for C++ as in-memory data format interface. Please ensure that Arrow C++ is installed and available to your build system
The recommended way to integrate the Paimon C++ libraries into your C++ project is to use CMake’s find_package function to locate and integrate dependencies.
CMake#
Quick Start#
This CMakeLists.txt compiles the my_example.cc source file into
an executable and links it with the Paimon C++ shared library and its plugins
for data format and file system.
cmake_minimum_required(VERSION 3.16)
project(MyExample)
find_package(Arrow REQUIRED)
find_package(Paimon REQUIRED)
add_executable(my_example my_example.cc)
target_link_libraries(my_example PRIVATE arrow_shared
paimon_shared
paimon_parquet_file_format_shared
paimon_local_file_system_shared)
Available variables and targets#
The directive find_package(Paimon REQUIRED) instructs CMake to locate a
Paimon C++ installation on your system. If successful, it sets Paimon_FOUND
to true if the Paimon C++ libraries were found.
It also defines the following linkable targets (plain strings, not variables):
paimon_sharedlinks to the Paimon shared librariespaimon_staticlinks to the Paimon static libraries
In most cases, it is recommended to use the Paimon shared libraries.
Optional plugins (built-in file formats, file systems, and index)#
Paimon provides a set of built-in optional plugins that you can link to as needed:
File format plugins:
paimon_parquet_file_format_shared/paimon_parquet_file_format_staticpaimon_orc_file_format_shared/paimon_orc_file_format_staticpaimon_avro_file_format_shared/paimon_avro_file_format_staticpaimon_blob_file_format_shared/paimon_blob_file_format_staticpaimon_lance_file_format_shared/paimon_lance_file_format_static
File system plugins:
paimon_local_file_system_shared/paimon_local_file_system_staticpaimon_jindo_file_system_shared/paimon_jindo_file_system_static
Index plugins:
paimon_file_index_shared/paimon_file_index_staticpaimon_lumina_index_shared/paimon_lumina_index_static
Note
In most cases, it is recommended to use the shared variants of these plugins.