Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support null value for gremlin test #2061

Merged
merged 9 commits into from
Jan 16, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,6 @@ public static final ElementKeys classifyKeys(Object... keyValues) {
throw Element.Exceptions
.providedKeyValuesMustHaveALegalKeyOnEvenIndices();
}
if (val == null) {
throw Property.Exceptions.propertyDoesNotExist();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems need to skip the null value here with continue, also add the comment for why

}
imbajin marked this conversation as resolved.
Show resolved Hide resolved

if (key.equals(T.id)) {
elemKeys.id = val;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ public abstract class HugeProperty<V> implements Property<V>, GraphType {
public HugeProperty(HugeElement owner, PropertyKey pkey, V value) {
E.checkArgument(owner != null, "Property owner can't be null");
E.checkArgument(pkey != null, "Property key can't be null");
E.checkArgument(value != null, "Property value can't be null");

this.owner = owner;
this.pkey = pkey;
this.value = pkey.validValueOrThrow(value);
this.value = pkey.validValue(value);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can keep the origin code if the null value is skipped?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note also need to update HugeEdge.property(String key, V value) to add null value check (the same as HugeVertex.property(String key, V value)):

        if (value == null) {
            this.removeProperty(propertyKey.id());
            return EmptyProperty.instance();
        }

}

public PropertyKey propertyKey() {
Expand Down