SebastianGruza commented on code in PR #3184:
URL: https://github.com/apache/hugegraph/pull/3184#discussion_r3926342194
##########
hugegraph-server/hugegraph-hstore/src/main/java/org/apache/hugegraph/backend/store/hstore/HstoreTable.java:
##########
@@ -642,16 +650,16 @@ protected BackendColumnIterator queryByRange(Session
session,
}
if (origin instanceof ConditionQuery &&
(query.resultType().isEdge() || query.resultType().isVertex())) {
- cq = (ConditionQuery) query.originQuery();
-
- // LOG.debug("query {} with ownerKeyFrom: {}, ownerKeyTo: {}, " +
- // "keyFrom: {}, keyTo: {}, " +
- // "scanType: {}, conditionQuery: {}",
- // this.table(), bytes2String(ownerStart),
- // bytes2String(ownerEnd), bytes2String(start),
- // bytes2String(end), type, cq.bytes());
+ // Same guard as queryByPrefix(): only push the query down to the
+ // store when user-prop conditions remain. A sort-key prefix/range
+ // query keeps sysprop conditions only (owner vertex, direction,
+ // label, sort values), which are already enforced by the key
+ // range, and the store-side row decoder cannot parse the raw
+ // property layout written by the server (see issue #3090).
+ cq = prepareConditionQuery((ConditionQuery) origin);
+ byte[] queryBytes = cq == null ? null : cq.bytes();
Review Comment:
Done in 0ecc10a — `queryBytes` is initialised before the `if`, assigned
inside it, and the method ends with a single `session.scan(...)`; `cq` is
block-local now.
##########
hugegraph-server/hugegraph-hstore/src/main/java/org/apache/hugegraph/backend/store/hstore/HstoreTable.java:
##########
@@ -594,8 +599,11 @@ private ConditionQuery
prepareConditionQueryList(ConditionQuery conditionQuery)
}
}
if (newConditions.size() > 0) {
- conditionQuery.resetConditions(newConditions);
- return conditionQuery;
+ // NOTE: copy before reset, see prepareConditionQuery()
+ ConditionQuery pushdown = conditionQuery.copy();
+ pushdown.resetConditions(newConditions);
+ pushdown.setOriginQuery(null);
Review Comment:
Done in 0ecc10a — `ScanRecordingSession.scan(String, List<HgOwnerKey>, int,
long, byte[])` now records (query bytes, owner keys, one iterator per key)
instead of throwing, and `testPrefixListQueryPushesCopyAndKeepsOrigin` drives
`prepareConditionQueryList()` through `queryByPrefixList()` with one origin
shared by two prefix queries: the origin keeps all of its conditions including
`OWNER_VERTEX`, the decoded pushed payload has no `OWNER_VERTEX`, keeps `LABEL`
and the user-prop condition, and `originQuery` is null. 8/8 with `mvn -pl
hugegraph-server/hugegraph-hstore -am -Dtest=HstoreTableTest test` on Temurin
17.
--
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]