Unable to write Compressed messages to Kafka topic from Spark Structured Streaming

Viewed 38

We are using Spark Structured Streaming (3.2.1) to write into Kafka(0.10) topic. Since data volume is high, we are trying to write the data in Compressed format (snappy). But we do not see any effect on this. Also spark complains about 'compression.type' property is unknown. Does Spark Structured streaming support writing compressed messages to Kafka topic? If yes, what should be the configuration? Sample Code: var dataStreamWriter = finalDf .writeStream .format("kafka") .option("topic", topic) .option("kafka.compression.type", "snappy") .option("kafka.batch.size", "1024000") .option("checkpointLocation", checkpointLocation) .trigger(Trigger.ProcessingTime(triggerDuration + " seconds"))

0 Answers
Related