Skip to content

Commit

Permalink
revise error messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
xtcyclist committed Dec 23, 2022
1 parent 011f2fa commit ba372e5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/graph/executor/query/FilterExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ StatusOr<DataSet> FilterExecutor::handleJob(size_t begin, size_t end, Iterator *
for (; iter->valid() && begin++ < end; iter->next()) {
auto val = condition->eval(ctx(iter));
if (val.isBadNull() || (!val.empty() && !val.isImplicitBool() && !val.isNull())) {
return Status::Error("Wrong type result, the type should be NULL, EMPTY, BOOL");
return Status::Error("Failed to evaluate condition: %s. %s",
condition->toString().c_str(),
"For boolean conditions, please write <condition> == <true/false>.");
}
if (!(val.empty() || val.isNull() || (val.isImplicitBool() && !val.implicitBool()))) {
// TODO: Maybe we can move.
Expand Down Expand Up @@ -96,7 +98,9 @@ Status FilterExecutor::handleSingleJobFilter() {
while (iter->valid()) {
auto val = condition->eval(ctx(iter));
if (val.isBadNull() || (!val.empty() && !val.isImplicitBool() && !val.isNull())) {
return Status::Error("Wrong type result, the type should be NULL, EMPTY, BOOL");
return Status::Error("Failed to evaluate condition: %s. %s",
condition->toString().c_str(),
"For boolean conditions, please write <condition> == <true/false>.");
}
if (val.empty() || val.isNull() || (val.isImplicitBool() && !val.implicitBool())) {
if (UNLIKELY(filter->needStableFilter())) {
Expand All @@ -119,7 +123,9 @@ Status FilterExecutor::handleSingleJobFilter() {
for (; iter->valid(); iter->next()) {
auto val = condition->eval(ctx(iter));
if (val.isBadNull() || (!val.empty() && !val.isImplicitBool() && !val.isNull())) {
return Status::Error("Wrong type result, the type should be NULL, EMPTY, BOOL");
return Status::Error("Failed to evaluate condition: %s. %s",
condition->toString().c_str(),
"For boolean conditions, please write <condition> == <true/false>.");
}
if (val.isImplicitBool() && val.implicitBool()) {
Row row;
Expand Down

0 comments on commit ba372e5

Please sign in to comment.