QuestionQ55

VerifiedDevelopment and Ingestion

A data engineer is streaming customer orders to a Kafka topic (orders_topic) and is now writing the ingestion script for a DLT pipeline. The engineer must ingest data from Kafka brokers into DLT using Databricks.

Which code correctly ingests the data?

Explanation

A DLT Python table can ingest Kafka by returning a streaming DataFrame created with spark.readStream.format("kafka"), specifying kafka.bootstrap.servers and subscribe, and calling load(). startingOffsets is a valid Kafka source option for choosing the initial offset position. Databricks documents this same DLT Kafka ingestion pattern.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!