Skip to content

IGNITE-29199 Fix local IndexQuery returning binary objects for a cache not in keep-binary mode - #13744

Open
rezataroosheh wants to merge 1 commit into
apache:masterfrom
rezataroosheh:IGNITE-29199
Open

rezataroosheh wants to merge 1 commit into
apache:masterfrom
rezataroosheh:IGNITE-29199

Conversation

@rezataroosheh

@rezataroosheh rezataroosheh commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

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

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 BinaryObjects).
  • testLocalQueryKeepBinaryReturnsBinaryValues: a local query through withKeepBinary() still returns BinaryObjects.

The Contribution Checklist

  • There is a single JIRA ticket related to the pull request.
  • The web-link to the pull request is attached to the JIRA ticket.
  • The JIRA ticket has the Patch Available state.
  • The pull request body describes changes that have been made.
    The description explains WHAT and WHY was made instead of HOW.
  • 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)
  • 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 or TC.Bot - Instance 2)

Notes

If you need any help, please email dev@ignite.apache.org or ask any advice on https://the-asf.slack.com #ignite channel.

@rezataroosheh
rezataroosheh marked this pull request as ready for review October 23, 2026 22:05
@rezataroosheh rezataroosheh changed the title IGNITE-29199 Fix local IndexQuery returning binary objects for a cach… IGNITE-29199 Fix local IndexQuery returning binary objects for a cache not in keep-binary mode Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant