Átomo
127Wt
Streaming · Spark

writeStream

Abrir na tabela

Definição

Grava o resultado de um fluxo num destino, de forma contínua ou por lotes.

Exemplos

1. Para tabela Delta
q = (df.writeStream
       .option("checkpointLocation", "/chk/silver_events")
       .toTable("silver.events"))
2. Modo de saída
q = (agg.writeStream
       .outputMode("complete")
       .option("checkpointLocation", "/chk/gold_summary")
       .toTable("gold.summary"))
3. Para Kafka
q = (output.writeStream.format("kafka")
       .option("kafka.bootstrap.servers", "broker:9092")
       .option("topic", "processed_orders")
       .option("checkpointLocation", "/chk/kafka_out")
       .start())

No mesmo grupo