@@ -61,6 +61,7 @@ option(PAIMON_USE_CXX11_ABI "Use C++11 ABI" ON)
6161option (PAIMON_ENABLE_AVRO "Whether to enable avro file format" ON )
6262option (PAIMON_ENABLE_ORC "Whether to enable orc file format" ON )
6363option (PAIMON_ENABLE_MOSAIC "Whether to enable mosaic file format (Rust FFI)" OFF )
64+ option (PAIMON_ENABLE_LANCE "Whether to enable lance file format (Rust FFI)" OFF )
6465option (PAIMON_ENABLE_JINDO "Whether to enable jindo file system" OFF )
6566option (PAIMON_ENABLE_OSS "Whether to enable OSS SDK v2 file system" OFF )
6667option (PAIMON_ENABLE_S3 "Whether to enable S3 file system" OFF )
@@ -93,6 +94,9 @@ endif()
9394if (PAIMON_ENABLE_MOSAIC)
9495 add_definitions (-DPAIMON_ENABLE_MOSAIC )
9596endif ()
97+ if (PAIMON_ENABLE_LANCE)
98+ add_definitions (-DPAIMON_ENABLE_LANCE )
99+ endif ()
96100if (PAIMON_ENABLE_JINDO)
97101 add_definitions (-DPAIMON_ENABLE_JINDO )
98102endif ()
@@ -328,13 +332,21 @@ set(PAIMON_SHARED_PRIVATE_LINK_LIBS ${PAIMON_STATIC_LINK_LIBS})
328332add_subdirectory(third_party/roaring_bitmap EXCLUDE_FROM_ALL)
329333add_subdirectory(third_party/xxhash EXCLUDE_FROM_ALL)
330334
331- # ---- tantivy-fulltext Rust FFI via Corrosion-rs --------------------------------
332- # Corrosion wraps the Cargo crate as a CMake target named `paimon_tantivy_ffi`.
333- # `corrosion_experimental_cbindgen` runs cbindgen from CMake and writes the
334- # header to a stable path; it also adds that path to the target's INTERFACE
335- # include dirs so C++ consumers pick it up via target_link_libraries.
336- if(PAIMON_ENABLE_TANTIVY)
335+ # ---- Rust FFI crates via Corrosion-rs -------------------------------------------
336+ if(PAIMON_ENABLE_LANCE OR PAIMON_ENABLE_TANTIVY)
337337 include(CorrosionFetch)
338+ endif()
339+
340+ if(PAIMON_ENABLE_LANCE)
341+ find_program(PAIMON_LANCE_PROTOC protoc REQUIRED)
342+ corrosion_import_crate(MANIFEST_PATH crates/lance_ffi/Cargo.toml CRATES
343+ paimon_lance_ffi)
344+ corrosion_experimental_cbindgen(TARGET paimon_lance_ffi HEADER_NAME
345+ paimon_lance_ffi.h)
346+ corrosion_set_env_vars(paimon_lance_ffi " PROTOC=${PAIMON_LANCE_PROTOC} ")
347+ endif()
348+
349+ if(PAIMON_ENABLE_TANTIVY)
338350 corrosion_import_crate(MANIFEST_PATH crates/tantivy_ffi/Cargo.toml CRATES
339351 paimon_tantivy_ffi)
340352 corrosion_experimental_cbindgen(TARGET paimon_tantivy_ffi HEADER_NAME
@@ -403,6 +415,11 @@ if(PAIMON_BUILD_TESTS OR PAIMON_BUILD_BENCHMARKS)
403415 paimon_mosaic_file_format_static)
404416 endif()
405417
418+ if(PAIMON_ENABLE_LANCE)
419+ paimon_link_libraries_whole_archive(PAIMON_LANCE_FILE_FORMAT_STATIC_LINK_LIBS
420+ paimon_lance_file_format_static)
421+ endif()
422+
406423 if(PAIMON_ENABLE_ORC)
407424 paimon_link_libraries_whole_archive(PAIMON_ORC_FILE_FORMAT_STATIC_LINK_LIBS
408425 paimon_orc_file_format_static)
@@ -462,6 +479,14 @@ if(PAIMON_BUILD_TESTS)
462479 paimon_mosaic_file_format_static)
463480 endif()
464481
482+ if(PAIMON_ENABLE_LANCE)
483+ paimon_link_libraries_no_as_needed(TEST_PLUGIN_LINK_LIBS
484+ paimon_lance_file_format_shared)
485+ list(APPEND TEST_STATIC_LINK_LIBS ${TEST_PLUGIN_LINK_LIBS} )
486+ paimon_link_libraries_whole_archive(PAIMON_LANCE_FILE_FORMAT_STATIC_LINK_LIBS
487+ paimon_lance_file_format_static)
488+ endif()
489+
465490 if(PAIMON_ENABLE_ORC)
466491 paimon_link_libraries_no_as_needed(TEST_PLUGIN_LINK_LIBS
467492 paimon_orc_file_format_shared)
@@ -554,6 +579,9 @@ add_subdirectory(src/paimon/format/avro)
554579if(PAIMON_ENABLE_MOSAIC)
555580 add_subdirectory(src/paimon/format/mosaic)
556581endif()
582+ if(PAIMON_ENABLE_LANCE)
583+ add_subdirectory(src/paimon/format/lance)
584+ endif()
557585if(PAIMON_ENABLE_LUMINA)
558586 add_subdirectory(src/paimon/global_index/lumina)
559587endif()
0 commit comments