MCPcopy Create free account
hub / github.com/alibaba/zvec / replace_vector_node

Method replace_vector_node

src/db/sqlengine/parser/zvec_cached_sql_parser.cc:139–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139int ZVecCachedSQLParser::replace_vector_node(SQLInfo::Ptr cached_sql_info,
140 Node::Ptr vector_node) {
141 SelectInfo::Ptr cached_select_info =
142 std::dynamic_pointer_cast<SelectInfo>(cached_sql_info->base_info());
143 if (cached_select_info == nullptr) {
144 LOG_WARN("wrong select_info in cache. [%s]",
145 cached_sql_info->to_string().c_str());
146 return -1;
147 }
148
149 Node::Ptr search_cond = cached_select_info->mutable_search_cond();
150 if (search_cond == nullptr) {
151 LOG_WARN("wrong search_cond in cache. [%s]",
152 cached_sql_info->to_string().c_str());
153 return -1;
154 }
155
156 replace_flag_ = false;
157 if (traverse_to_replace(search_cond, vector_node) != 0 ||
158 replace_flag_ == false) {
159 LOG_WARN("replace search_cond in cache failed. [%s]",
160 cached_sql_info->to_string().c_str());
161 return -1;
162 }
163
164 return 0;
165}
166
167int ZVecCachedSQLParser::traverse_to_replace(Node::Ptr ptr,
168 Node::Ptr vector_node) {

Callers

nothing calls this directly

Calls 2

c_strMethod · 0.80
to_stringMethod · 0.45

Tested by

no test coverage detected