Check whether index is valid at runtime #1291
Conversation
|
||
const auto &ictxs = lookup->queryContext(); | ||
auto iter = std::find_if( | ||
ictxs.begin(), ictxs.end(), [](auto &ictx) { return !ictx.index_id_ref().is_set(); }); | ||
if (ictxs.empty() || iter != ictxs.end()) { | ||
return Status::Error("There is no index to use at runtime"); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the index ID not set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now index is selected in multiple opt rules. when all rules could not select the index, IndexFullScanNode without index is still in the execution plan. so here needs to check the real index at runtime.
In addition, maybe need to check the validity of the index. for example : |
const auto &ictxs = lookup->queryContext(); | ||
auto iter = std::find_if( | ||
ictxs.begin(), ictxs.end(), [](auto &ictx) { return !ictx.index_id_ref().is_set(); }); | ||
if (ictxs.empty() || iter != ictxs.end()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the checking logic in the if statement ictxs.empty()
necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My test cases is for this scenario.
Now if you use
|
* Check whether index is valid at runtime * Fix failed ut * Fix steps * drop the used space * Format
* Fix the go return bad_type when the vertex without the tag (#1273) Co-authored-by: Yee <2520865+yixinglu@users.noreply.github.com> * fix util functions (#1277) small delete * Check whether index is valid at runtime (#1291) * Check whether index is valid at runtime * Fix failed ut * Fix steps * drop the used space * Format * Replace the lastUser by user count.… (#1243) * Replace the lastUser by user count.The last user maybe could run simultaneously, so can't determine which is real last user in timeline. * Fix the typo. Co-authored-by: Yee <2520865+yixinglu@users.noreply.github.com> * fix first plan node input var (#1298) Co-authored-by: laura-ding <48548375+laura-ding@users.noreply.github.com> Co-authored-by: Yee <2520865+yixinglu@users.noreply.github.com> Co-authored-by: kyle.cao <kyle.cao@vesoft.com> Co-authored-by: Shylock Hg <33566796+Shylock-Hg@users.noreply.github.com>
as title.