nlu90 commented on code in PR #18432:
URL: https://github.com/apache/pulsar/pull/18432#discussion_r1097957141
##########
pulsar-functions/instance/src/main/python/python_instance.py:
##########
@@ -460,3 +481,45 @@ def close(self):
if self.pulsar_client:
self.pulsar_client.close()
+
+ def get_schema(self, schema_type, type_class_name, schema_properties):
+ schema = DEFAULT_SCHEMA
+ if schema_type == "" or schema_type is None:
+ schema = DEFAULT_SCHEMA
+ elif schema_type.lower() == "string":
+ schema = pulsar.schema.StringSchema()
+ elif schema_type.lower() == "json":
+ record_kclass = self.get_record_class(type_class_name)
+ schema = pulsar.schema.JsonSchema(record_kclass)
+ elif schema_type.lower() == "avro":
+ record_kclass = self.get_record_class(type_class_name)
+ schema = pulsar.schema.AvroSchema(record_kclass, schema_properties)
+ else: # load custom schema
Review Comment:
If not supported yet, we need to add some todo
--
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]