Skip to content

Commit ddae7c9

Browse files
authored
Merge branch 'main' into perf/manifest-row-range-cache
2 parents e681f76 + 7470e4c commit ddae7c9

106 files changed

Lines changed: 3383 additions & 10523 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.devcontainer/Dockerfile.template‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ RUN apt update && \
7171
vim \
7272
wget \
7373
sudo \
74-
# ---- additions for tantivy-fts migration (Rust + Sanitizer + LLVM) ----
74+
# ---- additions for the Rust FFI builds (Rust + Sanitizer + LLVM) ----
7575
clang \
7676
clang-format \
7777
clang-tidy \

‎.devcontainer/centos7/Dockerfile‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616
#
17-
# CentOS 7 cross-build verification image for paimon-cpp + tantivy-fts.
17+
# CentOS 7 cross-build verification image for paimon-cpp + the full-text index.
1818
#
1919
# Purpose:
20-
# Prove the tantivy-fts stack builds on the OLDEST reasonable Linux target
20+
# Prove the full-text index stack builds on the OLDEST reasonable Linux target
2121
# (glibc 2.17, EOL 2024-06-30). The default Ubuntu 24.04 dev container
2222
# proves nothing about glibc compatibility; this image does.
2323
#
@@ -95,7 +95,7 @@ enabled=0\n' > /etc/yum.repos.d/CentOS-Base.repo \
9595
# EPEL provides ninja-build and a newer python3 than the base 3.6.
9696
# SCL (Software Collections) provides devtoolset-11 (gcc 11) and rh-python38
9797
# without overriding the system gcc/python. CentOS 7's default gcc 4.8 is
98-
# too old for C++17/20 used by lucene++ and our tantivy wrapper.
98+
# too old for C++17/20 used by lucene++ and our full-text wrapper.
9999
#
100100
# Same story as CentOS-Base.repo: both epel + SCL default to mirrorlist
101101
# endpoints that are effectively dead; overwrite with aliyun URLs that we

‎.devcontainer/centos7/run.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,12 @@ case "${cmd}" in
107107
-DPAIMON_ENABLE_LUMINA=OFF \
108108
-DPAIMON_ENABLE_JINDO=OFF \
109109
-DPAIMON_ENABLE_LUCENE=ON \
110-
-DPAIMON_ENABLE_TANTIVY=ON \
110+
-DPAIMON_ENABLE_FULL_TEXT=ON \
111111
-DPAIMON_ENABLE_ORC=ON \
112112
-DPAIMON_ENABLE_AVRO=ON
113113
cmake --build build-centos7 -j "$(nproc)"
114114
ctest --test-dir build-centos7 \
115-
-R "paimon-lucene-index-test|paimon-global-index-test|paimon-tantivy-.*-test" \
115+
-R "paimon-lucene-index-test|paimon-global-index-test|paimon-full-text-index-test" \
116116
--output-on-failure
117117
'
118118
;;

