rezataroosheh opened a new pull request, #13744:
URL: https://github.com/apache/ignite/pull/13744

   ### What
   A local `IndexQuery` (`setLocal(true)`) on a cache that is not in 
keep-binary mode now returns deserialized keys and values, the same as the 
distributed query. Queries through `withKeepBinary()` still return 
`BinaryObject`s.
   
   ### Why
   `IndexQueryProcessor#queryLocal` always returns rows in binary form. On the 
distributed path, the query future converts them using the query's `keepBinary` 
flag (`GridCacheQueryFutureAdapter#unwrapIfNeeded`). The local path 
(`GridCacheQueryManager#indexQueryLocal`) skipped that step, so a typed read of 
a local result failed with `ClassCastException`. It was reported on the dev 
list.
   
   The fix applies the same `unwrapBinaryIfNeeded(..., qry.keepBinary(), ...)` 
call in `indexQueryLocal`. `IndexQueryProcessor` is not changed, because it 
also serves the remote side of distributed queries.
   
   Compatibility: code that reads local results of a non-keep-binary cache as 
`BinaryObject` will now get the cache's own classes. Such code can use 
`withKeepBinary()`, which keeps the binary form.
   
   Note: this touches the same method as #13735 (IGNITE-29191), so whichever is 
merged second needs a small rebase.
   
   ### Tests
   New tests in `IndexQueryLocalTest`:
   - `testLocalQueryReturnsDeserializedValues`: a local query on a 
non-keep-binary cache returns `Person` values. It fails without the fix (the 
values are `BinaryObject`s).
   - `testLocalQueryKeepBinaryReturnsBinaryValues`: a local query through 
`withKeepBinary()` still returns `BinaryObject`s.
   
   ### The Contribution Checklist
   - [x] There is a single JIRA ticket related to the pull request. 
   - [x] The web-link to the pull request is attached to the JIRA ticket.
   - [ ] The JIRA ticket has the _Patch Available_ state.
   - [x] The pull request body describes changes that have been made. 
   The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
   - [x] The pull request title is treated as the final commit message. 
   The following pattern must be used: `IGNITE-XXXX Change summary` where 
`XXXX` - number of JIRA issue.
   - [ ] A reviewer has been mentioned through the JIRA comments 
   (see [the Maintainers 
list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers))
 
   - [ ] The pull request has been checked by the Teamcity Bot and 
   the `green visa` attached to the JIRA ticket (see tab `PR Check` at [TC.Bot 
- Instance 1](https://tcbot2.sbt-ignite-dev.ru/prs.html) or [TC.Bot - Instance 
2](https://mtcga.gridgain.com/prs.html))
   
   ### Notes
   - [How to 
Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
   - [Coding abbreviation 
rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
   - [Coding 
Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
   - [Apache Ignite Teamcity 
Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
   
   If you need any help, please email [email protected] or ask any advice 
on https://the-asf.slack.com _#ignite_ channel.
   


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

Reply via email to