[GitHub] [pulsar] eolivelli commented on pull request #9895: Implement Schema#OBJECT - support for Consumer

Fri, 19 Mar 2021 00:22:04 -0700


eolivelli commented on pull request #9895:
URL: https://github.com/apache/pulsar/pull/9895#issuecomment-802613355


   @jerrypeng the point here is about having a way to build **general purpose** 
Consumers and especially Sinks (I will send a follow up patch for Pulsar IO 
once we decide the right way for this feature) without knowing at compile time 
the schema.
   
   So this is not about not using a Schema, but the point is to be able to 
consume all of the Schemas automatically.
   
   If I do not set a schema, I can only see a byte[], and I lose all of the 
information about the type of data.
   
   We already have Schema.AUTO_CONSUME() and downloads automatically the schema 
and decodes the payload to a higher level model.
   
   This patch is only about extending AUTO_CONSUME() in order to deal with 
primitive types and with KeyValue (and ProtobufNative, but this is another 
story).
   Unfortunately we cannot change the signature of AUTO_CONSUME from 
Schema<GenericRecord> to Schema<Object>, so I am adding a new static method 
Schema.OBJECT().
   
   I am putting up a Google Doc in order to illustrate all of the aspects of 
the problem I want to solve and which are the alternatives


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to