jeqo commented on a change in pull request #11099:
URL: https://github.com/apache/kafka/pull/11099#discussion_r675002211



##########
File path: 
streams/src/main/java/org/apache/kafka/streams/kstream/internals/KTableSource.java
##########
@@ -92,33 +98,62 @@ public void init(final 
org.apache.kafka.streams.processor.ProcessorContext conte
         }
 
         @Override
-        public void process(final K key, final V value) {
+        public void process(final Record<KIn, VIn> record) {
             // if the key is null, then ignore the record
-            if (key == null) {
-                LOG.warn(
-                    "Skipping record due to null key. topic=[{}] 
partition=[{}] offset=[{}]",
-                    context().topic(), context().partition(), 
context().offset()
-                );
+            if (record.key() == null) {
+                if (context.recordMetadata().isPresent()) {
+                    final RecordMetadata recordMetadata = 
context.recordMetadata().get();
+                    LOG.warn(
+                        "Skipping record due to null key. "
+                            + "value=[{}] topic=[{}] partition=[{}] 
offset=[{}]",

Review comment:
       No worries. This is actually a good findings, as there are other 16 
places where we are logging value and keys.  Maybe let's create a issue to 
handle this in another PR? 
   
   <img width="955" alt="image" 
src="https://user-images.githubusercontent.com/6180701/126681148-2bd07547-5f56-4cc8-a9f1-88b4826b983e.png";>
   




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