gortiz commented on code in PR #11753:
URL: https://github.com/apache/pinot/pull/11753#discussion_r1366562350


##########
pinot-plugins/pinot-input-format/pinot-protobuf/src/test/java/org/apache/pinot/plugin/inputformat/protobuf/ProtoBufConfluentSchemaTest.java:
##########
@@ -94,8 +103,16 @@ public void testSamplePinotConsumer()
     ConsumerRecords<byte[], byte[]> consumerRecords = 
kafkaConsumer.poll(Duration.ofMillis(1000));
     Iterator<ConsumerRecord<byte[], byte[]>> iter = consumerRecords.iterator();
 
+    Consumer<Message> onMessage = message -> {
+      // we use this to verify we are not creating/consuming modified 
descriptors
+      // older versions of confluent connectors (7.1.x and lower) used to 
rewrite proto3 optional as oneof at descriptor
+      // level. Newer versions of confluent consumers support both 
alternatives.
+      Descriptors.FieldDescriptor optionalField = 
message.getDescriptorForType().findFieldByName("optionalField");
+      Assert.assertNull(optionalField.getRealContainingOneof(), "Received 
protobuf have been rewritten");

Review Comment:
   It is true that this test, right now, mostly tests that using the same 
version, confluent can produce and read messages, which is quite useless.
   
   But the test does not take long to run and having it here can be useful to 
verify future inconsistencies. Imagine that a future confluent v8 producer has 
some incompatibilities with a v7 reader. By using this code we can manually run 
the test with different versions of producers and readers.
   
   If you think it is not useful, we can just remove it.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to