Chuckame commented on code in PR #16218:
URL: https://github.com/apache/kafka/pull/16218#discussion_r1823583121


##########
streams/src/main/java/org/apache/kafka/streams/kstream/internals/foreignkeyjoin/ForeignTableJoinProcessorSupplier.java:
##########
@@ -111,34 +110,26 @@ public void process(final Record<KO, Change<VO>> record) {
                 return;
             }
 
-            final Bytes prefixBytes = keySchema.prefixBytes(record.key());
+            final Bytes foreignKeyBytes = keySchema.prefixBytes(record.key());
 
             //Perform the prefixScan and propagate the results
             try (final KeyValueIterator<Bytes, 
ValueAndTimestamp<SubscriptionWrapper<K>>> prefixScanResults =
-                     subscriptionStore.range(prefixBytes, 
Bytes.increment(prefixBytes))) {
+                     subscriptionStore.prefixScan(foreignKeyBytes, new 
BytesSerializer())) {

Review Comment:
   Btw, I'm still unsure if we accept this kind of unsafe casts in the default 
poor's man implementation, where we assume that the prefix must be `Bytes` and 
the key should be also `Bytes` (as we use `range(prefix, 
Bytes.increment(prefix))`:
   
   ```java
       default <PS extends Serializer<P>, P> KeyValueIterator<K, V> 
prefixScan(P prefix, PS prefixKeySerializer) {
           if (!(prefix instanceof Bytes)) {
               throw new UnsupportedOperationException();
           }
           final KeyValueIterator<K, V> inclusiveRangeIterator = range((K) 
prefix, (K) Bytes.increment((Bytes) prefix));
           return (KeyValueIterator<K, V>) new 
PrefixScanKeyValueIterator<>((KeyValueIterator<Bytes, V>) 
inclusiveRangeIterator, (Bytes) prefix);
       }
   ```
   
   Isn't it a candidate of breaking change for 4.0 client ?



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