IMP: add document AI, custom IK dictionaries, and optimize FTS"#1126
Open
WeiJinMei0 wants to merge 6 commits into
Open
IMP: add document AI, custom IK dictionaries, and optimize FTS"#1126WeiJinMei0 wants to merge 6 commits into
WeiJinMei0 wants to merge 6 commits into
Conversation
|
SeekDB Developer seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Member
Document AI & IK Custom Dictionary ScoreDocument AI Functions Score =========================== score: 100.00 / 100 load_file: 50 / 50 ai_split_document: 50 / 50 IK Custom Dictionary Score ========================== score: 100.00 / 100 ik_custom_dict: 100 / 100 FTS Large Benchmark ScoreFTS Large Benchmark Score ========================= score: 76.41 / 100 mean_improvement: 38.21% full_score_improvement: 50.00% build_improvement: 28.33% build_ik_all_sec: baseline=35.2836, current=26.078, improvement=26.09% build_ik_content_sec: baseline=28.3764, current=19.55, improvement=31.10% build_beng_en_sec: baseline=14.7578, current=10.655, improvement=27.80% tokenize_improvement: 37.93% tokenize_ik_avg_ms: baseline=0.76478, current=0.3629, improvement=52.55% tokenize_beng_avg_ms: baseline=0.42262, current=0.3241, improvement=23.31% query_improvement: 48.36% query_cn_avg_ms: baseline=16.6628, current=7.7297, improvement=53.61% query_beng_avg_ms: baseline=24.3042, current=10.8632, improvement=55.30% query_mixed_avg_ms: baseline=17.5593, current=8.4413, improvement=51.93% query_limit_avg_ms: baseline=16.2334, current=10.9444, improvement=32.58% FTS Large Benchmark Report======================================== FTS Large Benchmark Report ======================================== timestamp: 2026-07-18 07:49:57 label: vldb-ci-29634944375-1 git_head: b6f896d git_dirty: 0 rows: 20000 batch: 500 rounds: 3000 query_rounds: 200 samples: 3 warmup: 30 skip_load: 0 ---------------------------------------- select1_avg_ms: 0.2656 select1_stdev_ms: 0.0013 raw_load_sec: 1.507 raw_load_rows_per_sec: 13271.4 build_ik_all_sec: 26.078 build_ik_content_sec: 19.550 build_beng_en_sec: 10.655 build_total_sec: 56.296 ---------------------------------------- tokenize_ik_avg_ms: 0.3629 tokenize_ik_median_ms: 0.3631 tokenize_ik_stdev_ms: 0.0012 tokenize_beng_avg_ms: 0.3241 tokenize_beng_median_ms:0.3242 tokenize_beng_stdev_ms: 0.0018 ---------------------------------------- query_cn_hits: 8001 query_cn_avg_ms: 7.7297 query_cn_stdev_ms: 0.0228 query_beng_hits: 11000 query_beng_avg_ms: 10.8632 query_beng_stdev_ms: 0.0038 query_mixed_hits: 7332 query_mixed_avg_ms: 8.4413 query_mixed_stdev_ms: 0.0342 query_limit_hits: 20 query_limit_avg_ms: 10.9444 query_limit_stdev_ms: 0.0032 ======================================== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task Description
This pull request implements the second, third, and fourth VLDB 2026 summer school tasks for SeekDB.
Document AI functions
LOAD_FILE(location_name, file_name)to securely read a file registered through a SeekDBLOCATIONand return its contents as a BLOB.AI_SPLIT_DOCUMENT(content[, parameters])table function to split plain-text or Markdown documents by word or sentence and return chunk ID, offset, length, and text.Custom dictionaries for the IK full-text parser
FULLTEXT_DICTtables and associate custom main, stopword, and quantifier dictionaries with an IK full-text index.ALTER SYSTEM REFRESH FULLTEXT DICTso dictionary changes can be made visible to subsequent tokenization and indexing operations.Full-text index build performance
Solution Description
Document AI
LOAD_FILEas a SQL expression with argument validation and BLOB result typing.LOCATIONthrough the schema guard, verify the session's read privilege, build the target URI from the location and file name, and read the file through the storage I/O adapter.AI_SPLIT_DOCUMENTas a function-table expression with four output columns:CHUNK_ID,CHUNK_OFFSET,CHUNK_LENGTH, andCHUNK_TEXT.type:textormarkdown;by:wordorsentence;max: maximum units per chunk;overlap: units shared by adjacent chunks.IK custom dictionary
CREATE TABLEparsing and schema validation forFULLTEXT_DICT='Y'dictionary tables.utf8mb4) table containing exactly oneVARCHAR(1..500)primary-key column namedword.dict_table,stopword_table,quantifier_table, andik_mode, and pass the selected dictionaries into IK parser initialization.ALTER SYSTEM REFRESH FULLTEXT DICT [database.]tablethrough the SQL parser, resolver, command executor, and dictionary hub. Refresh invalidates the selected custom dictionary cache so that the next use reloads current table contents.PARSER_PROPERTIESand theTOKENIZE()function.Full-text index optimization
__all_virtual_ddl_dag_monitorobservability path.max_batch_size_to0, remove the unfinished dedicated FTS batch-output code, and resolve generated FTS expressions by operator type on the stable row path. This fallback should be removed after post-build FTS vectorization is fully supported and validated.Passed Regressions
The following focused mysqltest cases and expected-result files are included:
tools/deploy/mysql_test/test_suite/ai_funcs/t/load_file.testLOCATION.tools/deploy/mysql_test/test_suite/ai_funcs/t/ai_split_document.testtools/deploy/mysql_test/test_suite/ai_funcs/t/ik_custom_dict.testtools/benchmark/fts_large_bench.shand is also intended to run through GitHub Actions for scoring.Verification status when this PR description was prepared: the test and expected-result files were inspected, but the mysqltest suites and large FTS benchmark were not executed locally. The final GitHub Actions regression and benchmark links/results should be attached to the PR after completion; only the latest commit result is used for scoring.
No existing test file was modified solely to bypass or weaken validation.
Upgrade Compatibility
The new SQL features are additive and do not require a manual data migration.
LOAD_FILEandAI_SPLIT_DOCUMENTintroduce new function interfaces without changing existing function contracts.FULLTEXT_DICT, its parser properties, and the refresh command are opt-in. Existing IK indexes continue to use built-in dictionaries unless custom dictionary properties are supplied.Other Information
vldb_2026inoceanbase/seekdb.tools/benchmark/fts_large_bench.sh; GitHub Actions results from the last commit are authoritative for the competition.Release Note
Adds Document AI file loading and document splitting functions, introduces refreshable custom dictionaries for the IK full-text parser, and improves the performance and observability of full-text index construction while retaining a stable row-based fallback for post-build FTS processing.