codelipenghui commented on a change in pull request #9590:
URL: https://github.com/apache/pulsar/pull/9590#discussion_r576525196
##########
File path:
pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/sink/PulsarSink.java
##########
@@ -400,7 +415,16 @@ public void close() throws Exception {
ConsumerConfig consumerConfig = new ConsumerConfig();
consumerConfig.setSchemaProperties(pulsarSinkConfig.getSchemaProperties());
if (!StringUtils.isEmpty(pulsarSinkConfig.getSchemaType())) {
- consumerConfig.setSchemaType(pulsarSinkConfig.getSchemaType());
+ if (GenericRecord.class.isAssignableFrom(typeArg)) {
+
consumerConfig.setSchemaType(SchemaType.AUTO_CONSUME.toString());
+ SchemaType configuredSchemaType =
SchemaType.valueOf(pulsarSinkConfig.getSchemaType());
+ if (SchemaType.AUTO_CONSUME != configuredSchemaType) {
Review comment:
Need to add
`consumerConfig.setSchemaType(pulsarSinkConfig.getSchemaType());` in this
branch?
----------------------------------------------------------------
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]