From b2de82670df455b8c2d14993b6631054772cced6 Mon Sep 17 00:00:00 2001 From: Cheng Xuntao <7731943+xtcyclist@users.noreply.github.com> Date: Thu, 29 Dec 2022 16:34:43 +0800 Subject: [PATCH] Revert "Remove all UNKNOWN_PROP as a type of null. (#4907)" (#5149) This reverts commit aa624162abaf92eeb6c2e5a8c35d31acc9366846. Co-authored-by: Sophie <84560950+Sophie-Xie@users.noreply.github.com> --- src/common/expression/AttributeExpression.cpp | 2 +- src/common/expression/test/AttributeExpressionTest.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/expression/AttributeExpression.cpp b/src/common/expression/AttributeExpression.cpp index 20438134d57..7ddac8585b3 100644 --- a/src/common/expression/AttributeExpression.cpp +++ b/src/common/expression/AttributeExpression.cpp @@ -33,7 +33,7 @@ const Value &AttributeExpression::eval(ExpressionContext &ctx) { return iter->second; } } - return Value::kNullValue; + return Value::kNullUnknownProp; } case Value::Type::EDGE: { DCHECK(!rvalue.getStr().empty()); diff --git a/src/common/expression/test/AttributeExpressionTest.cpp b/src/common/expression/test/AttributeExpressionTest.cpp index 1258e953bfa..5b3dbbe5870 100644 --- a/src/common/expression/test/AttributeExpressionTest.cpp +++ b/src/common/expression/test/AttributeExpressionTest.cpp @@ -134,7 +134,7 @@ TEST_F(AttributeExpressionTest, DateTimeAttribute) { auto *right = LabelExpression::make(&pool, "not exist attribute"); auto expr = AttributeExpression::make(&pool, left, right); auto value = Expression::eval(expr, gExpCtxt); - ASSERT_EQ(Value::kNullValue, value); + ASSERT_EQ(Value::kNullUnknownProp, value); } { auto *left = ConstantExpression::make(&pool, Value(dt)); @@ -148,7 +148,7 @@ TEST_F(AttributeExpressionTest, DateTimeAttribute) { auto *right = LabelExpression::make(&pool, "not exist attribute"); auto expr = AttributeExpression::make(&pool, left, right); auto value = Expression::eval(expr, gExpCtxt); - ASSERT_EQ(Value::kNullValue, value); + ASSERT_EQ(Value::kNullUnknownProp, value); } { auto *left = ConstantExpression::make(&pool, Value(d)); @@ -162,7 +162,7 @@ TEST_F(AttributeExpressionTest, DateTimeAttribute) { auto *right = LabelExpression::make(&pool, "not exist attribute"); auto expr = AttributeExpression::make(&pool, left, right); auto value = Expression::eval(expr, gExpCtxt); - ASSERT_EQ(Value::kNullValue, value); + ASSERT_EQ(Value::kNullUnknownProp, value); } { auto *left = ConstantExpression::make(&pool, Value(t));