rezataroosheh commented on code in PR #13770:
URL: https://github.com/apache/ignite/pull/13770#discussion_r4442137417


##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java:
##########
@@ -1734,16 +1735,22 @@ private CacheContinuousQueryEntry 
transformToEntry(IgniteClosure<CacheEntryEvent
             oldVal = null;
         }
 
+        // The transformer result is not a cache value, so the keep binary 
flag of the cache does not apply to it.
+        // Keep it binary only if the transformer returned a BinaryObject, as 
on the local node.
+        boolean keepBinary = transVal instanceof BinaryObject;

Review Comment:
   Thanks, I see your point now.
   
   I tried using only `evt.entry().isKeepBinary()` before sending the PR, and 
it didn't work, so it can't replace the check. It comes from the query, so on a 
`withKeepBinary()` cache, it is `true` for both a `PersonId` result and a 
`BinaryObject` result. Master uses only this flag today, and that is the 
reported bug.
   
   To choose correctly, we have to look at what the transformer returned. For 
the `instanceof`, I can use the existing helper, as `GridQueryProcessor` does:
   
   ```java
   boolean keepBinary = ctx.cacheObjects().isBinaryObject(transVal);
   ```
   
   It is the same check inside, but it goes through the existing API. Would 
that work for you, or do you have a different approach in mind?
   



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