Streaming: Write to Kafka Topic

Medium
Streaming
Kafka
writeStream
Uber
Databricks

Streaming: Write to Kafka Topic

Read orders_topic, filter to placed orders, then write the result to orders_placed_topic using writeStream with format('kafka'), outputMode('append'), and a processing-time trigger:

df.writeStream.format('kafka')    .option('topic', 'orders_placed_topic')    .option('startingOffsets', 'earliest')    .outputMode('append')    .trigger(processingTime='10 seconds')    .start()

Return the filtered DataFrame. The write intent is recorded - nothing is actually sent to Kafka.

Browser Engine: Evaluates PySpark DataFrame & SQL logic locally in Pyodide WebAssembly.

Input data

0 DataFrames

These DataFrames are passed to solve(spark, dfs). Access one with dfs['name'].

Browser engine
Loading Python editor…
Click Run to try the sample cases, or Submit to check the hidden cases. First run caches the browser Python engine (~8–15s once); all code stays on your device.