cometa-haley opened a new issue, #15434:
URL: https://github.com/apache/pulsar/issues/15434

   ### What issue do you find in Pulsar docs?
   
   I am having a lot of issues while working with Functions and Connectors for 
the following reason: 
   If a create a producer using python like this:
   ```
   class InfluxTestSchema(Record):
       measurement = String()
       tags = Map(String())
       fields = Map(Integer())
   
   
   
   client = pulsar.Client('pulsar://localhost:6650')
   producer = client.create_producer('another-test-topic', 
schema=JsonSchema(InfluxTestSchema))
   while True:
       msg = InfluxTestSchema(
           measurement='test_measurement',
           tags={"name": f'mickey_mouse'},
           fields={"age": random.randint(0, 100)}
       )
       producer.send(msg)
       sleep(5)
   ```
   
   I am then able to use the a connector for loading the data somewhere else. 
BUT if I try to use a function to preprocess the data in some way,  Connectors 
(I have tried Postgres and Influx) don't seem to be able to deserialize the 
data correctly. 
   Currently I am trying to use a custom SerDe class for achieving the same 
effect as  `JsonSchema(InfluxTestSchema)` in create_producer, but it doesn't 
seem to work. 
   
   I would like to know how can I achieve the same behavior or how can I tell 
my sink that I am using a custom SerDe class (since I cannot give the sink my 
python code).
   Sorry if it is a dumb question, I am kind of a Pulsar n00b.
   
   ### What is your suggestion?
   
   Maybe some documentation in the functions section would help. If I figure 
out how to accomplish the task, would be glad to help out documenting it =)
   
   ### Do you have any references?
   
   Main source: https://pulsar.apache.org/docs/en/functions-develop/
   
   ### Would you like to fix this issue?
   
   Yes <3!
   
   ### Note
   
   - [X] I have researched my question.


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