contrueCT commented on code in PR #2994:
URL: https://github.com/apache/hugegraph/pull/2994#discussion_r4071204925


##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/GraphTransaction.java:
##########
@@ -1957,7 +1957,8 @@ private boolean rightResultFromIndexQuery(Query query, 
HugeElement elem) {
         }
 
         ConditionQuery cq = (ConditionQuery) query;
-        if (cq.condition(HugeKeys.LABEL) != null && cq.resultType().isEdge()) {
+        if (cq.singleConditionValueOrNull(HugeKeys.LABEL) != null &&

Review Comment:
   Addressed in a07f6aae, merging master 83ef9f3f (including #3213) without 
rewriting branch history. Both the new fetcher lambda and 
rightResultFromIndexQuery retain singleConditionValueOrNull(LABEL); no 
production condition(HugeKeys.LABEL) calls remain. One architectural 
distinction: #3193 removed queryNeedsPostFilter and its cache callers entirely. 
The new cache stores raw batch candidates and filters them using the batch 
context, so I preserved that design rather than reintroducing the obsolete 
cache gate. Added a direct regression for multi-label, single-resolved-label, 
and empty-intersection decisions in the new result-filter path, retaining 
master’s context tests. Java 11 validation: 31 unit tests passed (5 additional 
Core/RamTable cases skipped), 26 RocksDB edge label/paging/count tests passed 
(1 skipped), and all 28 CachedGraphTransactionTest cases passed. Formatting and 
all-module clean compilation passed. The complete distributed HTTP matrix was 
not rerun; CI is not clai
 med.



##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/GraphIndexTransaction.java:
##########
@@ -768,11 +771,17 @@ private PageIds doIndexQueryOnce(IndexLabel indexLabel,
     @Watched(prefix = "index")
     private Set<MatchedIndex> collectMatchedIndexes(ConditionQuery query) {
         ISchemaTransaction schema = this.params().schemaTransaction();
-        Id label = query.condition(HugeKeys.LABEL);
+        boolean hasLabelValues = query.containsConditionValues(HugeKeys.LABEL);
+        Set<Object> labels = query.conditionValues(HugeKeys.LABEL);
 
         List<? extends SchemaLabel> schemaLabels;
-        if (label != null) {
-            // Query has LABEL condition
+        if (hasLabelValues && labels.isEmpty()) {
+            // LABEL EQ/IN conditions resolve to an empty intersection.
+            return Collections.emptySet();

Review Comment:
   Addressed in a07f6aae by removing the duplicate empty-intersection guard 
from collectMatchedIndexes(). queryByUserprop() remains the single owner of the 
early empty-result return, following your first suggestion. This avoids 
introducing a separate null-producing cleanup path through that redundant guard.



-- 
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]

Reply via email to