Skip to content

Can't write Dataset[SensorData] to Kafka without transformation #6

Open
@konobey

Description

@konobey

Hello!

The code in notebook kafka-sensor-data-generator.snb.ipynb:

val query = sensorValues.writeStream.format("kafka")
  .queryName("kafkaWriter")
  .outputMode("append")
  .option("kafka.bootstrap.servers", kafkaBootstrapServer) // comma-separated list of host:port
  .option("topic", targetTopic)
  .option("checkpointLocation", workDir+"/generator-checkpoint")
  .option("failOnDataLoss", "false") // use this option when testing
  .start()

doesn't work because sensorValues is of type Dataset[SensorData], but there should be value attribute of type String concatenating all the attributes from Dataset[SensorData] row.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions