Skip to content

Commit

Permalink
add a log(error)
Browse files Browse the repository at this point in the history
  • Loading branch information
xtcyclist committed Dec 16, 2022
1 parent 18510c2 commit b355eba
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/common/expression/AttributeExpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,18 @@ const Value &AttributeExpression::eval(ExpressionContext &ctx) {
* ListComprehensionExpression without making structural changes to the implementation.
*/
if (left()->kind() != Expression::Kind::kAttribute) {
return lvalue;
if (right()->kind() == Expression::Kind::kConstant &&
rvalue.type() == Value::Type::STRING) {
auto rStr = rvalue.getStr();
for (auto &tag : lvalue.getVertex().tags) {
if (rStr.compare(tag.name) == 0) {
return lvalue;
}
}
LOG(ERROR) << "Tag not found for: " << rStr
<< "Please check whether the related expression "
<< "follows the format of vertex.tag.property.";
}
} else if (left()->kind() == Expression::Kind::kAttribute &&
dynamic_cast<AttributeExpression *>(left())->right()->kind() ==
Expression::Kind::kConstant) {
Expand Down

0 comments on commit b355eba

Please sign in to comment.