1fanwang opened a new pull request, #3178: URL: https://github.com/apache/hugegraph/pull/3178
## Purpose of the PR - Closes https://github.com/apache/hugegraph/issues/3165 A traversal such as `g.addV("person").property("name", "marko", "country", "cn")` accepts `country=cn` as metadata on `name`, then stores it as an ordinary property. HugeGraph does not support meta-properties. The call creates the wrong vertex. ## Main Changes Reject metadata while the strategy inspects property parameters. The traversal now raises `Properties on a vertex property is not supported` before any write. Leaving the step unfolded makes primary-key labels fail first with a missing-key error. Normal single-cardinality folding is unchanged. ## Verifying these changes - [x] Need tests and can be verified as follows: | Scenario | Result | |---|---| | Exact base, start and mid-traversal metadata | Both accept unsupported metadata | | Exact head | Both reject before a write; normal folding works | | Memory-backed core suite | Passed on JDK 11 | <details> <summary>Raw logs</summary> ```text $ RED=/tmp/hugegraph-3165-red $ TEST=hugegraph-server/hugegraph-test/src/main/java/org/apache/hugegraph/core/PrimaryKeyStrategyCoreTest.java $ git worktree add --detach "$RED" 321ba4dadad7bd37b8c659cdec34b056912d34b8 $ git archive c6738265af33096cfdea5030a2cc81acf53b3af7 "$TEST" | tar -x -C "$RED" $ cd "$RED" $ JAVA_HOME=$(/usr/libexec/java_home -v 11) mvn test \ -pl hugegraph-server/hugegraph-test -am -P core-test,memory \ -Dtest=PrimaryKeyStrategyCoreTest -DfailIfNoTests=false -Drevision=1.7.0 Tests run: 3, Failures: 2 Start step: No exception was thrown(expected java.lang.UnsupportedOperationException) Mid-traversal step: No exception was thrown(expected java.lang.UnsupportedOperationException) BUILD FAILURE $ GREEN=/tmp/hugegraph-3165-green $ git worktree add --detach "$GREEN" c6738265af33096cfdea5030a2cc81acf53b3af7 $ cd "$GREEN" $ JAVA_HOME=$(/usr/libexec/java_home -v 11) mvn test \ -pl hugegraph-server/hugegraph-test -am -P core-test,memory \ -Dtest=PrimaryKeyStrategyCoreTest -DfailIfNoTests=false -Drevision=1.7.0 Tests run: 3, Failures: 0 BUILD SUCCESS $ JAVA_HOME=$(/usr/libexec/java_home -v 11) mvn test \ -pl hugegraph-server/hugegraph-test -am -P core-test,memory \ -DfailIfNoTests=false -Drevision=1.7.0 Tests run: 807, Failures: 0, Errors: 0, Skipped: 94 BUILD SUCCESS ``` </details> ## Does this PR potentially affect the following parts? - [x] Nope ## Documentation Status - [x] `Doc - No Need` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
