Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2025 08:19 AM - edited 08-18-2025 08:22 AM
Hi, I am facing the exact same error. The method that I'm calling in the foreachBatch is just a very simple print statement that test whether the method is called or no, and the print is not printed out. Here's a code snippet:
def debug_batch(batch_df, batch_id):
print(f"Batch {batch_id} started, row count = {batch_df.count()}")
query = (
df.writeStream
.option("checkpointLocation", checkpoint_path)
.trigger(availableNow=True)
.foreachBatch(debug_batch)
.start()
.awaitTermination()
)