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 564e5a2 commit 799bdf9
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 799bdf9

Please sign in to comment.