Mihir-Rabari opened a new pull request, #3367:
URL: https://github.com/apache/hugegraph/pull/3367

   Fixes #3319
   
   I can reproduce the ClassCastException from the issue, but only against the 
TinkerPop version the 1.7.0 server ships with (3.5.x). The Cypher-to-Gremlin 
translation represents null as a reserved string marker inside the translated 
traversal, so a grouping key taken from a nullable boolean property ends up 
mixing true, false and that string in one result set. Ordering it makes the 
3.5.x descending comparator call `Boolean.compareTo` on a `String`, which is 
exactly the crash reported.
   
   On master we build against TinkerPop 3.8.1, where `Order` uses the 
cross-type orderability comparator, so the same query now sorts all three keys 
with Cypher null semantics — null first descending, last ascending. The crash 
is therefore already gone; what's missing is coverage keeping it that way.
   
   This adds `testOrderByNullableBooleanGroupingKey` to `CypherApiTest`: it 
creates a `cypher_person` without the nullable `active` property, runs the 
issue's query shape (MATCH + OPTIONAL MATCH + WITH count grouping) and orders 
by the boolean-or-null key in both directions, asserting the groups come back 
as null/true/false descending and false/true/null ascending, with the null 
marker surfaced as an actual null. The extra vertex is deleted afterwards so 
the rest of the suite sees the same data.
   
   Verified with the standard harness against a rocksdb-backed server:
   
   ```
   mvn test -pl hugegraph-server/hugegraph-test -am -P api-test,rocksdb 
-Dtest=CypherApiTest
   Tests run: 32, Failures: 0, Errors: 0, Skipped: 0
   ```
   
   No production code is touched — test-only.
   


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