From 8f13a585f03faaa1473849d8318f9cee0f7f7a03 Mon Sep 17 00:00:00 2001 From: xtcyclist <7731943+xtcyclist@users.noreply.github.com> Date: Fri, 16 Dec 2022 11:12:38 +0800 Subject: [PATCH] add a log(error) --- src/common/expression/AttributeExpression.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/common/expression/AttributeExpression.cpp b/src/common/expression/AttributeExpression.cpp index db68851542a..f06be15732c 100644 --- a/src/common/expression/AttributeExpression.cpp +++ b/src/common/expression/AttributeExpression.cpp @@ -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(left())->right()->kind() == Expression::Kind::kConstant) {