contrueCT commented on code in PR #2994:
URL: https://github.com/apache/hugegraph/pull/2994#discussion_r4033232188
##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/store/ram/RamTable.java:
##########
@@ -316,7 +328,7 @@ private Iterator<HugeEdge> query(ConditionQuery query) {
if (dir == null) {
dir = Directions.BOTH;
}
- Id label = query.condition(HugeKeys.LABEL);
+ Id label = query.singleConditionValueOrNull(HugeKeys.LABEL);
Review Comment:
Addressed in 0cebc418. RamTable now uses the wildcard only when no top-level
LABEL EQ/IN relation exists. Otherwise the flattened branch requires a single
resolved value and throws IllegalStateException for empty/conflicting or
multiple candidates. Added direct private-branch regressions that bypass
matched()/flatten(), plus wildcard/single-label positive controls; the existing
public multi-label OUT/IN/BOTH regression still passes. The new rejection test
failed against the old implementation. Validation on the SSH host: 19 targeted
unit tests and 10 RocksDB label-query/paging tests passed with no skips;
formatting and full-module clean compile passed.
##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/GraphIndexTransaction.java:
##########
@@ -415,8 +417,11 @@ private IdHolderList queryByLabel(ConditionQuery query) {
HugeType queryType = query.resultType();
IndexLabel il = IndexLabel.label(queryType);
validateIndexLabel(il);
- Id label = query.condition(HugeKeys.LABEL);
- assert label != null;
+ // Query-by-label builds a label index entry and requires one
+ // deterministically resolved label instead of best-effort fallback.
+ Id label = query.conditionValue(HugeKeys.LABEL);
+ E.checkState(label != null, "Expect one label value for query: %s",
Review Comment:
Addressed in 0cebc418. queryIndex() now passes its already-resolved label
into queryByLabel(query, label), which no longer repeats resolution or the
redundant non-null check. Vertex/edge label query, pagination, and multi-label
regressions passed on RocksDB, along with the targeted unit tests and
full-module clean compile.
--
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]