diff options
author | kungasc <[email protected]> | 2025-09-23 19:02:29 +0300 |
---|---|---|
committer | kungasc <[email protected]> | 2025-09-23 19:22:34 +0300 |
commit | ca6a4519ce8972481aa637055e8af16874b0c736 (patch) | |
tree | 431a78fa0840dca13d39d7b02e2b877d5723e8e4 /yql/essentials/sql | |
parent | 61748dcf22ae75c2d56e64c29bac001a711cd2fc (diff) |
YQL support fulltext index type
part of https://github.com/ydb-platform/ydb/issues/23384
commit_hash:dc3c331d4054a7739ca632ddce312c985d4b8a13
Diffstat (limited to 'yql/essentials/sql')
-rw-r--r-- | yql/essentials/sql/v1/node.h | 1 | ||||
-rw-r--r-- | yql/essentials/sql/v1/query.cpp | 2 | ||||
-rw-r--r-- | yql/essentials/sql/v1/sql_translation.cpp | 12 |
3 files changed, 12 insertions, 3 deletions
diff --git a/yql/essentials/sql/v1/node.h b/yql/essentials/sql/v1/node.h index a2696f6936b..e8a83b41bf2 100644 --- a/yql/essentials/sql/v1/node.h +++ b/yql/essentials/sql/v1/node.h @@ -1193,6 +1193,7 @@ namespace NSQLTranslationV1 { GlobalAsync, GlobalSyncUnique, GlobalVectorKmeansTree, + GlobalFulltext }; struct TIndexSetting { diff --git a/yql/essentials/sql/v1/query.cpp b/yql/essentials/sql/v1/query.cpp index a4263c43022..31e88abc353 100644 --- a/yql/essentials/sql/v1/query.cpp +++ b/yql/essentials/sql/v1/query.cpp @@ -151,6 +151,8 @@ static INode::TPtr CreateIndexType(TIndexDescription::EType type, const INode& n return node.Q("syncGlobalUnique"); case TIndexDescription::EType::GlobalVectorKmeansTree: return node.Q("globalVectorKmeansTree"); + case TIndexDescription::EType::GlobalFulltext: + return node.Q("globalFulltext"); } } diff --git a/yql/essentials/sql/v1/sql_translation.cpp b/yql/essentials/sql/v1/sql_translation.cpp index 0f6efde9dc0..8f24599cfae 100644 --- a/yql/essentials/sql/v1/sql_translation.cpp +++ b/yql/essentials/sql/v1/sql_translation.cpp @@ -699,13 +699,19 @@ bool TSqlTranslation::CreateTableIndex(const TRule_table_index& node, TVector<TI if (node.GetRule_table_index_type3().HasBlock2()) { const TString subType = to_upper(IdEx(node.GetRule_table_index_type3().GetBlock2().GetRule_index_subtype2().GetRule_an_id1(), *this).Name) ; - if (subType == "VECTOR_KMEANS_TREE") { + if (subType == "VECTOR_KMEANS_TREE" || subType == "FULLTEXT") { if (indexes.back().Type != TIndexDescription::EType::GlobalSync) { Ctx_.Error() << subType << " index can only be GLOBAL [SYNC]"; return false; } - indexes.back().Type = TIndexDescription::EType::GlobalVectorKmeansTree; + if (subType == "VECTOR_KMEANS_TREE") { + indexes.back().Type = TIndexDescription::EType::GlobalVectorKmeansTree; + } else if (subType == "FULLTEXT") { + indexes.back().Type = TIndexDescription::EType::GlobalFulltext; + } else { + Y_ABORT("Unreachable"); + } } else { Ctx_.Error() << subType << " index subtype is not supported"; return false; @@ -716,7 +722,7 @@ bool TSqlTranslation::CreateTableIndex(const TRule_table_index& node, TVector<TI if (node.HasBlock10()) { //const auto& with = node.GetBlock4(); auto& index = indexes.back(); - if (index.Type == TIndexDescription::EType::GlobalVectorKmeansTree) { + if (index.Type == TIndexDescription::EType::GlobalVectorKmeansTree || index.Type == TIndexDescription::EType::GlobalFulltext) { if (!FillIndexSettings(node.GetBlock10().GetRule_with_index_settings1(), index.IndexSettings)) { return false; } |