‎.devcontainer/devcontainer.json.template‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@
4848
"source=${localEnv:HOME}/.ssh,target=/home/paimon/.ssh,type=bind,readonly",
4949
"source=paimon-cargo-registry,target=/home/paimon/.cargo/registry,type=volume",
5050
"source=paimon-cargo-git,target=/home/paimon/.cargo/git,type=volume",
51-
"source=paimon-rust-target,target=${containerWorkspaceFolder}/crates/tantivy_ffi/target,type=volume",
51+
"source=paimon-rust-target,target=${containerWorkspaceFolder}/crates/lance_ffi/target,type=volume",
5252
"source=paimon-build,target=${containerWorkspaceFolder}/build,type=volume",
5353
"source=paimon-ccache,target=/home/paimon/.ccache,type=volume"
5454
],
55-
"postCreateCommand": "sudo chown -R paimon:paimon ${containerWorkspaceFolder}/build ${containerWorkspaceFolder}/crates/tantivy_ffi/target /home/paimon/.ccache /home/paimon/.cargo/registry /home/paimon/.cargo/git 2>/dev/null || true; cargo install cbindgen --locked || true; rustup component add rust-src rust-analyzer clippy rustfmt || true",
55+
"postCreateCommand": "sudo chown -R paimon:paimon ${containerWorkspaceFolder}/build ${containerWorkspaceFolder}/crates/lance_ffi/target /home/paimon/.ccache /home/paimon/.cargo/registry /home/paimon/.cargo/git 2>/dev/null || true; cargo install cbindgen --locked || true; rustup component add rust-src rust-analyzer clippy rustfmt || true",
5656
"customizations": {
5757
"vscode": {
5858
"extensions": [
@@ -66,7 +66,7 @@
6666
"settings": {
6767
"editor.formatOnSave": true,
6868
"rust-analyzer.linkedProjects": [
69-
"crates/tantivy_ffi/Cargo.toml"
69+
"crates/lance_ffi/Cargo.toml"
7070
]
7171
}
7272
}

‎.devcontainer/x86_64/devcontainer.json.template‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@
5454
"source=${localEnv:HOME}/.ssh,target=/home/paimon/.ssh,type=bind,readonly",
5555
"source=paimon-cargo-registry-amd64,target=/home/paimon/.cargo/registry,type=volume",
5656
"source=paimon-cargo-git-amd64,target=/home/paimon/.cargo/git,type=volume",
57-
"source=paimon-rust-target-amd64,target=${containerWorkspaceFolder}/crates/tantivy_ffi/target,type=volume",
57+
"source=paimon-rust-target-amd64,target=${containerWorkspaceFolder}/crates/lance_ffi/target,type=volume",
5858
"source=paimon-build-amd64,target=${containerWorkspaceFolder}/build,type=volume",
5959
"source=paimon-ccache-amd64,target=/home/paimon/.ccache,type=volume"
6060
],
61-
"postCreateCommand": "sudo chown -R paimon:paimon ${containerWorkspaceFolder}/build ${containerWorkspaceFolder}/crates/tantivy_ffi/target /home/paimon/.ccache /home/paimon/.cargo/registry /home/paimon/.cargo/git 2>/dev/null || true; cargo install cbindgen --locked || true; rustup component add rust-src rust-analyzer clippy rustfmt || true",
61+
"postCreateCommand": "sudo chown -R paimon:paimon ${containerWorkspaceFolder}/build ${containerWorkspaceFolder}/crates/lance_ffi/target /home/paimon/.ccache /home/paimon/.cargo/registry /home/paimon/.cargo/git 2>/dev/null || true; cargo install cbindgen --locked || true; rustup component add rust-src rust-analyzer clippy rustfmt || true",
6262
"customizations": {
6363
"vscode": {
6464
"extensions": [

‎.github/workflows/build_and_test.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ jobs:
6767
- name: gcc-debug-x86_64
6868
cc: gcc-14
6969
cxx: g++-14
70+
# Also read the full-text archives written by Paimon C++ with the Python reader.
71+
build_args: --verify_full_text_archives
7072
- name: clang-debug-x86_64
7173
fetch_depth: '0' # fetch the PR target branch history for clang-tidy
7274
timeout_minutes: 180

‎CMakeLists.txt‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
cmake_minimum_required(VERSION 3.22)
2121
# 3.22 is the minimum required by Corrosion-rs (used for the Rust<->C++ FFI
22-
# integration, see crates/tantivy_ffi). Ubuntu 24.04 ships CMake 3.28 and
22+
# integration, see crates/lance_ffi). Ubuntu 24.04 ships CMake 3.28 and
2323
# CentOS 8+/RHEL 9+ ship 3.20+, so older distributions need a newer CMake
2424
# installation.
2525
message(STATUS "Building using CMake version: ${CMAKE_VERSION}")
@@ -69,8 +69,8 @@ option(PAIMON_ENABLE_NETWORK_TESTS
6969
"Whether to enable tests that access real remote services over the network" OFF)
7070
option(PAIMON_ENABLE_LUMINA "Whether to enable lumina vector index" OFF)
7171
option(PAIMON_ENABLE_LUCENE "Whether to enable lucene index" OFF)
72-
option(PAIMON_ENABLE_TANTIVY
73-
"Whether to enable tantivy-fulltext global index (Rust FFI, experimental)" OFF)
72+
option(PAIMON_ENABLE_FULL_TEXT
73+
"Whether to enable full-text global index (Rust FFI, experimental)" OFF)
7474
option(PAIMON_ENABLE_REST
7575
"Whether to enable the rest catalog (requires libcurl and OpenSSL)" OFF)
7676
if(PAIMON_ENABLE_ORC)
@@ -126,8 +126,8 @@ if(PAIMON_ENABLE_LUCENE)
126126
add_definitions(-DPAIMON_ENABLE_LUCENE)
127127
endif()
128128

129-
if(PAIMON_ENABLE_TANTIVY)
130-
add_definitions(-DPAIMON_ENABLE_TANTIVY)
129+
if(PAIMON_ENABLE_FULL_TEXT)
130+
add_definitions(-DPAIMON_ENABLE_FULL_TEXT)
131131
endif()
132132

133133
add_definitions(-DSNAPPY_CODEC_AVAILABLE)
@@ -333,7 +333,7 @@ add_subdirectory(third_party/roaring_bitmap EXCLUDE_FROM_ALL)
333333
add_subdirectory(third_party/xxhash EXCLUDE_FROM_ALL)
334334
335335
# ---- Rust FFI crates via Corrosion-rs -------------------------------------------
336-
if(PAIMON_ENABLE_LANCE OR PAIMON_ENABLE_TANTIVY)
336+
if(PAIMON_ENABLE_LANCE)
337337
include(CorrosionFetch)
338338
endif()
339339
@@ -346,13 +346,6 @@ if(PAIMON_ENABLE_LANCE)
346346
corrosion_set_env_vars(paimon_lance_ffi "PROTOC=${PAIMON_LANCE_PROTOC}")
347347
endif()
348348
349-
if(PAIMON_ENABLE_TANTIVY)
350-
corrosion_import_crate(MANIFEST_PATH crates/tantivy_ffi/Cargo.toml CRATES
351-
paimon_tantivy_ffi)
352-
corrosion_experimental_cbindgen(TARGET paimon_tantivy_ffi HEADER_NAME
353-
paimon_tantivy_ffi.h)
354-
endif()
355-
356349
if(PAIMON_ENABLE_LUCENE)
357350
set(PAIMON_DICT_DEST "share/paimon/dict")
358351
@@ -532,6 +525,13 @@ if(PAIMON_BUILD_TESTS)
532525
paimon_lucene_index_shared)
533526
list(APPEND TEST_STATIC_LINK_LIBS ${TEST_PLUGIN_LINK_LIBS})
534527
endif()
528+
if(PAIMON_ENABLE_FULL_TEXT)
529+
paimon_link_libraries_whole_archive(PAIMON_FULL_TEXT_INDEX_STATIC_LINK_LIBS
530+
paimon_full_text_index_static)
531+
paimon_link_libraries_no_as_needed(TEST_PLUGIN_LINK_LIBS
532+
paimon_full_text_index_shared)
533+
list(APPEND TEST_STATIC_LINK_LIBS ${TEST_PLUGIN_LINK_LIBS})
534+
endif()
535535
endif()
536536
537537
if(PAIMON_BUILD_BENCHMARKS)
@@ -586,8 +586,8 @@ if(PAIMON_ENABLE_LUMINA)
586586
add_subdirectory(src/paimon/indexer/lumina)
587587
endif()
588588
add_subdirectory(src/paimon/global_index/lucene)
589-
if(PAIMON_ENABLE_TANTIVY)
590-
add_subdirectory(src/paimon/global_index/tantivy)
589+
if(PAIMON_ENABLE_FULL_TEXT)
590+
add_subdirectory(src/paimon/global_index/full_text)
591591
endif()
592592
add_subdirectory(src/paimon/testing/mock)
593593
add_subdirectory(src/paimon/testing/utils)

‎ci/scripts/build_paimon.sh‎

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
set -eux
1919

2020
usage() {
21-
echo "Usage: $0 --source_dir <path> [--enable_asan] [--enable_ubsan] [--enable_tsan] [--check_clang_tidy] [--build_type <type>] [--lint_git_target_commit <commit-or-branch>] [--install_smoke]"
21+
echo "Usage: $0 --source_dir <path> [--enable_asan] [--enable_ubsan] [--enable_tsan] [--check_clang_tidy] [--build_type <type>] [--lint_git_target_commit <commit-or-branch>] [--install_smoke] [--verify_full_text_archives]"
2222
}
2323

2424
source_dir=""
@@ -29,6 +29,7 @@ check_clang_tidy="false"
2929
build_type="Debug"
3030
lint_git_target_commit="origin/main"
3131
install_smoke="false"
32+
verify_full_text_archives="false"
3233

3334
while [[ $# -gt 0 ]]; do
3435
case "$1" in
@@ -79,6 +80,10 @@ while [[ $# -gt 0 ]]; do
7980
install_smoke="true"
8081
shift
8182
;;
83+
--verify_full_text_archives)
84+
verify_full_text_archives="true"
85+
shift
86+
;;
8287
-h | --help)
8388
usage
8489
exit 0
@@ -128,22 +133,26 @@ mkdir -p "${build_dir}"
128133
pushd "${build_dir}"
129134

130135
ENABLE_LUMINA="ON"
131-
ENABLE_TANTIVY="ON"
136+
ENABLE_FULL_TEXT="ON"
132137
ENABLE_LANCE="ON"
133138
if [[ "${CC:-}" == *"gcc-8"* ]] || [[ "${CXX:-}" == *"g++-8"* ]]; then
134139
ENABLE_LUMINA="OFF"
135-
ENABLE_TANTIVY="OFF" # tantivy-fts (Rust FFI) is not built on the gcc-8 image.
140+
ENABLE_FULL_TEXT="OFF" # The full-text index (Rust FFI) is not built on the gcc-8 image.
136141
fi
137142
if [[ "${enable_tsan}" == "true" ]]; then
138-
ENABLE_TANTIVY="OFF" # Tantivy's Rust library is not TSAN-instrumented.
139-
ENABLE_LANCE="OFF" # Lance's Rust library is not TSAN-instrumented.
143+
ENABLE_FULL_TEXT="OFF" # The full-text Rust library is not TSAN-instrumented.
144+
ENABLE_LANCE="OFF" # Lance's Rust library is not TSAN-instrumented.
140145
fi
141146
# CI always builds natively, so the host architecture is the target architecture.
142147
host_arch=$(uname -m)
143148
if [[ "${host_arch}" != "x86_64" ]]; then
144149
ENABLE_LUMINA="OFF"
145150
echo "=== Lumina disabled: no prebuilt artifacts for ${host_arch} ==="
146151
fi
152+
if [[ "${verify_full_text_archives}" == "true" && "${ENABLE_FULL_TEXT}" != "ON" ]]; then
153+
echo "--verify_full_text_archives requires the full-text index, which this build disables" >&2
154+
exit 1
155+
fi
147156

148157
CMAKE_ARGS=(
149158
"-G Ninja"
@@ -156,7 +165,7 @@ CMAKE_ARGS=(
156165
"-DPAIMON_ENABLE_S3=ON"
157166
"-DPAIMON_ENABLE_LUMINA=${ENABLE_LUMINA}"
158167
"-DPAIMON_ENABLE_LUCENE=ON"
159-
"-DPAIMON_ENABLE_TANTIVY=${ENABLE_TANTIVY}"
168+
"-DPAIMON_ENABLE_FULL_TEXT=${ENABLE_FULL_TEXT}"
160169
"-DPAIMON_ENABLE_REST=ON"
161170
"-DPAIMON_LINT_GIT_TARGET_COMMIT=${lint_git_target_commit}"
162171
)
@@ -173,8 +182,25 @@ fi
173182

174183
cmake "${CMAKE_ARGS[@]}" "${source_dir}"
175184
cmake --build . -- -j "${build_jobs}"
185+
if [[ "${verify_full_text_archives}" == "true" ]]; then
186+
# TestCrossReadFixtures copies the full-text archives written by Paimon C++ here.
187+
full_text_archive_dir="${build_dir}/full_text_archives"
188+
mkdir -p "${full_text_archive_dir}"
189+
export PAIMON_FULL_TEXT_ARCHIVE_OUTPUT_DIR="${full_text_archive_dir}"
190+
fi
176191
ctest --output-on-failure -j "${build_jobs}"
177192

193+
if [[ "${verify_full_text_archives}" == "true" ]]; then
194+
# Read them with the Python binding of the same engine and compare the search results with
195+
# those of the checked-in fixtures.
196+
full_text_venv="${build_dir}/full_text_venv"
197+
python3 -m venv "${full_text_venv}"
198+
"${full_text_venv}/bin/pip" install paimon-ftindex==0.1.0
199+
"${full_text_venv}/bin/python" \
200+
"${source_dir}/test/test_data/full_text_fixtures/generate_fixtures.py" \
201+
--verify "${full_text_archive_dir}"
202+
fi
203+
178204
if [[ "${check_clang_tidy}" == "true" ]]; then
179205
cmake --build . --target check-clang-tidy
180206
fi

‎ci/scripts/setup_rust.sh‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18-
# Install the Rust toolchain used by the Lance, Mosaic, and tantivy-fts FFI builds, plus
19-
# cbindgen required by Lance and tantivy-fts.
18+
# Install the Rust toolchain used by the Lance, Mosaic, and full-text index FFI builds, plus
19+
# cbindgen required by Lance.
2020
#
2121
# The dev container (see .devcontainer/) already has these preinstalled;
2222
# this script is for the GitHub Actions runners and is called before ci/scripts/build_paimon.sh.
@@ -26,8 +26,8 @@
2626
set -eux
2727

2828
RUSTUP_VERSION=${RUSTUP_VERSION:-1.29.0}
29-
# 1.88.0 is the minimum required by transitive crates (e.g. time 0.3.47).
30-
RUST_VERSION=${RUST_VERSION:-1.88.0}
29+
# 1.90.0 is the minimum required by paimon-full-text 0.1.0 (rust-version in its Cargo.toml).
30+
RUST_VERSION=${RUST_VERSION:-1.90.0}
3131
CBINDGEN_VERSION=${CBINDGEN_VERSION:-0.29.2}
3232
PROTOC_VERSION=27.4
3333

‎cmake_modules/CorrosionFetch.cmake‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616
#
17-
# Pull Corrosion-rs via FetchContent so we can import crates/tantivy_ffi as
18-
# CMake targets for the tantivy-fulltext global index.
17+
# Pull Corrosion-rs via FetchContent so we can import crates/lance_ffi as
18+
# CMake targets for the Lance file format.
1919
#
2020
# Pinned to v0.5.2 (stable release). Requires CMake >= 3.22.
2121

0 commit comments

Comments
 (0)