SebastianGruza opened a new pull request, #3184:
URL: https://github.com/apache/hugegraph/pull/3184
## Purpose of the PR
- part of #3090 (interim mitigation for the operator-sinking property codec
mismatch)
On 1.7.x with HStore, every sort-key **prefix-equality or range** traversal
fails, e.g. `g.V('a').outE('flow').has('asset','ETC')` → `Can't construct
Cardinality from code 0`, or with a range on the second sort key → `Unsupported
data type UNKNOWN`. Minimal REST+Gremlin reproducer:
https://gist.github.com/SebastianGruza/616f81e915f00f08c4be3dc447ca77c7
(analysis in https://github.com/apache/hugegraph/issues/3090#issuecomment — see
the September comment).
Root cause of the crash path: such a query reaches
`HstoreTable.queryByRange()` with **sysprop conditions only** (owner vertex,
direction, label, sort values) — all already enforced by the scan key range —
but `queryByRange()` pushed the serialized `ConditionQuery` to the store
**unconditionally**. The store-side row decoder then tries to parse property
values it cannot parse (server writes raw values, store reader expects a
self-describing `(cardinality<<6)|dataType` byte) and crashes on the first row
in range.
## Main Changes
1. `queryByRange()` now applies the **same `prepareConditionQuery()` guard
that `queryByPrefix()` already uses**: the query is pushed down only when
user-prop conditions remain. No on-disk format change, no store-side change;
the proper versioned sinking codec remains tracked in #3090.
2. Both `prepareConditionQuery()` / `prepareConditionQueryList()` now
operate on a **copy** of the origin query instead of mutating it via
`resetConditions()` — core still uses the origin query for its own result
filtering after the scan returns.
## Verifying these changes
- New unit tests in `HstoreTableTest` (a scan-recording `Session` fake):
- sysprop-only range query → `scan()` receives `null` query bytes, origin
query untouched;
- range query with a user-prop condition → query bytes are pushed **and**
the origin query keeps all its conditions (guards the copy-not-mutate change).
- `mvn -pl hugegraph-server/hugegraph-hstore -am test
-Dtest=HstoreTableTest`: 7/7 pass.
- Manual reproducer above: queries 1–6 all return correct results after the
patch (store row decoding is no longer reached for sysprop-only pushes).
## Does this PR potentially affect the following parts?
- [ ] Nope
- [x] Logic (the HStore range-scan pushdown path)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]