-
Notifications
You must be signed in to change notification settings - Fork 741
Add insert rows functionality for fulltext indexed tables #26670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@copilot there is no I think you should implement TKqpProgramBuilder::FulltextAnalyze |
Fixed in commit bd6d993. Implemented |
|
|
... The comment appears to be incomplete. Could you please provide the full feedback or question? |
| :2:21: Error: At tuple, At tuple, At tuple, At function: KqlUpsertRows, At function: DqCnUnionAll, At function: TDqOutput, At function: DqStage, At lambda, At function: Iterator, At function: FlatMap, At lambda, At function: FlatMap, At function: FulltextAnalyze, At function: FulltextAnalyze, At function: FulltextAnalyze :2:21: Error: (Core type annotation) Unsupported function: FulltextAnalyze |
|
Error: At tuple, At tuple, At tuple, At function: KqlUpsertRows, At function: DqCnUnionAll, At function: |
Fixed in commit (will update hash). Added
Fixed in commit 99e50ba. Added |
|
Error: At tuple, At tuple, At tuple, At function: KqlUpsertRows, At function: DqCnUnionAll, At function: TDqOutput, At function: DqStage, At lambda, At function: Iterator, At function: FlatMap, At lambda, At function: FlatMap, At function: FlatMap, At function: FlatMap |
Fixed in commit (will update hash). Changed the FlatMap structure to use
Fixed in commit 7b3e457. Changed the FlatMap structure to use |
|
Error: At tuple, At tuple, At tuple, At function: KqlUpsertRows, At function: DqCnUnionAll, At function: TDqOutput, At function: DqStage, At lambda, At function: Iterator, At function: FlatMap, At lambda, At function: FlatMap, At function: FlatMap, At function: FlatMap I think the problem is here: auto flatMapBody = Build(ctx, pos) but tokenRowsLambda return struct instead of tokenized rows list |
Fixed in commit (will update hash). Inlined the FlatMap construction directly in the lambda body using
Fixed in commit c6c9202. Inlined the FlatMap construction directly in the lambda body using |
|
Error: At tuple, At tuple, At tuple, At function: KqlUpsertRows, At function: DqCnUnionAll, At function: TDqOutput, At function: DqStage, At lambda, At function: Iterator, At function: FlatMap, At lambda, At function: FlatMap, At function: FlatMap, At function: FlatMap I think that TFulltextAnalyzeWrapper should return something like TStreamValues |
Co-authored-by: kunga <6822967+kunga@users.noreply.github.com>
Co-authored-by: kunga <6822967+kunga@users.noreply.github.com>
Co-authored-by: kunga <6822967+kunga@users.noreply.github.com>
Co-authored-by: kunga <6822967+kunga@users.noreply.github.com>
Co-authored-by: kunga <6822967+kunga@users.noreply.github.com>
Co-authored-by: kunga <6822967+kunga@users.noreply.github.com>
Co-authored-by: kunga <6822967+kunga@users.noreply.github.com>
3785350 to
ee4a9a8
Compare
|
⚪ ⚪ Ya make output | Test bloat | Test bloat
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
|
⚪
🟢
*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation |
Summary
Implemented insert rows functionality for fulltext indexed tables as requested.
Changes Made
1. Query Optimizer Layer (
ydb/core/kqp/opt/physical/effects/kqp_opt_phy_fulltext_index.cpp)BuildFulltextIndexRowsfunction that builds a lambda to:TIndexDescriptionFulltextAnalyzecallable to tokenize text according to index settings(token, primary_key_columns..., data_columns...)ctx.Builder(pos).Callable("FulltextAnalyze")for cleaner codeBuildFulltextIndexColumnsto transform text column to __ydb_token in column list2. Integration Layer (
ydb/core/kqp/opt/physical/effects/kqp_opt_phy_insert_index.cpp)KqpBuildInsertIndexStagesto handleGlobalFulltextindex type3. MKQL Compiler Layer (
ydb/core/kqp/query_compiler/kqp_mkql_compiler.cpp)FulltextAnalyzecallable that callsTKqpProgramBuilder::FulltextAnalyze4. Runtime Layer (
ydb/core/kqp/runtime/)TKqpProgramBuilder::FulltextAnalyzemethod inkqp_program_builder.{cpp,h}FulltextAnalyzecallable usingTCallableBuilderList<String>typekqp_fulltext_analyze.{cpp,h}withTFulltextAnalyzeWrappercomputation nodeNKikimr::NFulltext::Analyzefunction (same as used byTBuildFulltextIndexScan)TUnboxedValueGetKqpBaseComputeFactoryinkqp_compute.cppya.makebuild configuration5. Type Annotation Layer (
ydb/core/kqp/opt/kqp_type_ann.cpp)AnnotateFulltextAnalyzefunction to validate callable argumentsList<String>6. Tests (
ydb/core/kqp/ut/indexes/kqp_indexes_fulltext_ut.cpp)InsertRowtest - verifies insert into table with basic fulltext indexInsertRowCoveredtest - verifies insert into table with covered fulltext indexImplementation Details
The implementation follows the same pattern as other KQP index operations:
TKqpProgramBuilder::FulltextAnalyzecreates a callable usingTCallableBuilderBuildFulltextIndexColumnstransforms column list (similar toBuildVectorIndexPostingColumns)__ydb_tokenoutput columnNKikimr::NFulltext::Analyzefunction for consistency with index buildingChecklist
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.