caioguedes commented on code in PR #15482:
URL: https://github.com/apache/kafka/pull/15482#discussion_r1702110392


##########
streams/src/main/java/org/apache/kafka/streams/kstream/internals/KTableImpl.java:
##########
@@ -1229,7 +1229,7 @@ private <VR, KO, VO> KTable<K, VR> 
doJoinOnForeignKey(final KTable<KO, VO> forei
 
         final StreamPartitioner<K, SubscriptionResponseWrapper<VO>> 
foreignResponseSinkPartitioner =
                 tableJoinedInternal.partitioner() == null
-                        ? (topic, key, subscriptionResponseWrapper, 
numPartitions) -> subscriptionResponseWrapper.getPrimaryPartition()
+                        ? (topic, key, subscriptionResponseWrapper, 
numPartitions) -> 
Optional.of(Collections.singleton(subscriptionResponseWrapper.getPrimaryPartition()))

Review Comment:
   Sounds good, should we also create an additional constructor dropping the 
parameter `primaryPartition`? I see many calls of the actual constructor 
passing `null`? Something like this?
   
   ```java
   // New Additional Constructor
   public SubscriptionResponseWrapper(final long[] originalValueHash, final FV 
foreignValue) {
           this(originalValueHash, foreignValue, CURRENT_VERSION, null);
   }
   
   // Other Constructors
   public SubscriptionResponseWrapper(final long[] originalValueHash, final FV 
foreignValue, final Integer primaryPartition) {
           this(originalValueHash, foreignValue, CURRENT_VERSION, 
primaryPartition);
   }
   
   public SubscriptionResponseWrapper(
           final long[] originalValueHash,
           final FV foreignValue,
           final byte version,
           final Integer primaryPartition) {
           // ... code omitted 
           this.primaryPartition = Optional.ofNullable(primaryPartition);
   }
   ```



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