diff --git a/src/codec/RowReaderV1.cpp b/src/codec/RowReaderV1.cpp index 6a73458539c..0d17b3aef76 100644 --- a/src/codec/RowReaderV1.cpp +++ b/src/codec/RowReaderV1.cpp @@ -199,11 +199,11 @@ Value RowReaderV1::getValueByName(const std::string& prop) const noexcept { Value RowReaderV1::getValueByIndex(const int64_t index) const noexcept { if (index < 0 || static_cast(index) >= schema_->getNumFields()) { - return Value(NullType::__NULL__); + return Value(NullType::UNKNOWN_PROP); } auto vType = getSchema()->getFieldType(index); if (PropertyType::UNKNOWN == vType) { - return Value(NullType::__NULL__); + return Value(NullType::UNKNOWN_PROP); } switch (vType) { case PropertyType::BOOL: diff --git a/src/codec/RowReaderV2.cpp b/src/codec/RowReaderV2.cpp index fe23bd2e9a1..cdfe207f1e7 100644 --- a/src/codec/RowReaderV2.cpp +++ b/src/codec/RowReaderV2.cpp @@ -52,7 +52,7 @@ Value RowReaderV2::getValueByName(const std::string& prop) const noexcept { Value RowReaderV2::getValueByIndex(const int64_t index) const noexcept { if (index < 0 || static_cast(index) >= schema_->getNumFields()) { - return Value(NullType::__NULL__); + return Value(NullType::UNKNOWN_PROP); } auto field = schema_->field(index); diff --git a/src/common/datatypes/Map.h b/src/common/datatypes/Map.h index 9a55f28318c..91134a48387 100644 --- a/src/common/datatypes/Map.h +++ b/src/common/datatypes/Map.h @@ -69,7 +69,7 @@ struct Map { const Value& at(const std::string& key) const { auto iter = kvs.find(key); if (iter == kvs.end()) { - return Value::kNullValue; + return Value::kNullUnknownProp; } return iter->second; } diff --git a/src/common/datatypes/Value.cpp b/src/common/datatypes/Value.cpp index c8530d9a783..f15575164d8 100644 --- a/src/common/datatypes/Value.cpp +++ b/src/common/datatypes/Value.cpp @@ -29,6 +29,7 @@ const Value Value::kNullNaN(NullType::NaN); const Value Value::kNullBadData(NullType::BAD_DATA); const Value Value::kNullBadType(NullType::BAD_TYPE); const Value Value::kNullOverflow(NullType::ERR_OVERFLOW); +const Value Value::kNullUnknownProp(NullType::UNKNOWN_PROP); const Value Value::kNullDivByZero(NullType::DIV_BY_ZERO); const Value Value::kNullOutOfRange(NullType::OUT_OF_RANGE); @@ -319,6 +320,7 @@ const std::string& Value::typeName() const { {NullType::BAD_DATA, "BAD_DATA"}, {NullType::BAD_TYPE, "BAD_TYPE"}, {NullType::ERR_OVERFLOW, "ERR_OVERFLOW"}, + {NullType::UNKNOWN_PROP, "UNKNOWN_PROP"}, {NullType::DIV_BY_ZERO, "DIV_BY_ZERO"}, }; @@ -1574,6 +1576,8 @@ std::string Value::toString() const { return "__NULL_OVERFLOW__"; case NullType::NaN: return "__NULL_NaN__"; + case NullType::UNKNOWN_PROP: + return "__NULL_UNKNOWN_PROP__"; case NullType::OUT_OF_RANGE: return "__NULL_OUT_OF_RANGE__"; } diff --git a/src/common/datatypes/Value.h b/src/common/datatypes/Value.h index 936a4cf4a3b..9749b529d3f 100644 --- a/src/common/datatypes/Value.h +++ b/src/common/datatypes/Value.h @@ -40,6 +40,7 @@ enum class NullType { BAD_DATA = 2, BAD_TYPE = 3, ERR_OVERFLOW = 4, + UNKNOWN_PROP = 5, DIV_BY_ZERO = 6, OUT_OF_RANGE = 7, }; @@ -51,6 +52,7 @@ struct Value { static const Value kNullBadData; static const Value kNullBadType; static const Value kNullOverflow; + static const Value kNullUnknownProp; static const Value kNullDivByZero; static const Value kNullOutOfRange; @@ -155,8 +157,8 @@ struct Value { } auto& null = value_.nVal; return null == NullType::NaN || null == NullType::BAD_DATA || null == NullType::BAD_TYPE || - null == NullType::ERR_OVERFLOW || null == NullType::DIV_BY_ZERO || - null == NullType::OUT_OF_RANGE; + null == NullType::ERR_OVERFLOW || null == NullType::UNKNOWN_PROP || + null == NullType::DIV_BY_ZERO || null == NullType::OUT_OF_RANGE; } bool isNumeric() const { return type_ == Type::INT || type_ == Type::FLOAT; diff --git a/src/common/datatypes/test/ValueTest.cpp b/src/common/datatypes/test/ValueTest.cpp index 571c74f463f..73abce84640 100644 --- a/src/common/datatypes/test/ValueTest.cpp +++ b/src/common/datatypes/test/ValueTest.cpp @@ -1565,6 +1565,7 @@ TEST(Value, typeName) { EXPECT_EQ("BAD_DATA", Value::kNullBadData.typeName()); EXPECT_EQ("BAD_TYPE", Value::kNullBadType.typeName()); EXPECT_EQ("ERR_OVERFLOW", Value::kNullOverflow.typeName()); + EXPECT_EQ("UNKNOWN_PROP", Value::kNullUnknownProp.typeName()); EXPECT_EQ("DIV_BY_ZERO", Value::kNullDivByZero.typeName()); } @@ -1581,6 +1582,7 @@ TEST(Value, DecodeEncode) { Value(NullType::BAD_DATA), Value(NullType::ERR_OVERFLOW), Value(NullType::OUT_OF_RANGE), + Value(NullType::UNKNOWN_PROP), // int Value(0), diff --git a/src/common/datatypes/test/ValueToJsonTest.cpp b/src/common/datatypes/test/ValueToJsonTest.cpp index 9486ac76eec..01339ed7ff4 100644 --- a/src/common/datatypes/test/ValueToJsonTest.cpp +++ b/src/common/datatypes/test/ValueToJsonTest.cpp @@ -225,7 +225,7 @@ TEST(ValueToJson, DecodeEncode) { Value(NullType::BAD_DATA), Value(NullType::ERR_OVERFLOW), Value(NullType::OUT_OF_RANGE), - Value(NullType::__NULL__), + Value(NullType::UNKNOWN_PROP), // int Value(0), diff --git a/src/common/expression/AttributeExpression.cpp b/src/common/expression/AttributeExpression.cpp index eeeb0d80079..17736004486 100644 --- a/src/common/expression/AttributeExpression.cpp +++ b/src/common/expression/AttributeExpression.cpp @@ -67,7 +67,7 @@ const Value &AttributeExpression::eval(ExpressionContext &ctx) { } } } - 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 5a42eca6d71..615034cfe52 100644 --- a/src/common/expression/test/AttributeExpressionTest.cpp +++ b/src/common/expression/test/AttributeExpressionTest.cpp @@ -154,7 +154,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)); @@ -168,7 +168,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)); @@ -182,7 +182,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)); diff --git a/src/common/expression/test/SubscriptExpressionTest.cpp b/src/common/expression/test/SubscriptExpressionTest.cpp index 7d7f7ead0cf..622557d7b5a 100644 --- a/src/common/expression/test/SubscriptExpressionTest.cpp +++ b/src/common/expression/test/SubscriptExpressionTest.cpp @@ -338,6 +338,7 @@ TEST_F(SubscriptExpressionTest, MapSubscript) { auto expr = SubscriptExpression::make(&pool, map, key); auto value = Expression::eval(expr, gExpCtxt); ASSERT_TRUE(value.isNull()); + ASSERT_TRUE(value.isBadNull()); } // {"key1":1,"key2":2, "key3":3}[0] { diff --git a/src/common/time/TimeUtils.h b/src/common/time/TimeUtils.h index e2c4bba09ed..94570877ad3 100644 --- a/src/common/time/TimeUtils.h +++ b/src/common/time/TimeUtils.h @@ -124,7 +124,7 @@ class TimeUtils { } else if (lowerProp == "microsecond") { return static_cast(dt.microsec); } else { - return Value::kNullValue; + return Value::kNullUnknownProp; } } @@ -160,7 +160,7 @@ class TimeUtils { } else if (lowerProp == "day") { return d.day; } else { - return Value::kNullValue; + return Value::kNullUnknownProp; } } @@ -203,7 +203,7 @@ class TimeUtils { } else if (lowerProp == "microsecond") { return t.microsec; } else { - return Value::kNullValue; + return Value::kNullUnknownProp; } } diff --git a/src/common/utils/IndexKeyUtils.cpp b/src/common/utils/IndexKeyUtils.cpp index 728f4b52374..912d4125d25 100644 --- a/src/common/utils/IndexKeyUtils.cpp +++ b/src/common/utils/IndexKeyUtils.cpp @@ -204,7 +204,7 @@ StatusOr IndexKeyUtils::readValueWithLatestSche(RowReader* reader, const std::string propName, const meta::SchemaProviderIf* latestSchema) { auto value = reader->getValueByName(propName); - if (latestSchema == nullptr || !value.isNull() || value.getNull() != NullType::__NULL__) { + if (latestSchema == nullptr || !value.isNull() || value.getNull() != NullType::UNKNOWN_PROP) { return value; } auto field = latestSchema->field(propName); @@ -230,6 +230,9 @@ Status IndexKeyUtils::checkValue(const Value& v, bool isNullable) { } switch (v.getNull()) { + case nebula::NullType::UNKNOWN_PROP: { + return Status::Error("Unknown prop"); + } case nebula::NullType::__NULL__: { if (!isNullable) { return Status::Error("Not allowed to be null"); diff --git a/src/interface/common.thrift b/src/interface/common.thrift index 0f7de5ff779..dd97c0d914a 100644 --- a/src/interface/common.thrift +++ b/src/interface/common.thrift @@ -95,7 +95,7 @@ enum NullType { BAD_DATA = 2, BAD_TYPE = 3, ERR_OVERFLOW = 4, - UNKNOWN_PROP = 5, // deprecated but not to be deleted + UNKNOWN_PROP = 5, DIV_BY_ZERO = 6, OUT_OF_RANGE = 7, } (cpp.enum_strict, cpp.type = "nebula::NullType") diff --git a/src/storage/exec/IndexEdgeScanNode.cpp b/src/storage/exec/IndexEdgeScanNode.cpp index d4dcfd67ecd..9eb9fb26cb2 100644 --- a/src/storage/exec/IndexEdgeScanNode.cpp +++ b/src/storage/exec/IndexEdgeScanNode.cpp @@ -122,7 +122,7 @@ Map IndexEdgeScanNode::decodeFromBase(const std::string& key case QueryUtils::ReturnColType::kOther: { auto field = edge_.back()->field(col); if (field == nullptr) { - values[col] = Value::kNullValue; + values[col] = Value::kNullUnknownProp; } else { auto retVal = QueryUtils::readValue(reader.get(), col, field); if (!retVal.ok()) { diff --git a/src/storage/exec/IndexVertexScanNode.cpp b/src/storage/exec/IndexVertexScanNode.cpp index fd2eed2ae0c..4dcfd01075c 100644 --- a/src/storage/exec/IndexVertexScanNode.cpp +++ b/src/storage/exec/IndexVertexScanNode.cpp @@ -99,7 +99,7 @@ Map IndexVertexScanNode::decodeFromBase(const std::string& k case QueryUtils::ReturnColType::kOther: { auto field = tag_.back()->field(col); if (field == nullptr) { - values[col] = Value::kNullValue; + values[col] = Value::kNullUnknownProp; } else { auto retVal = QueryUtils::readValue(reader.get(), col, field); if (!retVal.ok()) { diff --git a/src/storage/exec/QueryUtils.h b/src/storage/exec/QueryUtils.h index 42481acf8d4..42d433c7ae3 100644 --- a/src/storage/exec/QueryUtils.h +++ b/src/storage/exec/QueryUtils.h @@ -80,7 +80,7 @@ class QueryUtils final { // read null value auto nullType = value.getNull(); - if (nullType == NullType::__NULL__) { + if (nullType == NullType::UNKNOWN_PROP) { VLOG(1) << "Fail to read prop " << propName; if (!field) { return value; diff --git a/src/tools/db-upgrade/DbUpgrader.cpp b/src/tools/db-upgrade/DbUpgrader.cpp index 9c21706e7e3..6c93ebdfd01 100644 --- a/src/tools/db-upgrade/DbUpgrader.cpp +++ b/src/tools/db-upgrade/DbUpgrader.cpp @@ -867,7 +867,7 @@ std::string UpgraderSpace::encodeRowVal(const RowReader* reader, LOG(ERROR) << "Write rowWriterV2 failed"; return ""; } - } else if (nullType != NullType::__NULL__) { + } else if (nullType != NullType::UNKNOWN_PROP) { // nullType == NullType::kNullUnknownProp, indicates that the field is // only in the latest schema, maybe use default value or null value. LOG(ERROR) << "Data is illegal in " << name << " field"; diff --git a/tests/common/nebula_test_suite.py b/tests/common/nebula_test_suite.py index efc0c1f128c..83b746704b3 100644 --- a/tests/common/nebula_test_suite.py +++ b/tests/common/nebula_test_suite.py @@ -34,8 +34,8 @@ T_NULL_BAD_DATA.set_nVal(CommonTtypes.NullType.BAD_DATA) T_NULL_BAD_TYPE = CommonTtypes.Value() T_NULL_BAD_TYPE.set_nVal(CommonTtypes.NullType.BAD_TYPE) -T_NULL___NULL__ = CommonTtypes.Value() -T_NULL___NULL__.set_nVal(CommonTtypes.NullType.__NULL__) +T_NULL_UNKNOWN_PROP = CommonTtypes.Value() +T_NULL_UNKNOWN_PROP.set_nVal(CommonTtypes.NullType.UNKNOWN_PROP) T_NULL_UNKNOWN_DIV_BY_ZERO = CommonTtypes.Value() T_NULL_UNKNOWN_DIV_BY_ZERO.set_nVal(CommonTtypes.NullType.DIV_BY_ZERO) diff --git a/tests/tck/features/expression/Attribute.feature b/tests/tck/features/expression/Attribute.feature index bfff234892f..c471c3554c4 100644 --- a/tests/tck/features/expression/Attribute.feature +++ b/tests/tck/features/expression/Attribute.feature @@ -61,8 +61,8 @@ Feature: Attribute RETURN {k1 : 1, k2: true}.K1 AS k """ Then the result should be, in any order: - | k | - | __NULL__ | + | k | + | UNKNOWN_PROP | When executing query: """ MATCH (v) WHERE id(v) == 'Tim Duncan' RETURN v.player.name @@ -101,28 +101,28 @@ Feature: Attribute """ Then the result should be, in any order: | not_exists_attr | - | __NULL__ | + | UNKNOWN_PROP | When executing query: """ RETURN time("02:59:40").not_exists_attr AS not_exists_attr """ Then the result should be, in any order: | not_exists_attr | - | __NULL__ | + | UNKNOWN_PROP | When executing query: """ RETURN datetime("2021-07-19T02:59:40").not_exists_attr AS not_exists_attr """ Then the result should be, in any order: | not_exists_attr | - | __NULL__ | + | UNKNOWN_PROP | When executing query: """ RETURN {k1 : 1, k2: true}.not_exists_attr AS not_exists_attr """ Then the result should be, in any order: | not_exists_attr | - | __NULL__ | + | UNKNOWN_PROP | When executing query: """ MATCH (v) WHERE id(v) == 'Tim Duncan' RETURN v.player.not_exists_attr diff --git a/tests/tck/features/match/Base.feature b/tests/tck/features/match/Base.feature index 0fd7c426979..a1f6f29c096 100644 --- a/tests/tck/features/match/Base.feature +++ b/tests/tck/features/match/Base.feature @@ -355,6 +355,7 @@ Feature: Basic match """ Then a SemanticError should be raised at runtime: `like_not_exists': Unknown edge type + @hello Scenario: two steps When executing query: """ @@ -375,10 +376,10 @@ Feature: Basic match """ Then the result should be, in any order: | Player | Friend | FoF | NotExists | - | "Damian Lillard" | "LaMarcus Aldridge" | "Tim Duncan" | __NULL__ | - | "Damian Lillard" | "LaMarcus Aldridge" | "Tony Parker" | __NULL__ | - | "Paul George" | "Russell Westbrook" | "James Harden" | __NULL__ | - | "Paul George" | "Russell Westbrook" | "Paul George" | __NULL__ | + | "Damian Lillard" | "LaMarcus Aldridge" | "Tim Duncan" | NULL | + | "Damian Lillard" | "LaMarcus Aldridge" | "Tony Parker" | NULL | + | "Paul George" | "Russell Westbrook" | "James Harden" | NULL | + | "Paul George" | "Russell Westbrook" | "Paul George" | NULL | When executing query: """ MATCH (v1) -[:like]-> (v2:player{age: 28}) -[:like]-> (v3) @@ -435,8 +436,8 @@ Feature: Basic match """ Then the result should be, in any order: | Player | Friend | TYPE | FoF | FoT | - | "Paul Gasol" | "Marc Gasol" | "like" | "Paul Gasol" | __NULL__ | - | "Yao Ming" | "Tracy McGrady" | "serve" | __NULL__ | "Rockets" | + | "Paul Gasol" | "Marc Gasol" | "like" | "Paul Gasol" | NULL | + | "Yao Ming" | "Tracy McGrady" | "serve" | NULL | "Rockets" | When executing query: """ MATCH (v1) -[e1:like]-> (v2) -[e2]-> (v3) diff --git a/tests/tck/features/match/MultiQueryParts.feature b/tests/tck/features/match/MultiQueryParts.feature index 3581366d291..e722235b3a8 100644 --- a/tests/tck/features/match/MultiQueryParts.feature +++ b/tests/tck/features/match/MultiQueryParts.feature @@ -182,8 +182,8 @@ Feature: Multi Query Parts Then the result should be, in any order, with relax comparison: | v1 | v2 | e3 | v4 | v3 | e5 | | ("Tony Parker") | ("Tony Parker") | [:like "Tony Parker"->"LaMarcus Aldridge" @0] | ("LaMarcus Aldridge") | ("Tim Duncan") | [:like "LaMarcus Aldridge"->"Tony Parker" @0] | - | ("Tony Parker") | ("Tim Duncan") | [:like "Tim Duncan"->"Tony Parker" @0 ] | ("Tony Parker") | __NULL__ | __NULL__ | - | ("Tony Parker") | ("Tim Duncan") | [:like "Tim Duncan"->"Tony Parker" @0] | ("Tony Parker") | __NULL__ | __NULL__ | + | ("Tony Parker") | ("Tim Duncan") | [:like "Tim Duncan"->"Tony Parker" @0 ] | ("Tony Parker") | NULL | NULL | + | ("Tony Parker") | ("Tim Duncan") | [:like "Tim Duncan"->"Tony Parker" @0] | ("Tony Parker") | NULL | NULL | | ("Tony Parker") | ("Tony Parker") | [:like "Tony Parker"->"Tim Duncan" @0 ] | ("Tim Duncan") | ("Tim Duncan") | [:teammate "Tim Duncan"->"Tony Parker" @0] | | ("Tony Parker") | ("Manu Ginobili") | [:like "Manu Ginobili"->"Tim Duncan" @0 ] | ("Tim Duncan") | ("Tim Duncan") | [:teammate "Tim Duncan"->"Tony Parker" @0] | | ("Tony Parker") | ("Tony Parker") | [:like "Tony Parker"->"Manu Ginobili" @0] | ("Manu Ginobili") | ("Tim Duncan") | [:teammate "Manu Ginobili"->"Tony Parker" @0] | diff --git a/tests/tck/features/match/With.feature b/tests/tck/features/match/With.feature index 42f92af99bb..5dd6278a82f 100644 --- a/tests/tck/features/match/With.feature +++ b/tests/tck/features/match/With.feature @@ -94,8 +94,8 @@ Feature: With clause RETURN x.c """ Then the result should be, in any order: - | x.c | - | __NULL__ | + | x.c | + | UNKNOWN_PROP | Scenario: match with return When executing query: diff --git a/tests/tck/features/optimizer/PrunePropertiesRule.feature b/tests/tck/features/optimizer/PrunePropertiesRule.feature index f2316b6ce13..c2f32a43b98 100644 --- a/tests/tck/features/optimizer/PrunePropertiesRule.feature +++ b/tests/tck/features/optimizer/PrunePropertiesRule.feature @@ -756,9 +756,9 @@ Feature: Prune Properties rule """ Then the result should be, in order, with relax comparison: | properties(src_v).age | properties(e).degree | name | src_v.player.sex | e.start_year | dst_v.player.age | - | 41 | __NULL__ | "Dejounte Murray" | "男" | 2022 | 29 | + | 41 | UNKNOWN_PROP | "Dejounte Murray" | "男" | 2022 | 29 | | 41 | 88 | "Spurs" | "男" | 2002 | NULL | - | 41 | __NULL__ | "Tiago Splitter" | "男" | 2022 | 34 | + | 41 | UNKNOWN_PROP | "Tiago Splitter" | "男" | 2022 | 34 | When executing query: """ match (src_v:player{name:"Manu Ginobili"})-[e*2]-(dst_v) @@ -775,16 +775,16 @@ Feature: Prune Properties rule When executing query: """ match (src_v:player{name:"Manu Ginobili"})-[e:like*2..3]-(dst_v) - return properties(src_v).sex,properties(e[0]).degree as degree,properties(dst_v).name as name,src_v.player.age AS age, e[1].start_year,dst_v.player.age + return distinct properties(src_v).sex,properties(e[0]).degree as degree,properties(dst_v).name as name,src_v.player.age AS age, e[1].start_year,dst_v.player.age order by degree, name, age limit 5; """ Then the result should be, in order, with relax comparison: - | properties(src_v).sex | degree | name | age | e[1].start_year | dst_v.player.age | - | "男" | __NULL__ | "Aron Baynes" | 41 | 2022 | 32 | - | "男" | __NULL__ | "Aron Baynes" | 41 | 2022 | 32 | - | "男" | __NULL__ | "Aron Baynes" | 41 | 2022 | 32 | - | "男" | __NULL__ | "Aron Baynes" | 41 | 2022 | 32 | - | "男" | __NULL__ | "Aron Baynes" | 41 | 2022 | 32 | + | properties(src_v).sex | degree | name | age | e[1].start_year | dst_v.player.age | + | "男" | UNKNOWN_PROP | "Aron Baynes" | 41 | 2022 | 32 | + | "男" | UNKNOWN_PROP | "Blake Griffin" | 41 | 2022 | 30 | + | "男" | UNKNOWN_PROP | "Boris Diaw" | 41 | 2022 | 36 | + | "男" | UNKNOWN_PROP | "Carmelo Anthony" | 41 | 2022 | 34 | + | "男" | UNKNOWN_PROP | "Chris Paul" | 41 | 2022 | 33 | When executing query: """ match (v1)-->(v2)-->(v3) where id(v1)=="Manu Ginobili" @@ -860,11 +860,11 @@ Feature: Prune Properties rule """ Then the result should be, in order, with relax comparison: | properties(e).degree1 | properties(e).degree1 | e2.a | dst_v.p.name | dst_v.player.sex1 | properties(src_v).name2 | - | __NULL__ | __NULL__ | NULL | NULL | NULL | __NULL__ | - | __NULL__ | __NULL__ | NULL | NULL | NULL | __NULL__ | - | __NULL__ | __NULL__ | NULL | NULL | NULL | __NULL__ | - | __NULL__ | __NULL__ | NULL | NULL | NULL | __NULL__ | - | __NULL__ | __NULL__ | NULL | NULL | NULL | __NULL__ | + | UNKNOWN_PROP | UNKNOWN_PROP | NULL | NULL | NULL | UNKNOWN_PROP | + | UNKNOWN_PROP | UNKNOWN_PROP | NULL | NULL | NULL | UNKNOWN_PROP | + | UNKNOWN_PROP | UNKNOWN_PROP | NULL | NULL | NULL | UNKNOWN_PROP | + | UNKNOWN_PROP | UNKNOWN_PROP | NULL | NULL | NULL | UNKNOWN_PROP | + | UNKNOWN_PROP | UNKNOWN_PROP | NULL | NULL | NULL | UNKNOWN_PROP | Then drop the used space Scenario: Project on not exist tag @@ -874,9 +874,9 @@ Feature: Prune Properties rule MATCH (v:player)-[e:like]->(t) WHERE v.player.name=='Tim Duncan' RETURN v.player.name, v.x.y, v.player.age """ Then the result should be, in any order, with relax comparison: - | v.player.name | v.x.y | v.player.age | - | "Tim Duncan" | __NULL__ | 42 | - | "Tim Duncan" | __NULL__ | 42 | + | v.player.name | v.x.y | v.player.age | + | "Tim Duncan" | NULL | 42 | + | "Tim Duncan" | NULL | 42 | When executing query: """ MATCH (v:player)-[:like]->(t) WHERE v.player.name=="Tim Duncan" RETURN v.player.name, properties(v), t @@ -891,8 +891,8 @@ Feature: Prune Properties rule """ Then the result should be, in any order, with relax comparison: | v.player.name | t.errortag.name | properties(v) | t | - | "Tim Duncan" | __NULL__ | {age: 42, name: "Tim Duncan", speciality: "psychology"} | ("Tony Parker" :player{age: 36, name: "Tony Parker"}) | - | "Tim Duncan" | __NULL__ | {age: 42, name: "Tim Duncan", speciality: "psychology"} | ("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"}) | + | "Tim Duncan" | NULL | {age: 42, name: "Tim Duncan", speciality: "psychology"} | ("Tony Parker" :player{age: 36, name: "Tony Parker"}) | + | "Tim Duncan" | NULL | {age: 42, name: "Tim Duncan", speciality: "psychology"} | ("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"}) | Scenario: no pruning on agg after unwind Given a graph with space named "nba" diff --git a/tests/tck/features/parser/nebula.feature b/tests/tck/features/parser/nebula.feature index 9d9fc4e09e1..7e802ce4155 100644 --- a/tests/tck/features/parser/nebula.feature +++ b/tests/tck/features/parser/nebula.feature @@ -17,7 +17,7 @@ Feature: Value parsing | BAD_DATA | BAD_DATA | | BAD_TYPE | BAD_TYPE | | OVERFLOW | ERR_OVERFLOW | - | __NULL__ | NULL | + | UNKNOWN_PROP | UNKNOWN_PROP | | DIV_BY_ZERO | DIV_BY_ZERO | | OUT_OF_RANGE | OUT_OF_RANGE | | 123 | iVal | diff --git a/tests/tck/utils/nbv.py b/tests/tck/utils/nbv.py index fb75b0569ae..6bc4e3a1714 100644 --- a/tests/tck/utils/nbv.py +++ b/tests/tck/utils/nbv.py @@ -42,7 +42,7 @@ 'BAD_DATA', 'BAD_TYPE', 'OVERFLOW', - '__NULL__', + 'UNKNOWN_PROP', 'DIV_BY_ZERO', 'OUT_OF_RANGE', 'FLOAT', @@ -100,9 +100,9 @@ def t_OVERFLOW(t): return t -def t___NULL__(t): - r'__NULL__' - t.value = Value(nVal=NullType.__NULL__) +def t_UNKNOWN_PROP(t): + r'UNKNOWN_PROP' + t.value = Value(nVal=NullType.UNKNOWN_PROP) return t @@ -239,7 +239,7 @@ def p_expr(p): | BAD_DATA | BAD_TYPE | OVERFLOW - | __NULL__ + | UNKNOWN_PROP | DIV_BY_ZERO | OUT_OF_RANGE | INT @@ -587,7 +587,7 @@ def parse_row(row): expected['BAD_DATA'] = Value(nVal=NullType.BAD_DATA) expected['BAD_TYPE'] = Value(nVal=NullType.BAD_TYPE) expected['OVERFLOW'] = Value(nVal=NullType.ERR_OVERFLOW) - expected['__NULL__'] = Value(nVal=NullType.__NULL__) + expected['UNKNOWN_PROP'] = Value(nVal=NullType.UNKNOWN_PROP) expected['DIV_BY_ZERO'] = Value(nVal=NullType.DIV_BY_ZERO) expected['OUT_OF_RANGE'] = Value(nVal=NullType.OUT_OF_RANGE) expected['123'] = Value(iVal=123)